File tree Expand file tree Collapse file tree 1 file changed +11
-6
lines changed Expand file tree Collapse file tree 1 file changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -41,11 +41,13 @@ struct GraphqlResponse {
4141
4242const SUPPORTED_NETWORKS_QUERY : & str = r#"
4343query 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+ }
4749 }
48- }
50+ }
4951"# ;
5052
5153impl EpochBlockOracleSubgraph for EpochBlockOracleSubgraphImpl {
@@ -81,8 +83,11 @@ impl EpochBlockOracleSubgraph for EpochBlockOracleSubgraphImpl {
8183 let data = res
8284 . data
8385 . 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+ } ) ?;
8691
8792 #[ derive( Deserialize ) ]
8893 #[ allow( non_snake_case) ]
You can’t perform that action at this time.
0 commit comments