Blockchain implements Serializable, PersistenceUnitContainer { @SuppressWarnings("unchecked") public <H extends Object, B> BlockchainPersistenceUnit<H, B> getUnit(BlockchainUnitType type) { return (BlockchainPersistenceUnit<H, B>) blockchain.get(type); } 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();  }
@Test public void testGetUnitForBLOCK() throws IOException { BlockchainPersistenceUnit<?, ?> unit = blockchain.getUnit(BlockchainUnitType.BLOCK); Assert.assertNotNull(unit); }
@Test public void testGetUnitForBLOCK_INDEX() throws IOException { BlockchainPersistenceUnit<?, ?> unit = blockchain.getUnit(BlockchainUnitType.BLOCK_INDEX); Assert.assertNotNull(unit); }
@Test public void testGetUnitForTRANSACTION() throws IOException { BlockchainPersistenceUnit<?, ?> unit = blockchain.getUnit(BlockchainUnitType.TRANSACTION); Assert.assertNotNull(unit); }
@Test public void testGetUnitForSETTINGS() throws IOException { BlockchainPersistenceUnit<?, ?> unit = blockchain.getUnit(BlockchainUnitType.SETTINGS); Assert.assertNotNull(unit); }