Class RegTestEnvironment
java.lang.Object
org.consensusj.bitcoin.jsonrpc.test.RegTestEnvironment
- All Implemented Interfaces:
BlockChainEnvironment
Single-threaded RegTest testing environment.
(It is conceivable someone could write tests that run in parallel in RegTest mode
just as they would on MainNet or Testnet. There would be a timer that creates blocks
every 'n' seconds, so tests could run in parallel, but would complete much quicker.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionList
<org.bitcoinj.base.Sha256Hash> Wait for (and possible *hasten*) the creation of a single blockList
<org.bitcoinj.base.Sha256Hash> waitForBlocks
(int numBlocks) Wait for (and possible *hasten*) the creation of blocks
-
Constructor Details
-
RegTestEnvironment
-
-
Method Details
-
waitForBlock
Description copied from interface:BlockChainEnvironment
Wait for (and possible *hasten*) the creation of a single block- Specified by:
waitForBlock
in interfaceBlockChainEnvironment
- Returns:
- A list with a single block hash
- Throws:
Exception
-
waitForBlocks
public List<org.bitcoinj.base.Sha256Hash> waitForBlocks(int numBlocks) throws JsonRpcException, IOException Description copied from interface:BlockChainEnvironment
Wait for (and possible *hasten*) the creation of blocks- Specified by:
waitForBlocks
in interfaceBlockChainEnvironment
- Parameters:
numBlocks
- the number of blocks to wait for- Returns:
- A list of block hashes
- Throws:
JsonRpcException
IOException
-