o

org.bitcoins.testkit.core.gen

TransactionGenerators

object TransactionGenerators extends BitcoinSLogger

Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. TransactionGenerators
  2. BitcoinSLogger
  3. Logging
  4. AnyRef
  5. 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, scriptPubKey: ScriptPubKey, amount: CurrencyUnit): (Transaction, UInt32)
  8. def buildCreditingTransaction(version: Int32, output: TransactionOutput): (Transaction, UInt32)
  9. 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.

  10. def buildCreditingTransaction(scriptPubKey: ScriptPubKey, amount: CurrencyUnit): (Transaction, UInt32)
  11. 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

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

    Builds a spending WitnessTransaction with the given parameters

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

  18. def buildSpendingTransaction(version: Int32, creditingTx: Transaction, scriptSignature: ScriptSignature, outputIndex: UInt32, locktime: UInt32, sequence: UInt32, outputs: Seq[TransactionOutput]): (Transaction, UInt32)
  19. 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

  20. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native()
  21. def csvTransaction(csvScriptNum: ScriptNumber, sequence: UInt32): Gen[(BaseTxSigComponent, Seq[ECPrivateKey])]
  22. def debug(mkr: Marker, msg: => Any, t: => Throwable): Unit
    Attributes
    protected
    Definition Classes
    Logging
  23. def debug(msg: => Any, t: => Throwable): Unit
    Attributes
    protected
    Definition Classes
    Logging
  24. def debug(msg: => Any): Unit
    Attributes
    protected
    Definition Classes
    Logging
  25. def dummyOutputs: Seq[TransactionOutput]
  26. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  27. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  28. def error(mkr: Marker, msg: => Any, t: => Throwable): Unit
    Attributes
    protected
    Definition Classes
    Logging
  29. def error(msg: => Any, t: => Throwable): Unit
    Attributes
    protected
    Definition Classes
    Logging
  30. def error(msg: => Any): Unit
    Attributes
    protected
    Definition Classes
    Logging
  31. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable])
  32. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  33. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  34. def info(mkr: Marker, msg: => Any, t: => Throwable): Unit
    Attributes
    protected
    Definition Classes
    Logging
  35. def info(msg: => Any, t: => Throwable): Unit
    Attributes
    protected
    Definition Classes
    Logging
  36. def info(msg: => Any): Unit
    Attributes
    protected
    Definition Classes
    Logging
  37. def input: Gen[TransactionInput]

    Generates a random TransactionInput

  38. def inputs: Gen[List[TransactionInput]]
  39. def isDebugEnabled: Boolean
    Attributes
    protected
    Definition Classes
    Logging
  40. def isErrorEnabled: Boolean
    Attributes
    protected
    Definition Classes
    Logging
  41. def isInfoEnabled: Boolean
    Attributes
    protected
    Definition Classes
    Logging
  42. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  43. def isTraceEnabled: Boolean
    Attributes
    protected
    Definition Classes
    Logging
  44. def isWarnEnabled: Boolean
    Attributes
    protected
    Definition Classes
    Logging
  45. def logger: Logger
    Attributes
    protected
    Definition Classes
    Logging
  46. def loggerName: String
    Attributes
    protected
    Definition Classes
    Logging
  47. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  48. def nonEmptyOutputTransaction: Gen[Transaction]

    Generates a transaction with at least one output

  49. def nonEmptySmallTransactions: Gen[Seq[Transaction]]
  50. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  51. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  52. def outPoint: Gen[TransactionOutPoint]

    Responsible for generating TransactionOutPoint

  53. def output: Gen[TransactionOutput]

    Generates a random TransactionOutput

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

    Generates a random TX output paying to the given SPK

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

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

  57. def realisticOutput: Gen[TransactionOutput]

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

  58. def realisticOutputs: Gen[Seq[TransactionOutput]]
  59. 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

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

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

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

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

    Creates a signed P2SH(P2WPKH) transaction

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

    Creates a signed P2SH(P2WSH) transaction

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

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

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

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

  66. def signedP2WSHMultiSigTransaction: Gen[(WitnessTxSigComponentRaw, Seq[ECPrivateKey])]
  67. def signedP2WSHP2PKHTransaction: Gen[(WitnessTxSigComponentRaw, Seq[ECPrivateKey])]

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

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

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

  69. def signedP2WSHTransaction: Gen[(WitnessTxSigComponentRaw, Seq[ECPrivateKey])]
  70. def smallInputs: Gen[Seq[TransactionInput]]

    Generates a small list of TransactionInput

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

    Generates a small non empty list of TransactionInput

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

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

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

    Generates a small list of TransactionOutput

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

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

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

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

    Generates a small list of Transaction

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

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

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

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

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

  82. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  83. def toString(): String
    Definition Classes
    AnyRef → Any
  84. def trace(mkr: Marker, msg: => Any, t: => Throwable): Unit
    Attributes
    protected
    Definition Classes
    Logging
  85. def trace(msg: => Any, t: => Throwable): Unit
    Attributes
    protected
    Definition Classes
    Logging
  86. def trace(msg: => Any): Unit
    Attributes
    protected
    Definition Classes
    Logging
  87. def transaction: Gen[Transaction]
  88. def transactionTo(spk: ScriptPubKey): Gen[Transaction with Product with Serializable]

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

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

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

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

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

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

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

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

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

  94. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  95. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  96. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  97. def warn(mkr: Marker, msg: => Any, t: => Throwable): Unit
    Attributes
    protected
    Definition Classes
    Logging
  98. def warn(msg: => Any, t: => Throwable): Unit
    Attributes
    protected
    Definition Classes
    Logging
  99. def warn(msg: => Any): Unit
    Attributes
    protected
    Definition Classes
    Logging
  100. def witnessTransaction: Gen[WitnessTransaction]

    Generates a random WitnessTransaction

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

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

Inherited from BitcoinSLogger

Inherited from Logging

Inherited from AnyRef

Inherited from Any

Ungrouped