Skip to content

Commit

Permalink
fix: Fix typo in try_from_magic error output (#405)
Browse files Browse the repository at this point in the history
  • Loading branch information
4TT1L4 authored Sep 5, 2022
1 parent 525f3d3 commit 7e2ba5d
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/utils/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -152,15 +152,14 @@ impl ChainWellKnownInfo {
}
}

/// Uses the value of the magic to return either mainnet or testnet
/// hardcoded values.
/// Try to identify the chain based on the specified magic value.
pub fn try_from_magic(magic: u64) -> Result<ChainWellKnownInfo, Error> {
match magic {
MAINNET_MAGIC => Ok(Self::mainnet()),
TESTNET_MAGIC => Ok(Self::testnet()),
PREVIEW_MAGIC => Ok(Self::preview()),
PREPROD_MAGIC => Ok(Self::preprod()),
_ => Err("can't infer well-known chain infro from specified magic".into()),
_ => Err(format!("can't identify chain from specified magic value: {}", magic).into()),
}
}
}
Expand Down

0 comments on commit 7e2ba5d

Please sign in to comment.