Skip to content
This repository was archived by the owner on Oct 19, 2024. It is now read-only.

Commit 34d8038

Browse files
committed
fix: use to_string in mainnet chain variant
1 parent 18d4042 commit 34d8038

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Diff for: ethers-core/src/types/chain.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,8 @@ pub type ParseChainError = TryFromPrimitiveError<Chain>;
5353
#[strum(serialize_all = "kebab-case")]
5454
#[repr(u64)]
5555
pub enum Chain {
56-
#[strum(serialize = "ethlive", serialize = "mainnet")]
56+
#[strum(to_string = "mainnet", serialize = "ethlive")]
57+
#[serde(alias = "ethlive")]
5758
Mainnet = 1,
5859
Morden = 2,
5960
Ropsten = 3,
@@ -598,6 +599,7 @@ mod tests {
598599

599600
// kebab-case
600601
const ALIASES: &[(Chain, &[&str])] = &[
602+
(Mainnet, &["ethlive"]),
601603
(BinanceSmartChain, &["bsc", "binance-smart-chain"]),
602604
(BinanceSmartChainTestnet, &["bsc-testnet", "binance-smart-chain-testnet"]),
603605
(XDai, &["xdai", "gnosis", "gnosis-chain"]),

0 commit comments

Comments
 (0)