EthApiSpec

Trait EthApiSpec 

Source
pub trait EthApiSpec: RpcNodeCore + EthApiTypes {
    // Required method
    fn starting_block(&self) -> Uint<256, 4>;

    // Provided methods
    fn protocol_version(
        &self,
    ) -> impl Future<Output = Result<Uint<64, 1>, RethError>> + Send { ... }
    fn chain_id(&self) -> Uint<64, 1> { ... }
    fn chain_info(&self) -> Result<ChainInfo, RethError> { ... }
    fn is_syncing(&self) -> bool { ... }
    fn sync_status(&self) -> Result<SyncStatus, RethError> { ... }
}
Expand description

Eth API trait.

Defines core functionality of the eth API implementation.

Required Methods§

Source

fn starting_block(&self) -> Uint<256, 4>

Returns the block node is started on.

Provided Methods§

Source

fn protocol_version( &self, ) -> impl Future<Output = Result<Uint<64, 1>, RethError>> + Send

Returns the current ethereum protocol version.

Source

fn chain_id(&self) -> Uint<64, 1>

Returns the chain id

Source

fn chain_info(&self) -> Result<ChainInfo, RethError>

Returns provider chain info

Source

fn is_syncing(&self) -> bool

Returns true if the network is undergoing sync.

Source

fn sync_status(&self) -> Result<SyncStatus, RethError>

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> EthApiSpec for &'a T

Source§

fn starting_block(&self) -> Uint<256, 4>

Source§

fn protocol_version( &self, ) -> impl Future<Output = Result<Uint<64, 1>, RethError>> + Send

Source§

fn chain_id(&self) -> Uint<64, 1>

Source§

fn chain_info(&self) -> Result<ChainInfo, RethError>

Source§

fn is_syncing(&self) -> bool

Source§

fn sync_status(&self) -> Result<SyncStatus, RethError>

Source§

impl<T> EthApiSpec for Arc<T>

Source§

fn starting_block(&self) -> Uint<256, 4>

Source§

fn protocol_version( &self, ) -> impl Future<Output = Result<Uint<64, 1>, RethError>> + Send

Source§

fn chain_id(&self) -> Uint<64, 1>

Source§

fn chain_info(&self) -> Result<ChainInfo, RethError>

Source§

fn is_syncing(&self) -> bool

Source§

fn sync_status(&self) -> Result<SyncStatus, RethError>

Implementors§

Source§

impl<N, Rpc> EthApiSpec for EthApi<N, Rpc>
where N: RpcNodeCore, Rpc: RpcConvert<Primitives = <N as RpcNodeCore>::Primitives, Error = EthApiError>,