Search in sources :

Example 1 with InvalidJsonRpcRequestException

use of org.hyperledger.besu.ethereum.api.jsonrpc.internal.exception.InvalidJsonRpcRequestException in project besu by hyperledger.

the class DomainObjectDecodeUtils method decodeRawTransaction.

public static Transaction decodeRawTransaction(final String rawTransaction) throws InvalidJsonRpcRequestException {
    try {
        Bytes txnBytes = Bytes.fromHexString(rawTransaction);
        final boolean isGoQuorumCompatibilityMode = GoQuorumOptions.getGoQuorumCompatibilityMode();
        return TransactionDecoder.decodeOpaqueBytes(txnBytes, isGoQuorumCompatibilityMode);
    } catch (final IllegalArgumentException | RLPException e) {
        throw new InvalidJsonRpcRequestException("Invalid raw transaction hex", e);
    }
}
Also used : InvalidJsonRpcRequestException(org.hyperledger.besu.ethereum.api.jsonrpc.internal.exception.InvalidJsonRpcRequestException) Bytes(org.apache.tuweni.bytes.Bytes) RLPException(org.hyperledger.besu.ethereum.rlp.RLPException)

Aggregations

Bytes (org.apache.tuweni.bytes.Bytes)1 InvalidJsonRpcRequestException (org.hyperledger.besu.ethereum.api.jsonrpc.internal.exception.InvalidJsonRpcRequestException)1 RLPException (org.hyperledger.besu.ethereum.rlp.RLPException)1