Skip to content

Commit 61f6aa6

Browse files
authored
chore: update subgraphs to use id on encoder (#24)
* chore: update subgraphs to use id on encoder * chore: change to use subgraph deployment id and version
1 parent 9ec581d commit 61f6aa6

File tree

3 files changed

+12
-8
lines changed

3 files changed

+12
-8
lines changed

crates/json-oracle-encoder/src/abi/submitConfigABI.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"constant": false,
44
"inputs": [
55
{
6-
"name": "commitHash",
6+
"name": "version",
77
"type": "string"
88
},
99
{
@@ -14,7 +14,8 @@
1414
{"name": "period", "type": "string"},
1515
{"name": "gracePeriod", "type": "string"},
1616
{"name": "supportedDataSourceKinds", "type": "string"},
17-
{"name": "subgraph", "type": "string"},
17+
{"name": "networkSubgraphDeploymentId", "type": "string"},
18+
{"name": "epochBlockOracleSubgraphDeploymentId", "type": "string"},
1819
{"name": "subgraphAvailabilityManagerContract", "type": "string"},
1920
{"name": "oracleIndex", "type": "string"}
2021
],

crates/json-oracle-encoder/src/lib.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,15 @@ struct Config {
1111
period: String,
1212
grace_period: String,
1313
supported_data_source_kinds: String,
14-
subgraph: String,
14+
network_subgraph_deloyment_id: String,
15+
epoch_block_oracle_subgraph_deloyment_id: String,
1516
subgraph_availability_manager_contract: String,
1617
oracle_index: String,
1718
}
1819

1920
#[derive(Serialize, Deserialize)]
2021
struct Data {
21-
commit_hash: String,
22+
version: String,
2223
config: Config,
2324
}
2425

@@ -29,15 +30,16 @@ pub fn json_to_calldata(json: serde_json::Value) -> anyhow::Result<Vec<u8>> {
2930
let data: Data = serde_json::from_value(json)?;
3031

3132
let tokens = vec![
32-
Token::String(data.commit_hash),
33+
Token::String(data.version),
3334
Token::Tuple(vec![
3435
Token::String(data.config.ipfs_concurrency),
3536
Token::String(data.config.ipfs_timeout),
3637
Token::String(data.config.min_signal),
3738
Token::String(data.config.period),
3839
Token::String(data.config.grace_period),
3940
Token::String(data.config.supported_data_source_kinds),
40-
Token::String(data.config.subgraph),
41+
Token::String(data.config.network_subgraph_deloyment_id),
42+
Token::String(data.config.epoch_block_oracle_subgraph_deloyment_id),
4143
Token::String(data.config.subgraph_availability_manager_contract),
4244
Token::String(data.config.oracle_index),
4345
]),

json-encoder-web/index.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,16 @@ import { output } from './webpack.config';
77
require('notie/dist/notie.min.css');
88

99
const samplePayload = `{
10-
"commit_hash": "XXXXX",
10+
"version": "v0.0.1",
1111
"config": {
1212
"ipfs_concurrency": "4",
1313
"ipfs_timeout": "10000",
1414
"min_signal": "100",
1515
"period": "300",
1616
"grace_period": "0",
1717
"supported_data_source_kinds": "ethereum,ethereum/contract,file/ipfs,substreams,file/arweave",
18-
"subgraph": "https://api.thegraph.com/subgraphs/name/graphprotocol/graph-network-arbitrum",
18+
"network_subgraph_deloyment_id": "QmSWxvd8SaQK6qZKJ7xtfxCCGoRzGnoi2WNzmJYYJW9BXY",
19+
"epoch_block_oracle_subgraph_deloyment_id": "QmQEGDTb3xeykCXLdWx7pPX3qeeGMUvHmGWP4SpMkv5QJf",
1920
"subgraph_availability_manager_contract": "CONTRACT_ADDRESS",
2021
"oracle_index": "ORACLE_INDEX"
2122
}

0 commit comments

Comments
 (0)