pub trait RessProtocolProvider: Send + Sync {
// Required methods
fn header(&self, block_hash: B256) -> ProviderResult<Option<Header>>;
fn block_body(&self, block_hash: B256) -> ProviderResult<Option<BlockBody>>;
fn bytecode(&self, code_hash: B256) -> ProviderResult<Option<Bytes>>;
fn witness(
&self,
block_hash: B256,
) -> impl Future<Output = ProviderResult<Vec<Bytes>>> + Send;
// Provided methods
fn headers(&self, request: GetHeaders) -> ProviderResult<Vec<Header>> { ... }
fn block_bodies(
&self,
block_hashes: Vec<B256>,
) -> ProviderResult<Vec<BlockBody>> { ... }
}
Expand description
A provider trait for ress protocol.
Required Methods§
Sourcefn header(&self, block_hash: B256) -> ProviderResult<Option<Header>>
fn header(&self, block_hash: B256) -> ProviderResult<Option<Header>>
Return block header by hash.
Sourcefn block_body(&self, block_hash: B256) -> ProviderResult<Option<BlockBody>>
fn block_body(&self, block_hash: B256) -> ProviderResult<Option<BlockBody>>
Return block body by hash.
Provided Methods§
Sourcefn headers(&self, request: GetHeaders) -> ProviderResult<Vec<Header>>
fn headers(&self, request: GetHeaders) -> ProviderResult<Vec<Header>>
Return block headers.
Sourcefn block_bodies(
&self,
block_hashes: Vec<B256>,
) -> ProviderResult<Vec<BlockBody>>
fn block_bodies( &self, block_hashes: Vec<B256>, ) -> ProviderResult<Vec<BlockBody>>
Return block bodies.
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.
Implementors§
impl RessProtocolProvider for MockRessProtocolProvider
Available on crate feature
test-utils
only.impl RessProtocolProvider for NoopRessProtocolProvider
Available on crate feature
test-utils
only.