use of org.tron.common.utils.Sha256Hash in project java-tron by tronprotocol.
the class MerkleTreeTest method testMerkleTreeTest.
@Test
public void testMerkleTreeTest() {
Sha256Hash hash1 = getBeforeZeroHash();
MerkleTree tree = MerkleTree.getInstance().createTree(getZeroIds());
logger.info("Transaction[X] Compare :");
logger.info("left: {}", hash1);
logger.info("right: {}", tree.getRoot().getHash());
assertEquals(hash1, tree.getRoot().getHash());
Sha256Hash hash2 = getBeforeTxHash();
tree.createTree(getTxIds2(blockCapsule1));
logger.info("Transaction[O] Compare :");
logger.info("left: {}", hash2);
logger.info("right: {}", tree.getRoot().getHash());
assertEquals(hash2, tree.getRoot().getHash());
}
Aggregations