- Add the Codota plugin to your IDE and get smart completions
private void myMethod () {OutputStreamWriter o =
OutputStream out;new OutputStreamWriter(out)
OutputStream out;String charsetName;new OutputStreamWriter(out, charsetName)
HttpURLConnection connection;new OutputStreamWriter(connection.getOutputStream())
- Smart code suggestions by Codota
}
@Test public void shouldBeBuiltMetaStore() { BlockHusk block = BlockChainTestUtils.genesisBlock(); StoreBuilder builder = new StoreBuilder(new DefaultConfig()); MetaStore store = builder.buildMetaStore(BRANCH_ID); store.setBestBlock(block); assertThat(store.contains(BlockchainMetaInfo.BRANCH.toString())).isTrue(); assertThat(store.getBestBlockHash()).isEqualTo(block.getHash()); }
metaStore = storeBuilder.buildMetaStore(genesisBlock.getBranchId());
@Test public void executorTest() { CoinContract contract = new CoinContract(); Runtime runtime = new Runtime<>( new StateStore<>(new HashMapDbSource()), new TransactionReceiptStore(new HashMapDbSource()) ); runtime.addContract(ContractId.of("c10e873655becf550c4aece75a091f4553d6202d"), contract); // Block Store // Blockchain Runtime StoreBuilder builder = new StoreBuilder(new DefaultConfig(false)); BlockStore store = builder.buildBlockStore(BRANCH_ID); MetaStore meta = builder.buildMetaStore(BRANCH_ID); BlockExecutor ex = new BlockExecutor(store, meta, runtime); // BlockStore add genesis block and other ex.runExecuteBlocks(); } }