From 07363f17a849a9ef0dfa83c0c90200419af70de0 Mon Sep 17 00:00:00 2001 From: Vlad Sirenko <821251+sirenko@users.noreply.github.com> Date: Tue, 3 Oct 2023 15:50:01 -0700 Subject: [PATCH] Backport upstream fix chainlink/pull/10405 The fix -- BCF-2610: fix web interfaces to work with multiple chains [1] applied to CCIP version -- `v2.5.0-ccip1.1.1`. [1]: https://github.com/smartcontractkit/chainlink/pull/10405 (move len check to match previous behavior: PR #10405) --- core/web/common.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/core/web/common.go b/core/web/common.go index 1afc1636ba..f4907ac5f7 100644 --- a/core/web/common.go +++ b/core/web/common.go @@ -15,10 +15,6 @@ var ( ) func getChain(legacyChains evm.LegacyChainContainer, chainIDstr string) (chain evm.Chain, err error) { - if legacyChains.Len() > 1 { - return nil, ErrMultipleChains - } - if chainIDstr != "" && chainIDstr != "" { // evm keys are expected to be parsable as a big int _, ok := big.NewInt(0).SetString(chainIDstr, 10) @@ -32,6 +28,10 @@ func getChain(legacyChains evm.LegacyChainContainer, chainIDstr string) (chain e return chain, nil } + if legacyChains.Len() > 1 { + return nil, ErrMultipleChains + } + chain, err = legacyChains.Default() if err != nil { return nil, err