1
1
use anyhow:: { anyhow, bail} ;
2
+ use graph:: blockchain:: ChainIdentifier ;
2
3
use graph:: cheap_clone:: CheapClone ;
4
+ use graph:: components:: adapter:: { NetIdentifiable , ProviderManager , ProviderName } ;
3
5
use graph:: endpoint:: EndpointMetrics ;
4
6
use graph:: firehose:: { AvailableCapacity , SubgraphLimit } ;
5
7
use graph:: prelude:: rand:: seq:: IteratorRandom ;
@@ -9,7 +11,7 @@ use std::collections::HashMap;
9
11
use std:: sync:: Arc ;
10
12
11
13
pub use graph:: impl_slog_value;
12
- use graph:: prelude:: Error ;
14
+ use graph:: prelude:: { async_trait , Error } ;
13
15
14
16
use crate :: adapter:: EthereumAdapter as _;
15
17
use crate :: capabilities:: NodeCapabilities ;
@@ -29,6 +31,16 @@ pub struct EthereumNetworkAdapter {
29
31
limit : SubgraphLimit ,
30
32
}
31
33
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
+
32
44
impl EthereumNetworkAdapter {
33
45
fn is_call_only ( & self ) -> bool {
34
46
self . adapter . is_call_only ( )
@@ -46,9 +58,10 @@ impl EthereumNetworkAdapter {
46
58
}
47
59
}
48
60
49
- #[ derive( Debug , Clone ) ]
61
+ #[ derive( Debug ) ]
50
62
pub struct EthereumNetworkAdapters {
51
- pub adapters : Vec < EthereumNetworkAdapter > ,
63
+ // provider_status: ProviderGenesisVerification,
64
+ adapters : Vec < EthereumNetworkAdapter > ,
52
65
call_only_adapters : Vec < EthereumNetworkAdapter > ,
53
66
// Percentage of request that should be used to retest errored adapters.
54
67
retest_percent : f64 ,
@@ -66,6 +79,7 @@ impl EthereumNetworkAdapters {
66
79
adapters : vec ! [ ] ,
67
80
call_only_adapters : vec ! [ ] ,
68
81
retest_percent : retest_percent. unwrap_or ( DEFAULT_ADAPTER_ERROR_RETEST_PERCENT ) ,
82
+ // provider_status: ProviderGenesisVerification::default(),
69
83
}
70
84
}
71
85
@@ -76,7 +90,7 @@ impl EthereumNetworkAdapters {
76
90
self . adapters . push ( adapter) ;
77
91
}
78
92
}
79
- pub fn all_cheapest_with (
93
+ fn all_cheapest_with (
80
94
& self ,
81
95
required_capabilities : & NodeCapabilities ,
82
96
) -> impl Iterator < Item = & EthereumNetworkAdapter > + ' _ {
@@ -179,7 +193,7 @@ impl EthereumNetworkAdapters {
179
193
}
180
194
}
181
195
182
- #[ derive( Clone ) ]
196
+ #[ derive( Debug , Clone ) ]
183
197
pub struct EthereumNetworks {
184
198
pub metrics : Arc < EndpointMetrics > ,
185
199
pub networks : HashMap < String , EthereumNetworkAdapters > ,
0 commit comments