Object

org.bitcoins.testkit.core.gen

TransactionGenerators

Related Doc: package gen

Permalink

object TransactionGenerators extends BitcoinSLogger

Linear Supertypes
BitcoinSLogger, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. TransactionGenerators
  2. BitcoinSLogger
  3. AnyRef
  4. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. def baseTransaction: Gen[BaseTransaction]

    Permalink
  6. def baseTransactionTo(spk: ScriptPubKey): Gen[BaseTransaction]

    Permalink

    Generates a legacy transaction with at least one output paying to the given SPK

  7. def buildCreditingTransaction(version: Int32, scriptPubKey: ScriptPubKey, amount: CurrencyUnit): (Transaction, UInt32)

    Permalink
  8. def buildCreditingTransaction(version: Int32, output: TransactionOutput): (Transaction, UInt32)

    Permalink
  9. def buildCreditingTransaction(version: Int32, scriptPubKey: ScriptPubKey): (Transaction, UInt32)

    Permalink

    Builds a crediting transaction with a transaction version parameter.

    Builds a crediting transaction with a transaction version parameter. Example: useful for creating transactions with scripts containing OP_CHECKSEQUENCEVERIFY.

  10. def buildCreditingTransaction(scriptPubKey: ScriptPubKey, amount: CurrencyUnit): (Transaction, UInt32)

    Permalink
  11. def buildCreditingTransaction(scriptPubKey: ScriptPubKey): (Transaction, UInt32)

    Permalink

    Mimics this test utility found in bitcoin core https://github.com/bitcoin/bitcoin/blob/605c17844ea32b6d237db6d83871164dc7d59dab/src/test/script_tests.cpp#L57

    Mimics this test utility found in bitcoin core https://github.com/bitcoin/bitcoin/blob/605c17844ea32b6d237db6d83871164dc7d59dab/src/test/script_tests.cpp#L57

    returns

    the transaction and the output index of the scriptPubKey

  12. def buildSpendingTransaction(version: Int32, creditingTx: Transaction, scriptSignature: ScriptSignature, outputIndex: UInt32, witness: TransactionWitness): (WitnessTransaction, UInt32)

    Permalink
  13. def buildSpendingTransaction(creditingTx: Transaction, scriptSignature: ScriptSignature, outputIndex: UInt32, witness: TransactionWitness): (WitnessTransaction, UInt32)

    Permalink
  14. def buildSpendingTransaction(version: Int32, creditingTx: Transaction, scriptSignature: ScriptSignature, outputIndex: UInt32, locktime: UInt32, sequence: UInt32, witness: TransactionWitness, outputs: Seq[TransactionOutput]): (WitnessTransaction, UInt32)

    Permalink
  15. def buildSpendingTransaction(version: Int32, creditingTx: Transaction, scriptSignature: ScriptSignature, outputIndex: UInt32, locktime: UInt32, sequence: UInt32, witness: TransactionWitness): (WitnessTransaction, UInt32)

    Permalink
  16. def buildSpendingTransaction(creditingTx: Transaction, scriptSignature: ScriptSignature, outputIndex: UInt32, locktime: UInt32, sequence: UInt32, witness: TransactionWitness): (WitnessTransaction, UInt32)

    Permalink

    Builds a spending WitnessTransaction with the given parameters

  17. def buildSpendingTransaction(creditingTx: Transaction, scriptSignature: ScriptSignature, outputIndex: UInt32): (Transaction, UInt32)

    Permalink

    Builds a spending transaction according to bitcoin core with max sequence and a locktime of zero.

    Builds a spending transaction according to bitcoin core with max sequence and a locktime of zero.

    returns

    the built spending transaction and the input index for the script signature

  18. def buildSpendingTransaction(version: Int32, creditingTx: Transaction, scriptSignature: ScriptSignature, outputIndex: UInt32, locktime: UInt32, sequence: UInt32, outputs: Seq[TransactionOutput]): (Transaction, UInt32)

    Permalink
  19. def buildSpendingTransaction(version: Int32, creditingTx: Transaction, scriptSignature: ScriptSignature, outputIndex: UInt32, locktime: UInt32, sequence: UInt32): (Transaction, UInt32)

    Permalink

    Builds a spending transaction according to bitcoin core

    Builds a spending transaction according to bitcoin core

    returns

    the built spending transaction and the input index for the script signature

  20. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  21. def csvTransaction(csvScriptNum: ScriptNumber, sequence: UInt32): Gen[(BaseTxSigComponent, Seq[ECPrivateKey])]

    Permalink
  22. def dummyOutputs: Seq[TransactionOutput]

    Permalink
  23. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  24. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  25. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  26. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  27. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  28. def input: Gen[TransactionInput]

    Permalink

    Generates a random TransactionInput

  29. def inputs: Gen[List[TransactionInput]]

    Permalink
  30. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  31. lazy val logger: Logger

    Permalink
    Definition Classes
    BitcoinSLogger
  32. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  33. def nonEmptyOutputTransaction: Gen[Transaction]

    Permalink

    Generates a transaction with at least one output

  34. def nonEmptySmallTransactions: Gen[Seq[Transaction]]

    Permalink
  35. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  36. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  37. def outPoint: Gen[TransactionOutPoint]

    Permalink

    Responsible for generating TransactionOutPoint

  38. def output: Gen[TransactionOutput]

    Permalink

    Generates a random TransactionOutput

  39. def outputTo(spk: ScriptPubKey): Gen[TransactionOutput]

    Permalink

    Generates a random TX output paying to the given SPK

  40. def outputs: Gen[List[TransactionOutput]]

    Permalink
  41. def randomCLTVTransaction: Gen[(BaseTxSigComponent, Seq[ECPrivateKey])]

    Permalink

    Generates a validly constructed CLTV transaction, which has a 50/50 chance of being spendable or unspendable.

  42. def realisticOutput: Gen[TransactionOutput]

    Permalink

    Outputs that only have a positive amount of satoshis, techinically the bitcoin protocol allows you to have negative value outputs

  43. def realisticOutputs: Gen[Seq[TransactionOutput]]

    Permalink
  44. def signedMultiSigTransaction: Gen[(BaseTxSigComponent, Seq[ECPrivateKey])]

    Permalink

    Creates a sequence of ECPrivateKey, then creates a MultiSignatureScriptPubKey from those private keys.

    Creates a sequence of ECPrivateKey, then creates a MultiSignatureScriptPubKey from those private keys. Finally creates a Transaction that spends the MultiSignatureScriptPubKey correctly

  45. def signedP2PKHTransaction: Gen[(BaseTxSigComponent, ECPrivateKey)]

    Permalink

    Creates a ECPrivateKey, then creates a P2PKHScriptPubKey from that private key Finally creates Transaction that spends the P2PKHScriptPubKey correctly

  46. def signedP2PKTransaction: Gen[(BaseTxSigComponent, ECPrivateKey)]

    Permalink

    Creates a ECPrivateKey, then creates a P2PKScriptPubKey from that private key Finally creates a Transaction that spends the P2PKScriptPubKey correctly

  47. def signedP2SHP2WPKHTransaction: Gen[(WitnessTxSigComponent, Seq[ECPrivateKey])]

    Permalink

    Creates a signed P2SH(P2WPKH) transaction

  48. def signedP2SHP2WSHTransaction: Gen[(WitnessTxSigComponent, Seq[ECPrivateKey])]

    Permalink

    Creates a signed P2SH(P2WSH) transaction

  49. def signedP2SHTransaction: Gen[(BaseTxSigComponent, Seq[ECPrivateKey])]

    Permalink

    Creates a transaction which contains a P2SHScriptSignature that correctly spends a P2SHScriptPubKey

  50. def signedP2WPKHTransaction: Gen[(WitnessTxSigComponent, Seq[ECPrivateKey])]

    Permalink

    Generates a WitnessTransaction that has all of it's inputs signed correctly

  51. def signedP2WSHMultiSigTransaction: Gen[(WitnessTxSigComponentRaw, Seq[ECPrivateKey])]

    Permalink
  52. def signedP2WSHP2PKHTransaction: Gen[(WitnessTxSigComponentRaw, Seq[ECPrivateKey])]

    Permalink

    Generates a WitnessTransaction that has an input spends a raw P2WSH WitnessScriptPubKey

  53. def signedP2WSHP2PKTransaction: Gen[(WitnessTxSigComponentRaw, Seq[ECPrivateKey])]

    Permalink

    Generates a WitnessTransaction that has an input spends a raw P2WSH WitnessScriptPubKey

  54. def signedP2WSHTransaction: Gen[(WitnessTxSigComponentRaw, Seq[ECPrivateKey])]

    Permalink
  55. def smallInputs: Gen[Seq[TransactionInput]]

    Permalink

    Generates a small list of TransactionInput

  56. def smallInputsNonEmpty: Gen[Seq[TransactionInput]]

    Permalink

    Generates a small non empty list of TransactionInput

  57. def smallOutputs(totalAmount: CurrencyUnit): Gen[Seq[TransactionOutput]]

    Permalink

    Creates a small sequence of outputs whose total sum is <= totalAmount

  58. def smallOutputs: Gen[Seq[TransactionOutput]]

    Permalink

    Generates a small list of TransactionOutput

  59. def smallOutputsTo(spk: ScriptPubKey): Gen[Seq[TransactionOutput]]

    Permalink

    Generates a small list of TX outputs paying to the given SPK

  60. def smallP2SHOutputs(totalAmount: CurrencyUnit): Gen[Seq[(TransactionOutput, ScriptPubKey)]]

    Permalink

    Creates a small sequence of outputs whose total sum is <= totalAmount

    Creates a small sequence of outputs whose total sum is <= totalAmount

    returns

    Sequence of outputs and corresponding Redeem Scripts

  61. def smallP2WSHOutputs(totalAmount: CurrencyUnit): Gen[Seq[(TransactionOutput, ScriptPubKey)]]

    Permalink
  62. def smallTransactions: Gen[Seq[Transaction]]

    Permalink

    Generates a small list of Transaction

  63. def spendableCLTVTransaction: Gen[(BaseTxSigComponent, Seq[ECPrivateKey])]

    Permalink

    Creates a ECPrivateKey, then creates a CLTVScriptPubKey from that private key.

    Creates a ECPrivateKey, then creates a CLTVScriptPubKey from that private key. Finally creates a Transaction that can successfully spend the CLTVScriptPubKey

  64. def spendableCLTVValues: Gen[(ScriptNumber, UInt32)]

    Permalink

    generates a ScriptNumber and UInt32 locktime for a transaction such that the tx will be spendable

  65. def spendableCSVTransaction: Gen[(BaseTxSigComponent, Seq[ECPrivateKey])]

    Permalink

    Creates a ECPrivateKey, then creates a CSVScriptPubKey from that private key.

    Creates a ECPrivateKey, then creates a CSVScriptPubKey from that private key. Finally creates a Transaction that can successfully spend the CSVScriptPubKey

  66. def spendableCSVValues: Gen[(ScriptNumber, UInt32)]

    Permalink

    Generates a pair of CSV values: a transaction input sequence, and a CSV script sequence value, such that the txInput sequence mask is always greater than the script sequence mask (i.e.

    Generates a pair of CSV values: a transaction input sequence, and a CSV script sequence value, such that the txInput sequence mask is always greater than the script sequence mask (i.e. generates values for a validly constructed and spendable CSV transaction)

  67. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  68. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  69. def transaction: Gen[Transaction]

    Permalink
  70. def transactionTo(spk: ScriptPubKey): Gen[Transaction]

    Permalink

    Generates a transaction where at least one output pays to the given SPK

  71. def transactions: Gen[Seq[Transaction]]

    Permalink

    Generates an arbitrary Transaction This transaction's TransactionInputs will not evaluate to true inside of the ScriptInterpreter

  72. def unspendableCLTVTransaction: Gen[(BaseTxSigComponent, Seq[ECPrivateKey])]

    Permalink

    Creates a ECPrivateKey, then creates a CLTVScriptPubKey from that private key Finally creates a Transaction that CANNNOT spend the CLTVScriptPubKey because the LockTime requirement is not satisfied (i.e.

    Creates a ECPrivateKey, then creates a CLTVScriptPubKey from that private key Finally creates a Transaction that CANNNOT spend the CLTVScriptPubKey because the LockTime requirement is not satisfied (i.e. the transaction's lockTime has not surpassed the CLTV value in the CLTVScriptPubKey)

  73. def unspendableCLTVValues: Gen[(ScriptNumber, UInt32)]

    Permalink

    Generates a ScriptNumber and UInt32 locktime for a transaction such that the tx will be unspendable

  74. def unspendableCSVTransaction: Gen[(BaseTxSigComponent, Seq[ECPrivateKey])]

    Permalink

    Creates a CSV transaction that's timelock has not been met

  75. def unspendableCSVValues: Gen[(ScriptNumber, UInt32)]

    Permalink

    Generates a pair of CSV values: a transaction input sequence, and a CSV script sequence value, such that the txInput sequence mask is always less than the script sequence mask (i.e.

    Generates a pair of CSV values: a transaction input sequence, and a CSV script sequence value, such that the txInput sequence mask is always less than the script sequence mask (i.e. generates values for a validly constructed and NOT spendable CSV transaction).

  76. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  77. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  78. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  79. def witnessTransaction: Gen[WitnessTransaction]

    Permalink

    Generates a random WitnessTransaction

  80. def witnessTransactionTo(spk: ScriptPubKey): Gen[WitnessTransaction]

    Permalink

    Generates a SegWit TX where at least one output pays to the given SPK

Inherited from BitcoinSLogger

Inherited from AnyRef

Inherited from Any

Ungrouped