AbstractDogecoinParams extends NetworkParameters implements AuxPoWNetworkParameters { @Override public Coin getBlockSubsidy(final int height) { if (height < DIGISHIELD_BLOCK_HEIGHT) { return BASE_SUBSIDY.shiftRight(height / getSubsidyDecreaseBlockCount()).multiply(2); } else if (height < 600000) { return BASE_SUBSIDY.shiftRight(height / getSubsidyDecreaseBlockCount()); } else { return STABLE_SUBSIDY; } } AbstractDogecoinParams(final int setDiffChangeTarget); @Override Coin getBlockSubsidy(final int height); int getNewInterval(); int getNewTargetTimespan(); MonetaryFormat getMonetaryFormat(); @Override Coin getMaxMoney(); @Override Coin getMinNonDustOutput(); @Override String getUriScheme(); @Override boolean hasMaxMoney(); @Override void checkDifficultyTransitions(StoredBlock storedPrev, Block nextBlock, BlockStore blockStore); long calculateNewDifficultyTarget(StoredBlock storedPrev, Block nextBlock, BlockStore blockStore); int getDigishieldBlockHeight(); @Override int getChainID(); abstract boolean allowMinDifficultyBlocks(); @Override Sha256Hash getBlockDifficultyHash(Block block); @Override AltcoinSerializer getSerializer(boolean parseRetain); @Override int getProtocolVersionNum(final ProtocolVersion version); @Override boolean isAuxPoWBlockVersion(long version); static final MonetaryFormat DOGE; static final MonetaryFormat MDOGE; static final MonetaryFormat KOINU; static final int DIGISHIELD_BLOCK_HEIGHT; static final int AUXPOW_CHAIN_ID; static final int DOGE_TARGET_TIMESPAN; static final int DOGE_TARGET_TIMESPAN_NEW; static final int DOGE_TARGET_SPACING; static final int DOGE_INTERVAL; static final int DOGE_INTERVAL_NEW; static final String CODE_DOGE; static final String CODE_MDOGE; static final String CODE_KOINU; static final String ID_DOGE_MAINNET; static final String ID_DOGE_TESTNET; static final int DOGECOIN_PROTOCOL_VERSION_AUXPOW; static final int DOGECOIN_PROTOCOL_VERSION_CURRENT; }
@Test public void shouldCalculateSubsidy() { assertEquals(Coin.COIN.multiply(1000000), params.getBlockSubsidy(0)); assertEquals(Coin.COIN.multiply(1000000), params.getBlockSubsidy(99999)); assertEquals(Coin.COIN.multiply(500000), params.getBlockSubsidy(100000)); assertEquals(Coin.COIN.multiply(500000), params.getBlockSubsidy(144999)); assertEquals(Coin.COIN.multiply(250000), params.getBlockSubsidy(145000)); assertEquals(Coin.COIN.multiply(250000), params.getBlockSubsidy(199999)); assertEquals(Coin.COIN.multiply(125000), params.getBlockSubsidy(200000)); assertEquals(Coin.COIN.multiply(125000), params.getBlockSubsidy(299999)); assertEquals(Coin.COIN.multiply(62500), params.getBlockSubsidy(300000)); assertEquals(Coin.COIN.multiply(62500), params.getBlockSubsidy(399999)); assertEquals(Coin.COIN.multiply(31250), params.getBlockSubsidy(400000)); assertEquals(Coin.COIN.multiply(31250), params.getBlockSubsidy(499999)); assertEquals(Coin.COIN.multiply(15625), params.getBlockSubsidy(500000)); assertEquals(Coin.COIN.multiply(15625), params.getBlockSubsidy(599999)); assertEquals(Coin.COIN.multiply(10000), params.getBlockSubsidy(600000)); assertEquals(Coin.COIN.multiply(10000), params.getBlockSubsidy(699999)); }