Package org.bitcoinj.testing
Class MockAltNetworkParams
- java.lang.Object
 - 
- org.bitcoinj.core.NetworkParameters
 - 
- org.bitcoinj.testing.MockAltNetworkParams
 
 
 
- 
public class MockAltNetworkParams extends NetworkParameters
Mock Alt-net subclass ofNetworkParametersfor unit tests. 
- 
- 
Field Summary
Fields Modifier and Type Field Description static java.lang.StringMOCKNET_GOOD_ADDRESS- 
Fields inherited from class org.bitcoinj.core.NetworkParameters
addressHeader, addrSeeds, BIP16_ENFORCE_TIME, bip32HeaderP2PKHpriv, bip32HeaderP2PKHpub, bip32HeaderP2WPKHpriv, bip32HeaderP2WPKHpub, checkpoints, defaultSerializer, dnsSeeds, dumpedPrivateKeyHeader, id, interval, INTERVAL, majorityEnforceBlockUpgrade, majorityRejectBlockOutdated, majorityWindow, MAX_COINS, MAX_MONEY, maxTarget, network, p2shHeader, packetMagic, PAYMENT_PROTOCOL_ID_MAINNET, PAYMENT_PROTOCOL_ID_REGTEST, PAYMENT_PROTOCOL_ID_SIGNET, PAYMENT_PROTOCOL_ID_TESTNET, PAYMENT_PROTOCOL_ID_UNIT_TESTS, port, segwitAddressHrp, spendableCoinbaseDepth, subsidyDecreaseBlockCount, TARGET_SPACING, TARGET_TIMESPAN, targetTimespan 
 - 
 
- 
Constructor Summary
Constructors Constructor Description MockAltNetworkParams() 
- 
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcheckDifficultyTransitions(StoredBlock storedPrev, Block next, BlockStore blockStore)Throws an exception if the block's difficulty is not correct.BlockgetGenesisBlock()Genesis block for this chain.CoingetMaxMoney()Returns the number of coins that will be produced in total, on this network.MonetaryFormatgetMonetaryFormat()The monetary object for this currency.java.lang.StringgetPaymentProtocolId()BitcoinSerializergetSerializer()Construct and return a custom serializer.java.lang.StringgetUriScheme()Scheme part for URIs, for example "bitcoin".booleanhasMaxMoney()Returns whether this network has a maximum number of coins (finite supply) or not.- 
Methods inherited from class org.bitcoinj.core.NetworkParameters
allowEmptyPeerChain, equals, fromAddress, fromID, fromPmtProtocolID, getAddressHeader, getAddrSeeds, getBip32HeaderP2PKHpriv, getBip32HeaderP2PKHpub, getBip32HeaderP2WPKHpriv, getBip32HeaderP2WPKHpub, getBlockVerificationFlags, getDefaultSerializer, getDnsSeeds, getDumpedPrivateKeyHeader, getId, getInterval, getMajorityEnforceBlockUpgrade, getMajorityRejectBlockOutdated, getMajorityWindow, getMaxTarget, getP2SHHeader, getPacketMagic, getPort, getProtocolVersionNum, getSegwitAddressHrp, getSpendableCoinbaseDepth, getSubsidyDecreaseBlockCount, getTargetTimespan, getTransactionVerificationFlags, hashCode, isCheckpoint, network, of, passesCheckpoint 
 - 
 
 - 
 
- 
- 
Field Detail
- 
MOCKNET_GOOD_ADDRESS
public static final java.lang.String MOCKNET_GOOD_ADDRESS
- See Also:
 - Constant Field Values
 
 
 - 
 
- 
Method Detail
- 
getPaymentProtocolId
public java.lang.String getPaymentProtocolId()
- Specified by:
 getPaymentProtocolIdin classNetworkParameters- Returns:
 - the payment protocol network id string
 
 
- 
checkDifficultyTransitions
public void checkDifficultyTransitions(StoredBlock storedPrev, Block next, BlockStore blockStore) throws VerificationException, BlockStoreException
Description copied from class:NetworkParametersThrows an exception if the block's difficulty is not correct.- Specified by:
 checkDifficultyTransitionsin classNetworkParameters- Parameters:
 storedPrev- previous stored blocknext- proposed blockblockStore- 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:NetworkParametersGenesis 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:
 getGenesisBlockin classNetworkParameters- Returns:
 - genesis block
 
 
- 
getMaxMoney
public Coin getMaxMoney()
Description copied from class:NetworkParametersReturns 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:
 getMaxMoneyin classNetworkParameters- Returns:
 - maximum number of coins for this network
 
 
- 
getMonetaryFormat
public MonetaryFormat getMonetaryFormat()
Description copied from class:NetworkParametersThe monetary object for this currency.- Specified by:
 getMonetaryFormatin classNetworkParameters- Returns:
 - formatting utility object
 
 
- 
getUriScheme
public java.lang.String getUriScheme()
Description copied from class:NetworkParametersScheme part for URIs, for example "bitcoin".- Specified by:
 getUriSchemein classNetworkParameters- Returns:
 - a string with the "scheme" part
 
 
- 
hasMaxMoney
public boolean hasMaxMoney()
Description copied from class:NetworkParametersReturns 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:
 hasMaxMoneyin classNetworkParameters- Returns:
 - true if network has a fixed maximum number of coins
 
 
- 
getSerializer
public BitcoinSerializer getSerializer()
Description copied from class:NetworkParametersConstruct and return a custom serializer.- Specified by:
 getSerializerin classNetworkParameters- Returns:
 - the serializer
 
 
 - 
 
 -