use of org.hyperledger.besu.ethereum.privacy.PrivateTransaction 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.privacy.PrivateTransaction 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.privacy.PrivateTransaction in project besu by hyperledger.
the class MultiTenancyAcceptanceTest method privGetPrivateTransactionSuccessShouldReturnExpectedPrivateTransaction.
@Test
public void privGetPrivateTransactionSuccessShouldReturnExpectedPrivateTransaction() throws JsonProcessingException {
final PrivateTransaction validSignedPrivateTransaction = getValidSignedPrivateTransaction(senderAddress);
receiveEnclaveStub(validSignedPrivateTransaction);
retrievePrivacyGroupEnclaveStub();
sendEnclaveStub(PARTICIPANT_ENCLAVE_KEY1);
final Hash transactionHash = node.execute(privacyTransactions.sendRawTransaction(getRLPOutput(validSignedPrivateTransaction).encoded().toHexString()));
node.verify(priv.getSuccessfulTransactionReceipt(transactionHash));
node.verify(priv.getPrivateTransaction(transactionHash, validSignedPrivateTransaction));
}
use of org.hyperledger.besu.ethereum.privacy.PrivateTransaction in project besu by hyperledger.
the class MultiTenancyValidationFailAcceptanceTest method sendRawTransactionShouldFailWhenPrivacyGroupDoesNotContainEnclaveKey.
@Test
public void sendRawTransactionShouldFailWhenPrivacyGroupDoesNotContainEnclaveKey() throws JsonProcessingException {
final PrivateTransaction validSignedPrivateTransaction = getValidSignedPrivateTransaction(senderAddress, ENCLAVE_PUBLIC_KEY);
retrievePrivacyGroupEnclaveStub();
final Transaction<Hash> transaction = privacyTransactions.sendRawTransaction(getRLPOutput(validSignedPrivateTransaction).encoded().toHexString());
node.verify(priv.multiTenancyValidationFail(transaction, ENCLAVE_ERROR));
}
use of org.hyperledger.besu.ethereum.privacy.PrivateTransaction in project besu by hyperledger.
the class MultiTenancyValidationFailAcceptanceTest method sendRawTransactionShouldFailWhenPrivateFromNotMatchEnclaveKey.
@Test
public void sendRawTransactionShouldFailWhenPrivateFromNotMatchEnclaveKey() throws JsonProcessingException {
final PrivateTransaction validSignedPrivateTransaction = getValidSignedPrivateTransaction(senderAddress, OTHER_ENCLAVE_PUBLIC_KEY);
retrievePrivacyGroupEnclaveStub();
final Transaction<Hash> transaction = privacyTransactions.sendRawTransaction(getRLPOutput(validSignedPrivateTransaction).encoded().toHexString());
node.verify(priv.multiTenancyValidationFail(transaction, JsonRpcError.PRIVATE_FROM_DOES_NOT_MATCH_ENCLAVE_PUBLIC_KEY));
}
Aggregations