Skip to main content

with_network_provider

Macro with_network_provider 

Source
macro_rules! with_network_provider {
    ($network:expr, $config:expr, $default:expr, |$provider:ident $(, $network_type:ident)?| $body:expr) => { ... };
    ($network:expr, $config:expr, |$provider:ident $(, $network_type:ident)?| $body:expr, _ => $default:expr) => { ... };
}
Expand description

Runs $body with $provider bound to a provider for the selected --network. Optionally binds $network_type to the selected network type.

The fallback arm is used for Ethereum and when no network is selected: either $default is a provider expression that $body runs against, or a full _ => $default arm.