Package org.bitcoinj.testing
Class FakeTxBuilder
java.lang.Object
org.bitcoinj.testing.FakeTxBuilder
Methods 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 Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic class - 
Constructor Summary
Constructors - 
Method Summary
Modifier and TypeMethodDescriptionstatic 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, 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, 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, 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 TransactionCreate a fake coinbase transaction.static FakeTxBuilder.DoubleSpendsCreates two transactions that spend the same (fake) output.static Transaction[]createFakeTx(Coin value, Address to, Address from) Transaction[0] is a feeder transaction, supplying BTC to Transaction[1]static TransactioncreateFakeTx(Coin value, ECKey to) Create a fake TX of sufficient realism to exercise the unit tests.static TransactioncreateFakeTx(Network network) Create a fake transaction, without change.static TransactioncreateFakeTx(Network network, Coin value, Address to) Create a fake TX of sufficient realism to exercise the unit tests.static TransactioncreateFakeTx(NetworkParameters params) Deprecated.static TransactioncreateFakeTx(NetworkParameters params, Coin value, Address to) Deprecated.static TransactioncreateFakeTxWithChangeAddress(Coin value, Address to, Address changeOutput) Create a fake TX of sufficient realism to exercise the unit tests.static TransactionCreate a fake transaction, without change.static TransactioncreateFakeTxWithoutChangeAddress(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 TransactionRoundtrip a transaction so that it appears as if it has just come from the wire 
- 
Constructor Details
- 
FakeTxBuilder
public FakeTxBuilder() 
 - 
 - 
Method Details
- 
createFakeTx
Create a fake transaction, without change. - 
createFakeTx
Deprecated.Create a fake transaction, without change. - 
createFakeTxWithoutChange
Create a fake transaction, without change. - 
createFakeCoinbaseTx
Create a fake coinbase transaction. - 
createFakeTxWithChangeAddress
public static Transaction createFakeTxWithChangeAddress(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. - 
createFakeTxWithoutChangeAddress
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. - 
createFakeTx
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. - 
createFakeTx
@Deprecated public static Transaction createFakeTx(NetworkParameters params, Coin value, Address to) Deprecated.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. - 
createFakeTx
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. - 
createFakeTx
Transaction[0] is a feeder transaction, supplying BTC to Transaction[1] - 
roundTripTransaction
Roundtrip a transaction so that it appears as if it has just come from the wire - 
createFakeDoubleSpendTxns
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. - 
createFakeBlock
public static FakeTxBuilder.BlockPair createFakeBlock(BlockStore blockStore, long version, 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. - 
createFakeBlock
public static FakeTxBuilder.BlockPair createFakeBlock(BlockStore blockStore, StoredBlock previousStoredBlock, long version, 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)  - 
createFakeBlock
public static FakeTxBuilder.BlockPair createFakeBlock(BlockStore blockStore, StoredBlock previousStoredBlock, int height, Transaction... transactions)  - 
createFakeBlock
public static FakeTxBuilder.BlockPair createFakeBlock(BlockStore blockStore, long version, 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. - 
createFakeBlock
public static FakeTxBuilder.BlockPair createFakeBlock(BlockStore blockStore, int height, Transaction... transactions) Emulates receiving a valid block that builds on top of the chain. - 
createFakeBlock
public static FakeTxBuilder.BlockPair createFakeBlock(BlockStore blockStore, Transaction... transactions) Emulates receiving a valid block that builds on top of the chain. - 
makeSolvedTestBlock
public static Block makeSolvedTestBlock(BlockStore blockStore, Address coinsTo) throws BlockStoreException - Throws:
 BlockStoreException
 - 
makeSolvedTestBlock
public static Block makeSolvedTestBlock(Block prev, Transaction... transactions) throws BlockStoreException - Throws:
 BlockStoreException
 - 
makeSolvedTestBlock
public static Block makeSolvedTestBlock(Block prev, @Nullable Address to, Transaction... transactions) throws BlockStoreException - Throws:
 BlockStoreException
 
 - 
 
createFakeBlock(BlockStore, long, Instant, int, Transaction...)