Skip to content

Commit

Permalink
chore: change to use subgraph deployment id and version
Browse files Browse the repository at this point in the history
  • Loading branch information
Maikol committed Jun 13, 2024
1 parent adf48d3 commit b97deb5
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
6 changes: 3 additions & 3 deletions crates/json-oracle-encoder/src/abi/submitConfigABI.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"constant": false,
"inputs": [
{
"name": "commitHash",
"name": "version",
"type": "string"
},
{
Expand All @@ -14,8 +14,8 @@
{"name": "period", "type": "string"},
{"name": "gracePeriod", "type": "string"},
{"name": "supportedDataSourceKinds", "type": "string"},
{"name": "networkSubgraphId", "type": "string"},
{"name": "epochBlockOracleSubgraphId", "type": "string"},
{"name": "networkSubgraphDeploymentId", "type": "string"},
{"name": "epochBlockOracleSubgraphDeploymentId", "type": "string"},
{"name": "subgraphAvailabilityManagerContract", "type": "string"},
{"name": "oracleIndex", "type": "string"}
],
Expand Down
12 changes: 6 additions & 6 deletions crates/json-oracle-encoder/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ struct Config {
period: String,
grace_period: String,
supported_data_source_kinds: String,
network_subgraph_id: String,
epoch_block_oracle_subgraph_id: String,
network_subgraph_deloyment_id: String,
epoch_block_oracle_subgraph_deloyment_id: String,
subgraph_availability_manager_contract: String,
oracle_index: String,
}

#[derive(Serialize, Deserialize)]
struct Data {
commit_hash: String,
version: String,
config: Config,
}

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

let tokens = vec![
Token::String(data.commit_hash),
Token::String(data.version),
Token::Tuple(vec![
Token::String(data.config.ipfs_concurrency),
Token::String(data.config.ipfs_timeout),
Token::String(data.config.min_signal),
Token::String(data.config.period),
Token::String(data.config.grace_period),
Token::String(data.config.supported_data_source_kinds),
Token::String(data.config.network_subgraph_id),
Token::String(data.config.epoch_block_oracle_subgraph_id),
Token::String(data.config.network_subgraph_deloyment_id),
Token::String(data.config.epoch_block_oracle_subgraph_deloyment_id),
Token::String(data.config.subgraph_availability_manager_contract),
Token::String(data.config.oracle_index),
]),
Expand Down
6 changes: 3 additions & 3 deletions json-encoder-web/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@ import { output } from './webpack.config';
require('notie/dist/notie.min.css');

const samplePayload = `{
"commit_hash": "XXXXX",
"version": "v0.0.1",
"config": {
"ipfs_concurrency": "4",
"ipfs_timeout": "10000",
"min_signal": "100",
"period": "300",
"grace_period": "0",
"supported_data_source_kinds": "ethereum,ethereum/contract,file/ipfs,substreams,file/arweave",
"network_subgraph_id": "Fg36gCZE7pXEuZ3p8sxYzFE5UbgHtk7kcJiC5HBbfgmY",
"epoch_block_oracle_subgraph_id": "4KFYqUWRTZQ9gn7GPHC6YQ2q15chJfVrX43ezYcwkgxB",
"network_subgraph_deloyment_id": "QmSWxvd8SaQK6qZKJ7xtfxCCGoRzGnoi2WNzmJYYJW9BXY",
"epoch_block_oracle_subgraph_deloyment_id": "QmQEGDTb3xeykCXLdWx7pPX3qeeGMUvHmGWP4SpMkv5QJf",
"subgraph_availability_manager_contract": "CONTRACT_ADDRESS",
"oracle_index": "ORACLE_INDEX"
}
Expand Down

0 comments on commit b97deb5

Please sign in to comment.