Interface BlockChainEnvironment

All Known Implementing Classes:
RegTestEnvironment

public interface BlockChainEnvironment
Abstraction(s) to help reuse tests between RegTest mode and TestNet or MainNet RegTest mode implementation will generate blocks when waitForBlocks() is called. Other implementations will actually wait for blocks to be confirmed.
  • Method Summary

    Modifier and Type
    Method
    Description
    List<org.bitcoinj.base.Sha256Hash>
    Wait for (and possible *hasten*) the creation of a single block
    List<org.bitcoinj.base.Sha256Hash>
    waitForBlocks(int numBlocks)
    Wait for (and possible *hasten*) the creation of blocks
  • Method Details

    • waitForBlock

      List<org.bitcoinj.base.Sha256Hash> waitForBlock() throws Exception
      Wait for (and possible *hasten*) the creation of a single block
      Returns:
      A list with a single block hash
      Throws:
      Exception
    • waitForBlocks

      List<org.bitcoinj.base.Sha256Hash> waitForBlocks(int numBlocks) throws Exception
      Wait for (and possible *hasten*) the creation of blocks
      Parameters:
      numBlocks - the number of blocks to wait for
      Returns:
      A list of block hashes
      Throws:
      Exception