use of io.nuls.ledger.module.impl.UtxoLedgerModuleBootstrap in project nuls by nuls-io.
the class BlockServiceImplTest method init.
@Before
public void init() {
MicroKernelBootstrap mk = MicroKernelBootstrap.getInstance();
mk.init();
mk.start();
LevelDbModuleBootstrap bootstrap = new LevelDbModuleBootstrap();
bootstrap.init();
bootstrap.start();
UtxoLedgerModuleBootstrap ledgerModuleBootstrap = new UtxoLedgerModuleBootstrap();
ledgerModuleBootstrap.init();
ledgerModuleBootstrap.start();
service = NulsContext.getServiceBean(BlockService.class);
Block block = new Block();
BlockHeader blockHeader = new BlockHeader();
blockHeader.setHash(NulsDigestData.calcDigestData("hashhash".getBytes()));
blockHeader.setHeight(1286L);
blockHeader.setExtend("extends".getBytes());
blockHeader.setMerkleHash(NulsDigestData.calcDigestData("merkleHash".getBytes()));
blockHeader.setPreHash(NulsDigestData.calcDigestData("prehash".getBytes()));
try {
blockHeader.setPackingAddress("address".getBytes());
} catch (Exception e) {
e.printStackTrace();
assertTrue(false);
}
blockHeader.setBlockSignature(new BlockSignature());
blockHeader.setTime(12345678901L);
blockHeader.setTxCount(3);
List<NulsDigestData> txHashList = new ArrayList<>();
txHashList.add(NulsDigestData.calcDigestData("first-tx-hash".getBytes()));
txHashList.add(NulsDigestData.calcDigestData("second-tx-hash".getBytes()));
txHashList.add(NulsDigestData.calcDigestData("third-tx-hash".getBytes()));
// block.setTxHashList(txHashList);
// this.model = blockHeader;
}
use of io.nuls.ledger.module.impl.UtxoLedgerModuleBootstrap in project nuls by nuls-io.
the class TransactionServiceImplTest method init.
@Before
public void init() {
MicroKernelBootstrap mk = MicroKernelBootstrap.getInstance();
mk.init();
mk.start();
LevelDbModuleBootstrap bootstrap = new LevelDbModuleBootstrap();
bootstrap.init();
bootstrap.start();
UtxoLedgerModuleBootstrap ledgerModuleBootstrap = new UtxoLedgerModuleBootstrap();
ledgerModuleBootstrap.init();
ledgerModuleBootstrap.start();
NettyNetworkModuleBootstrap networkModuleBootstrap = new NettyNetworkModuleBootstrap();
networkModuleBootstrap.init();
networkModuleBootstrap.start();
transactionService = SpringLiteContext.getBean(TransactionService.class);
initTxList();
}
Aggregations