@Test(expected = IllegalArgumentException.class) public void testSetCurrentBlockIndexWithNegativeShouldThrowException() throws IOException { blockchain.setCurrentBlockIndex(BigInteger.valueOf(-2)); }
public void setCurrentBlockIndex(BigInteger currentBlockIndex) { Util.check(currentBlockIndex!=null, "currentBlockIndex!=null"); Util.check(currentBlockIndex.compareTo(BigInteger.ZERO) >= 0, "currentBlockIndex!=null"); this.currentBlockIndex = currentBlockIndex; }
Blockchain implements Serializable, PersistenceUnitContainer { public void setCurrentBlockIndex(BigInteger currentBlockIndex) { Util.check(currentBlockIndex!=null, "currentBlockIndex!=null"); Util.check(currentBlockIndex.compareTo(BigInteger.ZERO) >= 0, "currentBlockIndex!=null"); this.currentBlockIndex = currentBlockIndex; } }
Blockchain implements Serializable, PersistenceUnitContainer { public void setCurrentBlockIndex(BigInteger currentBlockIndex) { Util.check(currentBlockIndex!=null, "currentBlockIndex!=null"); Util.check(currentBlockIndex.compareTo(BigInteger.ZERO) >= 0, "currentBlockIndex!=null"); this.currentBlockIndex = currentBlockIndex; } Blockchain(BlockchainContext context); }
Blockchain implements Serializable, PersistenceUnitContainer { public void setCurrentBlockIndex(BigInteger currentBlockIndex) { Util.check(currentBlockIndex!=null, "currentBlockIndex!=null"); Util.check(currentBlockIndex.compareTo(BigInteger.ZERO) >= 0, "currentBlockIndex!=null"); this.currentBlockIndex = currentBlockIndex; } Blockchain(BlockchainContext context); void generatePersistenceUnitMap(BlockchainContext context); @SuppressWarnings("unchecked") BlockchainPersistenceUnit<H, B> getUnit(BlockchainUnitType type); Class<B> getClazz(BlockchainUnitType type); BlockchainContext getContext(); P2PConnection getConnection(); Block getCurrentBlock(); void setCurrentBlock(Block currentBlock); Block getGenesisBlock(); void setGenesisBlock(Block genesisBlock); BigInteger getCurrentBlockIndex(); void setCurrentBlockIndex(BigInteger currentBlockIndex); Shard getShard(); void flush(); @Override void stopPersistenceUnit(); TransactionsPool getPool(); BigInteger getNetworkHeight(); synchronized void setNetworkHeight(BigInteger networkBlockHeight); @Override String toString(); }
Blockchain implements Serializable, PersistenceUnitContainer { public void setCurrentBlockIndex(BigInteger currentBlockIndex) { Util.check(currentBlockIndex!=null, "currentBlockIndex!=null"); Util.check(currentBlockIndex.compareTo(BigInteger.ZERO) >= 0, "currentBlockIndex!=null"); this.currentBlockIndex = currentBlockIndex; } Blockchain(BlockchainContext context); void generatePersistenceUnitMap(BlockchainContext context); @SuppressWarnings("unchecked") BlockchainPersistenceUnit<H, B> getUnit(BlockchainUnitType type); Class<B> getClazz(BlockchainUnitType type); BlockchainContext getContext(); P2PConnection getConnection(); Block getCurrentBlock(); void setCurrentBlock(Block currentBlock); Block getGenesisBlock(); void setGenesisBlock(Block genesisBlock); BigInteger getCurrentBlockIndex(); void setCurrentBlockIndex(BigInteger currentBlockIndex); Shard getShard(); void flush(); @Override void stopPersistenceUnit(); TransactionsPool getPool(); BigInteger getNetworkHeight(); synchronized void setNetworkHeight(BigInteger networkBlockHeight); @Override String toString();  }