reth_rpc_eth_api::helpers::spec

Trait EthApiSpec

Source
pub trait EthApiSpec: RpcNodeCore<Provider: ChainSpecProvider<ChainSpec: EthereumHardforks> + BlockNumReader + StageCheckpointReader, Network: NetworkInfo> {
    type Transaction;

    // Required methods
    fn starting_block(&self) -> U256;
    fn signers(&self) -> &RwLock<Vec<Box<dyn EthSigner<Self::Transaction>>>>;

    // Provided methods
    fn protocol_version(&self) -> impl Future<Output = RethResult<U64>> + Send { ... }
    fn chain_id(&self) -> U64 { ... }
    fn chain_info(&self) -> RethResult<ChainInfo> { ... }
    fn accounts(&self) -> Vec<Address> { ... }
    fn is_syncing(&self) -> bool { ... }
    fn sync_status(&self) -> RethResult<SyncStatus> { ... }
}
Expand description

Eth API trait.

Defines core functionality of the eth API implementation.

Required Associated Types§

Source

type Transaction

The transaction type signers are using.

Required Methods§

Source

fn starting_block(&self) -> U256

Returns the block node is started on.

Source

fn signers(&self) -> &RwLock<Vec<Box<dyn EthSigner<Self::Transaction>>>>

Returns a handle to the signers owned by provider.

Provided Methods§

Source

fn protocol_version(&self) -> impl Future<Output = RethResult<U64>> + Send

Returns the current ethereum protocol version.

Source

fn chain_id(&self) -> U64

Returns the chain id

Source

fn chain_info(&self) -> RethResult<ChainInfo>

Returns provider chain info

Source

fn accounts(&self) -> Vec<Address>

Returns a list of addresses owned by provider.

Source

fn is_syncing(&self) -> bool

Returns true if the network is undergoing sync.

Source

fn sync_status(&self) -> RethResult<SyncStatus>

Returns the [SyncStatus] of the network

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<'a, T: 'a + EthApiSpec + ?Sized> EthApiSpec for &'a T
where &'a T: RpcNodeCore<Provider: ChainSpecProvider<ChainSpec: EthereumHardforks> + BlockNumReader + StageCheckpointReader, Network: NetworkInfo>,

Source§

type Transaction = <T as EthApiSpec>::Transaction

Source§

fn starting_block(&self) -> U256

Source§

fn signers(&self) -> &RwLock<Vec<Box<dyn EthSigner<Self::Transaction>>>>

Source§

fn protocol_version(&self) -> impl Future<Output = RethResult<U64>> + Send

Source§

fn chain_id(&self) -> U64

Source§

fn chain_info(&self) -> RethResult<ChainInfo>

Source§

fn accounts(&self) -> Vec<Address>

Source§

fn is_syncing(&self) -> bool

Source§

fn sync_status(&self) -> RethResult<SyncStatus>

Source§

impl<T: EthApiSpec + ?Sized> EthApiSpec for Arc<T>
where Arc<T>: RpcNodeCore<Provider: ChainSpecProvider<ChainSpec: EthereumHardforks> + BlockNumReader + StageCheckpointReader, Network: NetworkInfo>,

Source§

type Transaction = <T as EthApiSpec>::Transaction

Source§

fn starting_block(&self) -> U256

Source§

fn signers(&self) -> &RwLock<Vec<Box<dyn EthSigner<Self::Transaction>>>>

Source§

fn protocol_version(&self) -> impl Future<Output = RethResult<U64>> + Send

Source§

fn chain_id(&self) -> U64

Source§

fn chain_info(&self) -> RethResult<ChainInfo>

Source§

fn accounts(&self) -> Vec<Address>

Source§

fn is_syncing(&self) -> bool

Source§

fn sync_status(&self) -> RethResult<SyncStatus>

Implementors§