public static RawTransaction decode(final String hexTransaction) {
        final byte[] transaction = Numeric.hexStringToByteArray(hexTransaction);
        TransactionType transactionType = getTransactionType(transaction);

        switch (transactionType) {
            case EIP1559:
                return decodeEIP1559Transaction(transaction);
            case EIP4844:
                return decodeEIP4844Transaction(transaction);
            case EIP2930:
                return decodeEIP2930Transaction(transaction);
            default:
                return decodeLegacyTransaction(transaction);
        }
    }
@Test
    public void testDecodingSigned2930() throws SignatureException {
        final RawTransaction rawTransaction = createEip2930RawTransaction();
        final Transaction2930 transaction2930 = (Transaction2930) rawTransaction.getTransaction();

        final byte[] signedMessage =
                TransactionEncoder.signMessage(rawTransaction, SampleKeys.CREDENTIALS);
        final String signedHexMessage = Numeric.toHexString(signedMessage);

        final RawTransaction result = TransactionDecoder.decode(signedHexMessage);
        assertTrue(result.getTransaction() instanceof Transaction2930);
        final Transaction2930 resultTransaction2930 = (Transaction2930) result.getTransaction();

        assertNotNull(result);
        assertEquals(transaction2930.getChainId(), resultTransaction2930.getChainId());
        assertEquals(transaction2930.getNonce(), resultTransaction2930.getNonce());
        assertEquals(transaction2930.getGasPrice(), resultTransaction2930.getGasPrice());
        assertEquals(transaction2930.getGasLimit(), resultTransaction2930.getGasLimit());
        assertEquals(transaction2930.getTo(), resultTransaction2930.getTo());
        assertEquals(transaction2930.getValue(), resultTransaction2930.getValue());
        assertEquals(transaction2930.getData(), resultTransaction2930.getData());
        assertIterableEquals(
                transaction2930.getAccessList(), resultTransaction2930.getAccessList());

        assertTrue(result instanceof SignedRawTransaction);
        final SignedRawTransaction signedResult = (SignedRawTransaction) result;
        assertNotNull(signedResult.getSignatureData());

        final Sign.SignatureData signatureData = signedResult.getSignatureData();
        final byte[] encodedTransaction = TransactionEncoder.encode(rawTransaction);
        final BigInteger key = Sign.signedMessageToKey(encodedTransaction, signatureData);
        assertEquals(key, SampleKeys.PUBLIC_KEY);
        assertEquals(SampleKeys.ADDRESS, signedResult.getFrom());
        signedResult.verify(SampleKeys.ADDRESS);
        assertNull(signedResult.getChainId());
    }