o

org.bitcoins.testkitcore.gen

TransactionGenerators

object TransactionGenerators

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

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def baseTransaction: Gen[BaseTransaction]
  6. def baseTransactionTo(spk: ScriptPubKey): Gen[BaseTransaction]

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

  7. def buildCreditingTransaction(version: Int32, output: TransactionOutput, outpoint: TransactionOutPoint): (Transaction, UInt32)
  8. def buildCreditingTransaction(version: Int32, scriptPubKey: ScriptPubKey, amount: CurrencyUnit): (Transaction, UInt32)
  9. def buildCreditingTransaction(version: Int32, output: TransactionOutput): (Transaction, UInt32)
  10. def buildCreditingTransaction(version: Int32, scriptPubKey: ScriptPubKey): (Transaction, UInt32)

    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.

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

    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

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

    Builds a spending WitnessTransaction with the given parameters

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

    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

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

    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

  21. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native()
  22. def csvTransaction(csvScriptNum: ScriptNumber, sequence: UInt32): Gen[(BaseTxSigComponent, Seq[ECPrivateKey])]
  23. def dummyOutputs: Seq[TransactionOutput]
  24. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  25. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  26. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable])
  27. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  28. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  29. def input: Gen[TransactionInput]

    Generates a random TransactionInput

  30. def inputs: Gen[List[TransactionInput]]
  31. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  32. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  33. def nonEmptyOutputTransaction: Gen[Transaction]

    Generates a transaction with at least one output

  34. def nonEmptySmallTransactions: Gen[Seq[Transaction]]
  35. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  36. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  37. def outPoint: Gen[TransactionOutPoint]

    Responsible for generating TransactionOutPoint

  38. def output: Gen[TransactionOutput]

    Generates a random TransactionOutput

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

    Generates a random TX output paying to the given SPK

  41. def outputs: Gen[List[TransactionOutput]]
  42. def randomCLTVTransaction: Gen[(BaseTxSigComponent, Seq[ECPrivateKey])]

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

  43. def realisiticWitnessTransaction: Gen[WitnessTransaction]
  44. def realisiticWitnessTransactionWitnessOut: Gen[WitnessTransaction]
  45. def realisticBaseTransaction: Gen[BaseTransaction]
  46. def realisticBaseTransactionWitnessOut: Gen[BaseTransaction]
  47. def realisticOutput: Gen[TransactionOutput]

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

  48. def realisticOutputReference: Gen[OutputReference]
  49. def realisticOutputs: Gen[Seq[TransactionOutput]]
  50. def realisticTransaction: Gen[Transaction]
  51. def realisticTransactionWitnessOut: Gen[Transaction]
  52. def realisticWitnessOutput: Gen[TransactionOutput]
  53. def realisticWitnessOutputs: Gen[Seq[TransactionOutput]]
  54. def signedMultiSigTransaction: Gen[(BaseTxSigComponent, Seq[ECPrivateKey])]

    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

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

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

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

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

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

    Creates a signed P2SH(P2WPKH) transaction

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

    Creates a signed P2SH(P2WSH) transaction

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

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

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

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

  61. def signedP2WSHMultiSigTransaction: Gen[(WitnessTxSigComponentRaw, Seq[ECPrivateKey])]
  62. def signedP2WSHP2PKHTransaction: Gen[(WitnessTxSigComponentRaw, Seq[ECPrivateKey])]

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

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

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

  64. def signedP2WSHTransaction: Gen[(WitnessTxSigComponentRaw, Seq[ECPrivateKey])]
  65. def smallInputs: Gen[Seq[TransactionInput]]

    Generates a small list of TransactionInput

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

    Generates a small non empty list of TransactionInput

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

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

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

    Generates a small list of TransactionOutput

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

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

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

    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

  71. def smallP2WSHOutputs(totalAmount: CurrencyUnit): Gen[Seq[(TransactionOutput, ScriptPubKey)]]
  72. def smallTransactions: Gen[Seq[Transaction]]

    Generates a small list of Transaction

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

    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

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

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

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

    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

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

    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)

  77. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  78. def toString(): String
    Definition Classes
    AnyRef → Any
  79. def transaction: Gen[Transaction]
  80. def transactionTo(spk: ScriptPubKey): Gen[Transaction]

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

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

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

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

    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)

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

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

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

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

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

    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).

  86. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  87. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  88. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  89. def witnessTransaction: Gen[WitnessTransaction]

    Generates a random WitnessTransaction

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

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

Inherited from AnyRef

Inherited from Any

Ungrouped