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

Treat chain names as lowercase #2249

Merged
merged 8 commits into from
Jul 3, 2023
4 changes: 2 additions & 2 deletions rust/hyperlane-base/src/settings/base.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ impl FromRawConf<'_, RawSettings, Option<&HashSet<&str>>> for Settings {
if let Some(default_signer) = &default_signer {
parsed.signer.get_or_insert_with(|| default_signer.clone());
}
Ok((k, parsed))
Ok((k.to_ascii_lowercase(), parsed))
})
.filter_map(|res| match res {
Ok((k, v)) => Some((k, v)),
Expand Down Expand Up @@ -249,7 +249,7 @@ impl Settings {
/// Try to get the domain for a given chain by name.
pub fn lookup_domain(&self, chain_name: &str) -> eyre::Result<HyperlaneDomain> {
self.chains
.get(chain_name)
.get(&chain_name.to_ascii_lowercase())
mattiekat marked this conversation as resolved.
Show resolved Hide resolved
.ok_or_else(|| eyre!("No chain setup found for {chain_name}"))
.map(|c| c.domain.clone())
}
Expand Down