Class MockAltNetworkParams

java.lang.Object
org.bitcoinj.core.NetworkParameters
org.bitcoinj.testing.MockAltNetworkParams

public class MockAltNetworkParams extends NetworkParameters
Mock Alt-net subclass of NetworkParameters for unit tests.
  • Field Details

  • Constructor Details

    • MockAltNetworkParams

      public MockAltNetworkParams()
  • Method Details

    • getPaymentProtocolId

      public String getPaymentProtocolId()
      Specified by:
      getPaymentProtocolId in class NetworkParameters
      Returns:
      the payment protocol network id string
    • checkDifficultyTransitions

      public void checkDifficultyTransitions(StoredBlock storedPrev, Block next, BlockStore blockStore) throws VerificationException, BlockStoreException
      Description copied from class: NetworkParameters
      Throws an exception if the block's difficulty is not correct.
      Specified by:
      checkDifficultyTransitions in class NetworkParameters
      Parameters:
      storedPrev - previous stored block
      next - proposed block
      blockStore - active BlockStore
      Throws:
      VerificationException - if the block's difficulty is not correct.
      BlockStoreException - if an error occurred accessing the BlockStore
    • getGenesisBlock

      public Block getGenesisBlock()
      Description copied from class: NetworkParameters

      Genesis block for this chain.

      The first block in every chain is a well known constant shared between all Bitcoin implementations. For a block to be valid, it must be eventually possible to work backwards to the genesis block by following the prevBlockHash pointers in the block headers.

      The genesis blocks for both test and main networks contain the timestamp of when they were created, and a message in the coinbase transaction. It says, "The Times 03/Jan/2009 Chancellor on brink of second bailout for banks".

      Specified by:
      getGenesisBlock in class NetworkParameters
      Returns:
      genesis block
    • getMaxMoney

      public Coin getMaxMoney()
      Description copied from class: NetworkParameters
      Returns the number of coins that will be produced in total, on this network. Where not applicable, a very large number of coins is returned instead (e.g. the main coin issue for Dogecoin).
      Specified by:
      getMaxMoney in class NetworkParameters
      Returns:
      maximum number of coins for this network
    • getMonetaryFormat

      public MonetaryFormat getMonetaryFormat()
      Description copied from class: NetworkParameters
      The monetary object for this currency.
      Specified by:
      getMonetaryFormat in class NetworkParameters
      Returns:
      formatting utility object
    • getUriScheme

      public String getUriScheme()
      Description copied from class: NetworkParameters
      Scheme part for URIs, for example "bitcoin".
      Specified by:
      getUriScheme in class NetworkParameters
      Returns:
      a string with the "scheme" part
    • hasMaxMoney

      public boolean hasMaxMoney()
      Description copied from class: NetworkParameters
      Returns whether this network has a maximum number of coins (finite supply) or not. Always returns true for Bitcoin, but exists to be overridden for other networks.
      Specified by:
      hasMaxMoney in class NetworkParameters
      Returns:
      true if network has a fixed maximum number of coins
    • getSerializer

      public BitcoinSerializer getSerializer()
      Description copied from class: NetworkParameters
      Construct and return a custom serializer.
      Specified by:
      getSerializer in class NetworkParameters
      Returns:
      the serializer