reth_node_core::rpc::compat::transaction

Trait TransactionCompat

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§

type Transaction: Send + Clone + Default + Debug

RPC transaction response type.

Required Methods§

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.

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

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

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

Returns the transaction type.

Provided Methods§

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§

§

impl TransactionCompat for ()

§

type Transaction = WithOtherFields<Transaction>

§

fn fill( _tx: TransactionSignedEcRecovered, _tx_info: TransactionInfo, ) -> <() as TransactionCompat>::Transaction

§

fn otterscan_api_truncate_input( _tx: &mut <() as TransactionCompat>::Transaction, )

§

fn tx_type(_tx: &<() as TransactionCompat>::Transaction) -> u8

Implementors§