11use anyhow:: { anyhow, bail} ;
2+ use graph:: blockchain:: ChainIdentifier ;
23use graph:: cheap_clone:: CheapClone ;
4+ use graph:: components:: adapter:: { NetIdentifiable , ProviderManager , ProviderName } ;
35use graph:: endpoint:: EndpointMetrics ;
46use graph:: firehose:: { AvailableCapacity , SubgraphLimit } ;
57use graph:: prelude:: rand:: seq:: IteratorRandom ;
@@ -9,7 +11,7 @@ use std::collections::HashMap;
911use std:: sync:: Arc ;
1012
1113pub use graph:: impl_slog_value;
12- use graph:: prelude:: Error ;
14+ use graph:: prelude:: { async_trait , Error } ;
1315
1416use crate :: adapter:: EthereumAdapter as _;
1517use crate :: capabilities:: NodeCapabilities ;
@@ -29,6 +31,16 @@ pub struct EthereumNetworkAdapter {
2931 limit : SubgraphLimit ,
3032}
3133
34+ #[ async_trait]
35+ impl NetIdentifiable for EthereumNetworkAdapter {
36+ async fn net_identifiers ( & self ) -> Result < ChainIdentifier , anyhow:: Error > {
37+ unimplemented ! ( )
38+ }
39+ fn provider_name ( & self ) -> ProviderName {
40+ unimplemented ! ( )
41+ }
42+ }
43+
3244impl EthereumNetworkAdapter {
3345 fn is_call_only ( & self ) -> bool {
3446 self . adapter . is_call_only ( )
@@ -46,9 +58,10 @@ impl EthereumNetworkAdapter {
4658 }
4759}
4860
49- #[ derive( Debug , Clone ) ]
61+ #[ derive( Debug ) ]
5062pub struct EthereumNetworkAdapters {
51- pub adapters : Vec < EthereumNetworkAdapter > ,
63+ // provider_status: ProviderGenesisVerification,
64+ adapters : Vec < EthereumNetworkAdapter > ,
5265 call_only_adapters : Vec < EthereumNetworkAdapter > ,
5366 // Percentage of request that should be used to retest errored adapters.
5467 retest_percent : f64 ,
@@ -66,6 +79,7 @@ impl EthereumNetworkAdapters {
6679 adapters : vec ! [ ] ,
6780 call_only_adapters : vec ! [ ] ,
6881 retest_percent : retest_percent. unwrap_or ( DEFAULT_ADAPTER_ERROR_RETEST_PERCENT ) ,
82+ // provider_status: ProviderGenesisVerification::default(),
6983 }
7084 }
7185
@@ -76,7 +90,7 @@ impl EthereumNetworkAdapters {
7690 self . adapters . push ( adapter) ;
7791 }
7892 }
79- pub fn all_cheapest_with (
93+ fn all_cheapest_with (
8094 & self ,
8195 required_capabilities : & NodeCapabilities ,
8296 ) -> impl Iterator < Item = & EthereumNetworkAdapter > + ' _ {
@@ -179,7 +193,7 @@ impl EthereumNetworkAdapters {
179193 }
180194}
181195
182- #[ derive( Clone ) ]
196+ #[ derive( Debug , Clone ) ]
183197pub struct EthereumNetworks {
184198 pub metrics : Arc < EndpointMetrics > ,
185199 pub networks : HashMap < String , EthereumNetworkAdapters > ,
0 commit comments