use of org.hyperledger.besu.ethereum.rlp.BytesValueRLPOutput in project besu by hyperledger.
the class AccountRangeMessage method create.
public static AccountRangeMessage create(final Optional<BigInteger> requestId, final Map<Bytes32, Bytes> accounts, final ArrayDeque<Bytes> proof) {
final BytesValueRLPOutput tmp = new BytesValueRLPOutput();
tmp.startList();
requestId.ifPresent(tmp::writeBigIntegerScalar);
tmp.writeList(accounts.entrySet(), (entry, rlpOutput) -> {
rlpOutput.startList();
rlpOutput.writeBytes(entry.getKey());
rlpOutput.writeRLPBytes(entry.getValue());
rlpOutput.endList();
});
tmp.writeList(proof, (bytes, rlpOutput) -> rlpOutput.writeBytes(bytes));
tmp.endList();
return new AccountRangeMessage(tmp.encoded());
}
use of org.hyperledger.besu.ethereum.rlp.BytesValueRLPOutput in project besu by hyperledger.
the class MultiTenancyAcceptanceTest method privGetTransactionReceiptSuccessShouldReturnTransactionReceiptAfterMined.
@Test
public void privGetTransactionReceiptSuccessShouldReturnTransactionReceiptAfterMined() throws JsonProcessingException {
final PrivateTransaction validSignedPrivateTransaction = getValidSignedPrivateTransaction(senderAddress);
final BytesValueRLPOutput rlpOutput = getRLPOutput(validSignedPrivateTransaction);
retrievePrivacyGroupEnclaveStub();
sendEnclaveStub(PARTICIPANT_ENCLAVE_KEY1);
receiveEnclaveStub(validSignedPrivateTransaction);
final Hash transactionReceipt = node.execute(privacyTransactions.sendRawTransaction(rlpOutput.encoded().toHexString()));
node.verify(priv.getSuccessfulTransactionReceipt(transactionReceipt));
}
use of org.hyperledger.besu.ethereum.rlp.BytesValueRLPOutput in project besu by hyperledger.
the class MultiTenancyAcceptanceTest method privGetTransactionCountSuccessShouldReturnExpectedTransactionCount.
@Test
public void privGetTransactionCountSuccessShouldReturnExpectedTransactionCount() throws JsonProcessingException {
final PrivateTransaction validSignedPrivateTransaction = getValidSignedPrivateTransaction(senderAddress);
final String accountAddress = validSignedPrivateTransaction.getSender().toHexString();
final BytesValueRLPOutput rlpOutput = getRLPOutput(validSignedPrivateTransaction);
retrievePrivacyGroupEnclaveStub();
sendEnclaveStub(PARTICIPANT_ENCLAVE_KEY1);
receiveEnclaveStub(validSignedPrivateTransaction);
node.verify(priv.getTransactionCount(accountAddress, PRIVACY_GROUP_ID, 0));
final Hash transactionReceipt = node.execute(privacyTransactions.sendRawTransaction(rlpOutput.encoded().toHexString()));
node.verify(priv.getSuccessfulTransactionReceipt(transactionReceipt));
node.verify(priv.getTransactionCount(accountAddress, PRIVACY_GROUP_ID, 1));
}
use of org.hyperledger.besu.ethereum.rlp.BytesValueRLPOutput in project besu by hyperledger.
the class MultiTenancyAcceptanceTest method getRLPOutputForReceiveResponse.
private BytesValueRLPOutput getRLPOutputForReceiveResponse(final PrivateTransaction privateTransaction) {
final BytesValueRLPOutput bvrlpo = new BytesValueRLPOutput();
privateTransaction.writeTo(bvrlpo);
return bvrlpo;
}
use of org.hyperledger.besu.ethereum.rlp.BytesValueRLPOutput in project besu by hyperledger.
the class MultiTenancyValidationFailAcceptanceTest method getRLPOutput.
private BytesValueRLPOutput getRLPOutput(final PrivateTransaction validSignedPrivateTransaction) {
final BytesValueRLPOutput bvrlpo = new BytesValueRLPOutput();
validSignedPrivateTransaction.writeTo(bvrlpo);
return bvrlpo;
}
Aggregations