use of com.jd.blockchain.ledger.DataAccountKVSetOperation in project jdchain-core by blockchain-jd-com.
the class LedgerTransactionDataTest method initTransactionContent.
private TransactionContent initTransactionContent() throws Exception {
TxContentBlob contentBlob = null;
BlockchainKeypair id = BlockchainKeyGenerator.getInstance().generate(ClassicAlgorithm.ED25519);
HashDigest ledgerHash = Crypto.getHashFunction("SHA256").hash(UUID.randomUUID().toString().getBytes("UTF-8"));
BlockchainOperationFactory opFactory = new BlockchainOperationFactory();
contentBlob = new TxContentBlob(ledgerHash);
// contentBlob.setSubjectAccount(id.getAddress());
// contentBlob.setSequenceNumber(1);
DataAccountKVSetOperation kvsetOP = opFactory.dataAccount(id.getAddress()).setText("Name", "AAA", -1).getOperation();
contentBlob.addOperation(kvsetOP);
return contentBlob;
}
Aggregations