use of com.jd.blockchain.ledger.core.LedgerTransactionData in project jdchain-core by blockchain-jd-com.
the class LedgerTransactionDataTest method initLedgerTransactionImpl.
@Before
public void initLedgerTransactionImpl() throws Exception {
DataContractRegistry.register(LedgerTransaction.class);
DataContractRegistry.register(LedgerDataSnapshot.class);
DataContractRegistry.register(HashObject.class);
DataContractRegistry.register(DataAccountKVSetOperation.class);
txRequest = initTxRequestMessage(ClassicAlgorithm.SHA256);
long blockHeight = 9986L;
TransactionStagedSnapshot snapshot = initTransactionStagedSnapshot();
data = new TransactionResultData(txRequest.getTransactionHash(), blockHeight, TransactionState.SUCCESS, snapshot, null);
HashDigest hash = ClassicCryptoService.SHA256.hash("zhangsan".getBytes());
HashDigest adminAccountHash = ClassicCryptoService.SHA256.hash("lisi".getBytes());
HashDigest userAccountSetHash = ClassicCryptoService.SHA256.hash("wangwu".getBytes());
HashDigest dataAccountSetHash = ClassicCryptoService.SHA256.hash("zhaoliu".getBytes());
HashDigest contractAccountSetHash = ClassicCryptoService.SHA256.hash("sunqi".getBytes());
snapshot.setAdminAccountHash(adminAccountHash);
snapshot.setUserAccountSetHash(userAccountSetHash);
snapshot.setDataAccountSetHash(dataAccountSetHash);
snapshot.setContractAccountSetHash(contractAccountSetHash);
ledgerTransactionData = new LedgerTransactionData(txRequest, data);
}
Aggregations