File tree 1 file changed +11
-6
lines changed
1 file changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -41,11 +41,13 @@ struct GraphqlResponse {
41
41
42
42
const SUPPORTED_NETWORKS_QUERY : & str = r#"
43
43
query Networks($skip: Int!) {
44
- networks(first: 1000, skip: $skip) {
45
- id
46
- alias
44
+ globalState(id: "0") {
45
+ networks(first: 1000, skip: $skip) {
46
+ id
47
+ alias
48
+ }
47
49
}
48
- }
50
+ }
49
51
"# ;
50
52
51
53
impl EpochBlockOracleSubgraph for EpochBlockOracleSubgraphImpl {
@@ -81,8 +83,11 @@ impl EpochBlockOracleSubgraph for EpochBlockOracleSubgraphImpl {
81
83
let data = res
82
84
. data
83
85
. ok_or_else ( || anyhow ! ( "Data field is missing in the response" ) ) ?
84
- . remove ( "networks" )
85
- . ok_or_else ( || anyhow ! ( "'networks' field is missing in the data" ) ) ?;
86
+ . remove ( "globalState" )
87
+ . and_then ( |global_state| global_state. get ( "networks" ) . cloned ( ) )
88
+ . ok_or_else ( || {
89
+ anyhow ! ( "'networks' field is missing in the globalState data" )
90
+ } ) ?;
86
91
87
92
#[ derive( Deserialize ) ]
88
93
#[ allow( non_snake_case) ]
You can’t perform that action at this time.
0 commit comments