From b7f7960452d0bd5aa8e68df892afb9a51e0a4b07 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Igor=20=C5=BBuk?= Date: Fri, 17 Mar 2023 09:12:44 +0100 Subject: [PATCH] fix: use to_string in mainnet chain variant --- ethers-core/src/types/chain.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ethers-core/src/types/chain.rs b/ethers-core/src/types/chain.rs index fb574c2985..a34ee0ac23 100644 --- a/ethers-core/src/types/chain.rs +++ b/ethers-core/src/types/chain.rs @@ -53,7 +53,7 @@ pub type ParseChainError = TryFromPrimitiveError; #[strum(serialize_all = "kebab-case")] #[repr(u64)] pub enum Chain { - #[strum(serialize = "ethlive", serialize = "mainnet")] + #[strum(to_string = "mainnet", serialize = "ethlive")] Mainnet = 1, Morden = 2, Ropsten = 3, @@ -598,6 +598,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"]),