EVM Provider Context
The EvmInstrumentedClientContext
trait provides a standardized alloy-rs (opens in a new tab) EVM provider for interacting with EVM-compatible blockchain networks in your Blueprint.
Overview
The EvmInstrumentedClientContext
trait provides access to an EVM provider:
/// `EvmInstrumentedClientContext` trait provides access to the EVM provider from the context.
pub trait EvmInstrumentedClientContext {
async fn evm_client(&self) -> InstrumentedClient;
}
Using the Context
1. Define Your Context
First, define your context struct that implements the EvmProviderContext
trait:
}
#[allow(dead_code)]
fn main() {
let body = async {
let ctx = MyContext {
foo: "bar".to_string(),
config: BlueprintEnvironment::default(),
store: Arc::new(LocalDatabase::open("test.json").unwrap()),
call_id: None,
2. Access Provider Parameters
You can then use this context to access EVM provider parameters:
Last updated on