private static Encoder getEncoder(
      final TransactionType transactionType, final EncodingContext encodingContext) {

    if (encodingContext.equals(EncodingContext.POOLED_TRANSACTION)) {
      if (POOLED_TRANSACTION_ENCODERS.containsKey(transactionType)) {
        return POOLED_TRANSACTION_ENCODERS.get(transactionType);
      }
    }
    return checkNotNull(
        TYPED_TRANSACTION_ENCODERS.get(transactionType),
        "Developer Error. A supported transaction type %s has no associated encoding logic",
        transactionType);
  }
Encodes a transaction into opaque bytes.

@param transaction the transaction to encode
@param encodingContext the encoding context
@return the encoded transaction as bytes
ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/encoding/TransactionEncoder.java