-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Labels
type: enhancementImprovement to existing functionalityImprovement to existing functionality
Description
Currently we define the providers as a Vec<P> where P: IntoProvider.
The issue is once we pass in the 'main' provider, we now bind generic P to the primary provider's (sub)type.
So this is not possible:
let ws_string: &str = "ws_example";
let robust: RobustProvider<Ethereum> = RobustProviderBuilder::new(ws_provider)
.fallback(ws_string)
.call_timeout(Duration::from_secs(5))
.build()
.await?;You need (where both primary and fallback are same type):
let ws_string: &str = "ws_example";
let robust: RobustProvider<Ethereum> = RobustProviderBuilder::new(ws_string)
.fallback(ws_string)
.call_timeout(Duration::from_secs(5))
.build()
.await?;This is not the desired API. The client should have the benefit of 'mixing' provider types.
The solution to this might entail the use of LazyProvider wrapper types, so the internal vector type would be "fixed" to Vec<LazyProvider<N>> where N: Network, but internally the LazyProvider would be able to store different provider connection types.
Related #165
Metadata
Metadata
Assignees
Labels
type: enhancementImprovement to existing functionalityImprovement to existing functionality