Class MockAltNetwork

  • All Implemented Interfaces:
    Network

    public class MockAltNetwork
    extends java.lang.Object
    implements Network
    Mock Alt-net implementation of Network for unit tests.
    • Constructor Summary

      Constructors 
      Constructor Description
      MockAltNetwork()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean exceedsMaxMoney​(Monetary monetary)
      Check if an amount exceeds the maximum allowed for a network (if the network has one)
      boolean hasMaxMoney()
      Does this network have a fixed maximum number of coins
      java.lang.String id()
      The dot-seperated string id for this network.
      int legacyAddressHeader()
      Header byte of base58 encoded legacy P2PKH addresses for this network.
      int legacyP2SHHeader()
      Header byte of base58 encoded legacy P2SH addresses for this network.
      Monetary maxMoney()
      Maximum number of coins for this network as a Monetary value.
      java.lang.String segwitAddressHrp()
      Human-readable part (HRP) of bech32 encoded segwit addresses for this network.
      java.lang.String uriScheme()
      The URI scheme for this network.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • MockAltNetwork

        public MockAltNetwork()
    • Method Detail

      • id

        public java.lang.String id()
        Description copied from interface: Network
        The dot-seperated string id for this network. For example "org.bitcoin.production"
        Specified by:
        id in interface Network
        Returns:
        String ID for network
      • legacyP2SHHeader

        public int legacyP2SHHeader()
        Description copied from interface: Network
        Header byte of base58 encoded legacy P2SH addresses for this network.
        Specified by:
        legacyP2SHHeader in interface Network
        Returns:
        header byte as an int.
        See Also:
        LegacyAddress.P2SHHeader
      • segwitAddressHrp

        public java.lang.String segwitAddressHrp()
        Description copied from interface: Network
        Human-readable part (HRP) of bech32 encoded segwit addresses for this network.
        Specified by:
        segwitAddressHrp in interface Network
        Returns:
        HRP (lowercase)
      • uriScheme

        public java.lang.String uriScheme()
        Description copied from interface: Network
        The URI scheme for this network. See BitcoinNetwork.uriScheme().
        Specified by:
        uriScheme in interface Network
        Returns:
        The URI scheme for this network
      • hasMaxMoney

        public boolean hasMaxMoney()
        Description copied from interface: Network
        Does this network have a fixed maximum number of coins
        Specified by:
        hasMaxMoney in interface Network
        Returns:
        true if this network has a fixed maximum number of coins
      • maxMoney

        public Monetary maxMoney()
        Description copied from interface: Network
        Maximum number of coins for this network as a Monetary value. Where not applicable, a very large number of coins is returned instead (e.g. the main coin issue for Dogecoin).
        Specified by:
        maxMoney in interface Network
        Returns:
        Maximum number of coins for this network
      • exceedsMaxMoney

        public boolean exceedsMaxMoney​(Monetary monetary)
        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 interface Network
        Parameters:
        monetary - A monetary amount
        Returns:
        true if too big, false if an allowed amount