Package org.bitcoinj.testing
Class FakeTxBuilder
- java.lang.Object
- 
- org.bitcoinj.testing.FakeTxBuilder
 
- 
 public class FakeTxBuilder extends java.lang.ObjectMethods for building fake transactions for unit tests. Since these methods are currently used both in the `bitcoinj-core` unit tests and in the `integration-test` subproject, they are (for now) included in the `bitcoinj-core` JAR. They should not be considered part of the API.
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description static classFakeTxBuilder.BlockPairstatic classFakeTxBuilder.DoubleSpends
 - 
Constructor SummaryConstructors Constructor Description FakeTxBuilder()
 - 
Method SummaryAll Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static FakeTxBuilder.BlockPaircreateFakeBlock(BlockStore blockStore, int height, Transaction... transactions)Emulates receiving a valid block that builds on top of the chain.static FakeTxBuilder.BlockPaircreateFakeBlock(BlockStore blockStore, long version, long timeSecs, int height, Transaction... transactions)Deprecated.static FakeTxBuilder.BlockPaircreateFakeBlock(BlockStore blockStore, long version, long timeSecs, Transaction... transactions)Deprecated.static FakeTxBuilder.BlockPaircreateFakeBlock(BlockStore blockStore, long version, java.time.Instant time, int height, Transaction... transactions)Emulates receiving a valid block that builds on top of the chain.static FakeTxBuilder.BlockPaircreateFakeBlock(BlockStore blockStore, long version, java.time.Instant time, Transaction... transactions)Emulates receiving a valid block that builds on top of the chain.static FakeTxBuilder.BlockPaircreateFakeBlock(BlockStore blockStore, StoredBlock previousStoredBlock, int height, Transaction... transactions)static FakeTxBuilder.BlockPaircreateFakeBlock(BlockStore blockStore, StoredBlock previousStoredBlock, long version, long timeSecs, int height, Transaction... transactions)static FakeTxBuilder.BlockPaircreateFakeBlock(BlockStore blockStore, StoredBlock previousStoredBlock, long version, java.time.Instant time, int height, Transaction... transactions)Emulates receiving a valid blockstatic FakeTxBuilder.BlockPaircreateFakeBlock(BlockStore blockStore, Transaction... transactions)Emulates receiving a valid block that builds on top of the chain.static TransactioncreateFakeCoinbaseTx(NetworkParameters params)Create a fake coinbase transaction.static FakeTxBuilder.DoubleSpendscreateFakeDoubleSpendTxns(NetworkParameters params, Address to)Creates two transactions that spend the same (fake) output.static TransactioncreateFakeTx(NetworkParameters params)Create a fake transaction, without change.static TransactioncreateFakeTx(NetworkParameters params, Coin value, Address to)Create a fake TX of sufficient realism to exercise the unit tests.static Transaction[]createFakeTx(NetworkParameters params, Coin value, Address to, Address from)Transaction[0] is a feeder transaction, supplying BTC to Transaction[1]static TransactioncreateFakeTx(NetworkParameters params, Coin value, ECKey to)Create a fake TX of sufficient realism to exercise the unit tests.static TransactioncreateFakeTxWithChangeAddress(NetworkParameters params, Coin value, Address to, Address changeOutput)Create a fake TX of sufficient realism to exercise the unit tests.static TransactioncreateFakeTxWithoutChange(NetworkParameters params, TransactionOutput output)Create a fake transaction, without change.static TransactioncreateFakeTxWithoutChangeAddress(NetworkParameters params, Coin value, Address to)Create a fake TX for unit tests, for use with unit tests that need greater control.static BlockmakeSolvedTestBlock(Block prev, Address to, Transaction... transactions)static BlockmakeSolvedTestBlock(Block prev, Transaction... transactions)static BlockmakeSolvedTestBlock(BlockStore blockStore, Address coinsTo)static TransactionroundTripTransaction(NetworkParameters params, Transaction tx)Roundtrip a transaction so that it appears as if it has just come from the wire
 
- 
- 
- 
Method Detail- 
createFakeTxpublic static Transaction createFakeTx(NetworkParameters params) Create a fake transaction, without change.
 - 
createFakeTxWithoutChangepublic static Transaction createFakeTxWithoutChange(NetworkParameters params, TransactionOutput output) Create a fake transaction, without change.
 - 
createFakeCoinbaseTxpublic static Transaction createFakeCoinbaseTx(NetworkParameters params) Create a fake coinbase transaction.
 - 
createFakeTxWithChangeAddresspublic static Transaction createFakeTxWithChangeAddress(NetworkParameters params, Coin value, Address to, Address changeOutput) Create a fake TX of sufficient realism to exercise the unit tests. Two outputs, one to us, one to somewhere else to simulate change. There is one random input.
 - 
createFakeTxWithoutChangeAddresspublic static Transaction createFakeTxWithoutChangeAddress(NetworkParameters params, Coin value, Address to) Create a fake TX for unit tests, for use with unit tests that need greater control. One outputs, 2 random inputs, split randomly to create randomness.
 - 
createFakeTxpublic static Transaction createFakeTx(NetworkParameters params, Coin value, Address to) Create a fake TX of sufficient realism to exercise the unit tests. Two outputs, one to us, one to somewhere else to simulate change. There is one random input.
 - 
createFakeTxpublic static Transaction createFakeTx(NetworkParameters params, Coin value, ECKey to) Create a fake TX of sufficient realism to exercise the unit tests. Two outputs, one to us, one to somewhere else to simulate change. There is one random input.
 - 
createFakeTxpublic static Transaction[] createFakeTx(NetworkParameters params, Coin value, Address to, Address from) Transaction[0] is a feeder transaction, supplying BTC to Transaction[1]
 - 
roundTripTransactionpublic static Transaction roundTripTransaction(NetworkParameters params, Transaction tx) Roundtrip a transaction so that it appears as if it has just come from the wire
 - 
createFakeDoubleSpendTxnspublic static FakeTxBuilder.DoubleSpends createFakeDoubleSpendTxns(NetworkParameters params, Address to) Creates two transactions that spend the same (fake) output. t1 spends to "to". t2 spends somewhere else. The fake output goes to the same address as t2.
 - 
createFakeBlockpublic static FakeTxBuilder.BlockPair createFakeBlock(BlockStore blockStore, long version, java.time.Instant time, Transaction... transactions) Emulates receiving a valid block that builds on top of the chain.
 - 
createFakeBlock@Deprecated public static FakeTxBuilder.BlockPair createFakeBlock(BlockStore blockStore, long version, long timeSecs, Transaction... transactions) Deprecated.
 - 
createFakeBlockpublic static FakeTxBuilder.BlockPair createFakeBlock(BlockStore blockStore, StoredBlock previousStoredBlock, long version, java.time.Instant time, int height, Transaction... transactions) Emulates receiving a valid block
 - 
createFakeBlock@Deprecated public static FakeTxBuilder.BlockPair createFakeBlock(BlockStore blockStore, StoredBlock previousStoredBlock, long version, long timeSecs, int height, Transaction... transactions) 
 - 
createFakeBlockpublic static FakeTxBuilder.BlockPair createFakeBlock(BlockStore blockStore, StoredBlock previousStoredBlock, int height, Transaction... transactions) 
 - 
createFakeBlockpublic static FakeTxBuilder.BlockPair createFakeBlock(BlockStore blockStore, long version, java.time.Instant time, int height, Transaction... transactions) Emulates receiving a valid block that builds on top of the chain.
 - 
createFakeBlock@Deprecated public static FakeTxBuilder.BlockPair createFakeBlock(BlockStore blockStore, long version, long timeSecs, int height, Transaction... transactions) Deprecated.
 - 
createFakeBlockpublic static FakeTxBuilder.BlockPair createFakeBlock(BlockStore blockStore, int height, Transaction... transactions) Emulates receiving a valid block that builds on top of the chain.
 - 
createFakeBlockpublic static FakeTxBuilder.BlockPair createFakeBlock(BlockStore blockStore, Transaction... transactions) Emulates receiving a valid block that builds on top of the chain.
 - 
makeSolvedTestBlockpublic static Block makeSolvedTestBlock(BlockStore blockStore, Address coinsTo) throws BlockStoreException - Throws:
- BlockStoreException
 
 - 
makeSolvedTestBlockpublic static Block makeSolvedTestBlock(Block prev, Transaction... transactions) throws BlockStoreException - Throws:
- BlockStoreException
 
 - 
makeSolvedTestBlockpublic static Block makeSolvedTestBlock(Block prev, Address to, Transaction... transactions) throws BlockStoreException - Throws:
- BlockStoreException
 
 
- 
 
-