Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: naming of altcoins in config #56

Merged
merged 2 commits into from
Mar 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
10 changes: 5 additions & 5 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]
# address = "0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7"
# renewal_contract = "0x020379Ba14750ECEE8dde204D0649808BCf6D32E9fDe81Ca952Ab0360cdC0937"
[renewers]
[renewers.ETH_LEGACY]
address = "0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7"
renewal_contract = "0x020379Ba14750ECEE8dde204D0649808BCf6D32E9fDe81Ca952Ab0360cdC0937"

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