Package org.bitcoinj.testing
Class MockAltNetwork
java.lang.Object
org.bitcoinj.testing.MockAltNetwork
- All Implemented Interfaces:
Network
Mock Alt-net implementation of
Network
for unit tests.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
exceedsMaxMoney
(Monetary monetary) Check if an amount exceeds the maximum allowed for a network (if the network has one)boolean
Does this network have a fixed maximum number of coinsid()
The dot-seperated string id for this network.int
Header byte of base58 encoded legacy P2PKH addresses for this network.int
Header byte of base58 encoded legacy P2SH addresses for this network.maxMoney()
Maximum number of coins for this network as aMonetary
value.Human-readable part (HRP) of bech32 encoded segwit addresses for this network.The URI scheme for this network.
-
Constructor Details
-
MockAltNetwork
public MockAltNetwork()
-
-
Method Details
-
id
Description copied from interface:Network
The dot-seperated string id for this network. For example"org.bitcoin.production"
-
legacyAddressHeader
public int legacyAddressHeader()Description copied from interface:Network
Header byte of base58 encoded legacy P2PKH addresses for this network.- Specified by:
legacyAddressHeader
in interfaceNetwork
- Returns:
- header byte as an
int
. - See Also:
-
legacyP2SHHeader
public int legacyP2SHHeader()Description copied from interface:Network
Header byte of base58 encoded legacy P2SH addresses for this network.- Specified by:
legacyP2SHHeader
in interfaceNetwork
- Returns:
- header byte as an
int
. - See Also:
-
segwitAddressHrp
Description copied from interface:Network
Human-readable part (HRP) of bech32 encoded segwit addresses for this network.- Specified by:
segwitAddressHrp
in interfaceNetwork
- Returns:
- HRP (lowercase)
-
uriScheme
Description copied from interface:Network
The URI scheme for this network. SeeBitcoinNetwork.uriScheme()
. -
hasMaxMoney
public boolean hasMaxMoney()Description copied from interface:Network
Does this network have a fixed maximum number of coins- Specified by:
hasMaxMoney
in interfaceNetwork
- Returns:
true
if this network has a fixed maximum number of coins
-
maxMoney
Description copied from interface:Network
Maximum number of coins for this network as aMonetary
value. Where not applicable, a very large number of coins is returned instead (e.g. the main coin issue for Dogecoin). -
exceedsMaxMoney
Description copied from interface:Network
Check if an amount exceeds the maximum allowed for a network (if the network has one)- Specified by:
exceedsMaxMoney
in interfaceNetwork
- Parameters:
monetary
- A monetary amount- Returns:
- true if too big, false if an allowed amount
-