use of org.hyperledger.besu.ethereum.api.graphql.internal.pojoadapter.TransactionAdapter in project besu by hyperledger.
the class GraphQLDataFetchers method updatePrivatePayload.
private TransactionAdapter updatePrivatePayload(final Transaction transaction) {
final GoQuorumEnclave enclave = goQuorumPrivacyParameters.get().enclave();
Bytes enclavePayload;
try {
// Retrieve the payload from the enclave
enclavePayload = Bytes.wrap(enclave.receive(transaction.getPayload().toBase64String()).getPayload());
} catch (final Exception ex) {
LOG.debug("An error occurred while retrieving the GoQuorum transaction payload: ", ex);
enclavePayload = Bytes.EMPTY;
}
// Return a new transaction containing the retrieved payload
return new TransactionAdapter(new TransactionWithMetadata(new Transaction(transaction.getNonce(), transaction.getGasPrice(), transaction.getMaxPriorityFeePerGas(), transaction.getMaxFeePerGas(), transaction.getGasLimit(), transaction.getTo(), transaction.getValue(), transaction.getSignature(), enclavePayload, transaction.getSender(), transaction.getChainId(), Optional.ofNullable(transaction.getV()))));
}
use of org.hyperledger.besu.ethereum.api.graphql.internal.pojoadapter.TransactionAdapter in project besu by hyperledger.
the class GraphQLDataFetchers method getTransactionAdapter.
private TransactionAdapter getTransactionAdapter(final TransactionWithMetadata transactionWithMetadata) {
final Transaction transaction = transactionWithMetadata.getTransaction();
final boolean isGoQuorumCompatbilityMode = goQuorumPrivacyParameters.isPresent();
final boolean isGoQuorumPrivateTransaction = isGoQuorumCompatbilityMode && transaction.isGoQuorumPrivateTransaction(isGoQuorumCompatbilityMode);
return isGoQuorumPrivateTransaction ? updatePrivatePayload(transaction) : new TransactionAdapter(transactionWithMetadata);
}
Aggregations