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
type Transaction: Send + Clone + Default + Debug
RPC transaction response type.
Required Methods§
fn fill(
tx: TransactionSignedEcRecovered,
tx_inf: TransactionInfo,
) -> Self::Transaction
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)
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
fn tx_type(tx: &Self::Transaction) -> u8
Returns the transaction type.
Provided Methods§
fn gas_price(signed_tx: &TransactionSigned, base_fee: Option<u64>) -> GasPrice
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.