reth_rpc_types_compat::transaction

Trait TransactionCompat

source
pub trait TransactionCompat:
    Send
    + Sync
    + Unpin
    + Clone
    + Debug {
    type Transaction: Send + Clone + Default + Debug;

    // Required methods
    fn fill(
        tx: TransactionSignedEcRecovered,
        tx_inf: TransactionInfo,
    ) -> Self::Transaction;
    fn otterscan_api_truncate_input(tx: &mut Self::Transaction);
    fn tx_type(tx: &Self::Transaction) -> u8;

    // Provided method
    fn gas_price(
        signed_tx: &TransactionSigned,
        base_fee: Option<u64>,
    ) -> GasPrice { ... }
}
Expand description

Builds RPC transaction w.r.t. network.

Required Associated Types§

source

type Transaction: Send + Clone + Default + Debug

RPC transaction response type.

Required Methods§

source

fn fill( tx: TransactionSignedEcRecovered, tx_inf: TransactionInfo, ) -> Self::Transaction

Create a new rpc transaction result for a pending signed transaction, setting block environment related fields to None.

source

fn otterscan_api_truncate_input(tx: &mut Self::Transaction)

Truncates the input of a transaction to only the first 4 bytes.

source

fn tx_type(tx: &Self::Transaction) -> u8

Returns the transaction type.

Provided Methods§

source

fn gas_price(signed_tx: &TransactionSigned, base_fee: Option<u64>) -> GasPrice

Formats gas price and max fee per gas for RPC transaction response w.r.t. network specific transaction type.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl TransactionCompat for ()

source§

type Transaction = WithOtherFields<Transaction>

source§

fn fill( _tx: TransactionSignedEcRecovered, _tx_info: TransactionInfo, ) -> Self::Transaction

source§

fn otterscan_api_truncate_input(_tx: &mut Self::Transaction)

source§

fn tx_type(_tx: &Self::Transaction) -> u8

Implementors§