From 6c017990a10ce4e9397451ed6c972eb26930de58 Mon Sep 17 00:00:00 2001 From: Marcelo Fornet Date: Thu, 25 Aug 2022 18:09:45 +0200 Subject: [PATCH] nit: Explicitly handle all chains on match (#1635) --- ethers-core/src/types/chain.rs | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/ethers-core/src/types/chain.rs b/ethers-core/src/types/chain.rs index 653e9fe9..c082f0a6 100644 --- a/ethers-core/src/types/chain.rs +++ b/ethers-core/src/types/chain.rs @@ -93,7 +93,22 @@ impl Chain { Chain::Oasis => 5_500, Chain::Emerald => 6_000, Chain::Dev | Chain::AnvilHardhat => 200, - _ => return None, + // Explictly handle all network to make it easier not to forget this match when new + // networks are added. + Chain::Morden | + Chain::Ropsten | + Chain::Rinkeby | + Chain::Goerli | + Chain::Kovan | + Chain::XDai | + Chain::Sepolia | + Chain::Moonbase | + Chain::MoonbeamDev | + Chain::OptimismKovan | + Chain::Poa | + Chain::Sokol | + Chain::Rsk | + Chain::EmeraldTestnet => return None, }; Some(Duration::from_millis(ms))