Skip to content

Commit

Permalink
fix: naming in config
Browse files Browse the repository at this point in the history
  • Loading branch information
irisdv committed Mar 27, 2024
1 parent d097316 commit b942745
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion bot/src/bot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ pub async fn get_domains_ready_for_renewal(
// get the erc20 address for the given auto_renew_contract
to_hex(
*config
.altcoins_mapping
.renewers_mapping
.get(&result.auto_renew_contract)
.unwrap(),
),
Expand Down
10 changes: 5 additions & 5 deletions bot/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ pub_struct!(Clone; Config {
rpc: Rpc,
watchtower: Watchtower,
server: Server,
altcoins_mapping: HashMap<FieldElement, FieldElement>,
renewers_mapping: HashMap<FieldElement, FieldElement>,
});

impl<'de> Deserialize<'de> for Config {
Expand All @@ -102,7 +102,7 @@ impl<'de> Deserialize<'de> for Config {
rpc: Rpc,
watchtower: Watchtower,
server: Server,
altcoins: HashMap<String, Altcoin>,
renewers: HashMap<String, Altcoin>,
}

let OuterConfig {
Expand All @@ -114,11 +114,11 @@ impl<'de> Deserialize<'de> for Config {
rpc,
watchtower,
server,
altcoins,
renewers,
} = OuterConfig::deserialize(deserializer)?;

// Build atcoins mapping
let altcoins_mapping = altcoins
let renewers_mapping = renewers
.into_values()
.map(|val| (val.renewal_contract, val.address))
.collect();
Expand All @@ -132,7 +132,7 @@ impl<'de> Deserialize<'de> for Config {
rpc,
watchtower,
server,
altcoins_mapping,
renewers_mapping,
})
}
}
Expand Down
6 changes: 3 additions & 3 deletions config.template.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@ rpc_url = "https://starknet-goerli.g.alchemy.com/v2/xxxxxxx"
[server]
starknetid_api = "https://api.starknet.id"

[altcoins]
[altcoins.ETH]
[renewers]
[renewers.ETH_LEGACY]
address = "0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7"
renewal_contract = "0x020379Ba14750ECEE8dde204D0649808BCf6D32E9fDe81Ca952Ab0360cdC0937"

[altcoins.STRK]
[renewers.STRK]
address = "0x04718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d"
renewal_contract = "0x078F63fcD145Ddc6ca932E562b466AFbfD7c9E882C9aa70f3e5b2ce05cD892eA"

0 comments on commit b942745

Please sign in to comment.