Skip to content

Commit 1bd7650

Browse files
authored
fix: add config for receipts domain (#82)
This adds the config options, `chain_id` & `verifying_contract`, required to contruct the EIP-712 domain used when verifying receipts.
1 parent cae9f29 commit 1bd7650

File tree

2 files changed

+24
-3
lines changed

2 files changed

+24
-3
lines changed

service/src/config.rs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ pub struct Cli {
2020
#[command(flatten)]
2121
pub ethereum: Ethereum,
2222
#[command(flatten)]
23+
pub receipts: Receipts,
24+
#[command(flatten)]
2325
pub indexer_infrastructure: IndexerInfrastructure,
2426
#[command(flatten)]
2527
pub postgres: Postgres,
@@ -71,6 +73,25 @@ pub struct Ethereum {
7173
pub indexer_address: Address,
7274
}
7375

76+
#[derive(Clone, Debug, Args, Serialize, Deserialize, Default)]
77+
#[group(required = true, multiple = true)]
78+
pub struct Receipts {
79+
#[clap(
80+
long,
81+
value_name = "receipts-verifier-chain-id",
82+
env = "RECEIPTS_VERIFIER_CHAIN_ID",
83+
help = "Scalar TAP verifier chain ID"
84+
)]
85+
pub receipts_verifier_chain_id: u64,
86+
#[clap(
87+
long,
88+
value_name = "receipts-verifier-address",
89+
env = "RECEIPTS_VERIFIER_ADDRESS",
90+
help = "Scalar TAP verifier contract address"
91+
)]
92+
pub receipts_verifier_address: Address,
93+
}
94+
7495
#[derive(Clone, Debug, Args, Serialize, Deserialize, Default)]
7596
#[group(required = true, multiple = true)]
7697
pub struct IndexerInfrastructure {

service/src/main.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,12 +127,12 @@ async fn main() -> Result<(), std::io::Error> {
127127
escrow_accounts,
128128
// TODO: arguments for eip712_domain should be a config
129129
eip712_domain! {
130-
name: "TapManager",
130+
name: "Scalar TAP",
131131
version: "1",
132-
verifying_contract: config.ethereum.indexer_address,
132+
chain_id: config.receipts.receipts_verifier_chain_id,
133+
verifying_contract: config.receipts.receipts_verifier_address,
133134
},
134135
);
135-
136136
// Proper initiation of server, query processor
137137
// server health check, graph-node instance connection check
138138
let query_processor =

0 commit comments

Comments
 (0)