pub struct AlloyL2ChainProvider { /* private fields */ }
Expand description
The AlloyL2ChainProvider is a concrete implementation of the L2ChainProvider trait, providing data over Ethereum JSON-RPC using an alloy provider as the backend.
Note:
This provider fetches data using the debug_getRawBlock
method. The RPC must support this
namespace.
Implementations§
Source§impl AlloyL2ChainProvider
impl AlloyL2ChainProvider
Sourcepub fn new(inner: ReqwestProvider, rollup_config: Arc<RollupConfig>) -> Self
pub fn new(inner: ReqwestProvider, rollup_config: Arc<RollupConfig>) -> Self
Creates a new AlloyL2ChainProvider with the given alloy provider and RollupConfig.
Sourcepub async fn chain_id(&mut self) -> Result<u64, RpcError<TransportErrorKind>>
pub async fn chain_id(&mut self) -> Result<u64, RpcError<TransportErrorKind>>
Returns the chain ID.
Sourcepub async fn latest_block_number(
&mut self,
) -> Result<u64, RpcError<TransportErrorKind>>
pub async fn latest_block_number( &mut self, ) -> Result<u64, RpcError<TransportErrorKind>>
Returns the latest L2 block number.
Sourcepub fn new_http(url: Url, rollup_config: Arc<RollupConfig>) -> Self
pub fn new_http(url: Url, rollup_config: Arc<RollupConfig>) -> Self
Creates a new AlloyL2ChainProvider from the provided reqwest::Url.
Trait Implementations§
Source§impl BatchValidationProvider for AlloyL2ChainProvider
impl BatchValidationProvider for AlloyL2ChainProvider
Source§type Error = AlloyProviderError
type Error = AlloyProviderError
The error type for the BatchValidationProvider.
Source§fn l2_block_info_by_number<'life0, 'async_trait>(
&'life0 mut self,
number: u64,
) -> Pin<Box<dyn Future<Output = Result<L2BlockInfo, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn l2_block_info_by_number<'life0, 'async_trait>(
&'life0 mut self,
number: u64,
) -> Pin<Box<dyn Future<Output = Result<L2BlockInfo, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Returns the L2BlockInfo given a block number. Read more
Source§impl Clone for AlloyL2ChainProvider
impl Clone for AlloyL2ChainProvider
Source§fn clone(&self) -> AlloyL2ChainProvider
fn clone(&self) -> AlloyL2ChainProvider
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for AlloyL2ChainProvider
impl Debug for AlloyL2ChainProvider
Source§impl L2ChainProvider for AlloyL2ChainProvider
impl L2ChainProvider for AlloyL2ChainProvider
Source§type Error = AlloyProviderError
type Error = AlloyProviderError
The error type for the L2ChainProvider.
Source§fn system_config_by_number<'life0, 'async_trait>(
&'life0 mut self,
number: u64,
rollup_config: Arc<RollupConfig>,
) -> Pin<Box<dyn Future<Output = Result<SystemConfig, <Self as L2ChainProvider>::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn system_config_by_number<'life0, 'async_trait>(
&'life0 mut self,
number: u64,
rollup_config: Arc<RollupConfig>,
) -> Pin<Box<dyn Future<Output = Result<SystemConfig, <Self as L2ChainProvider>::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Returns the SystemConfig by L2 number.
Auto Trait Implementations§
impl Freeze for AlloyL2ChainProvider
impl !RefUnwindSafe for AlloyL2ChainProvider
impl Send for AlloyL2ChainProvider
impl Sync for AlloyL2ChainProvider
impl Unpin for AlloyL2ChainProvider
impl !UnwindSafe for AlloyL2ChainProvider
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more