Skip to content

Commit

Permalink
fix: use to_string in mainnet chain variant
Browse files Browse the repository at this point in the history
  • Loading branch information
CodeSandwich committed Mar 17, 2023
1 parent 18d4042 commit 34d8038
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ethers-core/src/types/chain.rs
Expand Up @@ -53,7 +53,8 @@ pub type ParseChainError = TryFromPrimitiveError<Chain>;
#[strum(serialize_all = "kebab-case")]
#[repr(u64)]
pub enum Chain {
#[strum(serialize = "ethlive", serialize = "mainnet")]
#[strum(to_string = "mainnet", serialize = "ethlive")]
#[serde(alias = "ethlive")]
Mainnet = 1,
Morden = 2,
Ropsten = 3,
Expand Down Expand Up @@ -598,6 +599,7 @@ mod tests {

// kebab-case
const ALIASES: &[(Chain, &[&str])] = &[
(Mainnet, &["ethlive"]),
(BinanceSmartChain, &["bsc", "binance-smart-chain"]),
(BinanceSmartChainTestnet, &["bsc-testnet", "binance-smart-chain-testnet"]),
(XDai, &["xdai", "gnosis", "gnosis-chain"]),
Expand Down

0 comments on commit 34d8038

Please sign in to comment.