use of com.jd.blockchain.ledger.OperationResult in project jdchain-core by blockchain-jd-com.
the class TransactionDecorator method initOperationResults.
private OperationResult[] initOperationResults(OperationResult[] opResults) {
OperationResult[] operationResults = null;
if (opResults != null && opResults.length > 0) {
operationResults = new OperationResult[opResults.length];
for (int i = 0; i < opResults.length; i++) {
OperationResult opResult = opResults[i];
TypedValue value = TypedValue.wrap(opResult.getResult());
operationResults[i] = new OperationResultData(opResult.getIndex(), value);
}
}
return operationResults;
}
use of com.jd.blockchain.ledger.OperationResult in project jdchain-core by blockchain-jd-com.
the class TransactionSetTest method buildTransactionResult.
private TransactionResult buildTransactionResult(TransactionRequest txReq, long blockHeight, TransactionState txState) {
TransactionStagedSnapshot txSnapshot = new TransactionStagedSnapshot();
HashDigest adminAccountHash = LedgerTestUtils.generateRandomHash();
txSnapshot.setAdminAccountHash(adminAccountHash);
HashDigest userAccountSetHash = LedgerTestUtils.generateRandomHash();
txSnapshot.setUserAccountSetHash(userAccountSetHash);
HashDigest dataAccountSetHash = LedgerTestUtils.generateRandomHash();
txSnapshot.setDataAccountSetHash(dataAccountSetHash);
HashDigest contractAccountSetHash = LedgerTestUtils.generateRandomHash();
txSnapshot.setContractAccountSetHash(contractAccountSetHash);
OperationResult[] opResults = new OperationResult[0];
TransactionResultData txResult = new TransactionResultData(txReq.getTransactionHash(), blockHeight, txState, txSnapshot, opResults);
return txResult;
}
Aggregations