private static TransactionType getTransactionType(final Transaction transaction) {
    return checkNotNull(
        transaction.getType(), "Transaction type for %s was not specified.", transaction);
  }
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