From 366ad751da3c31284b26b070ae3ed88793797c36 Mon Sep 17 00:00:00 2001 From: Asa Oines Date: Wed, 25 Jan 2023 18:37:27 -0500 Subject: [PATCH] Support unknown chains in MultiGenerics (#1669) --- typescript/sdk/src/utils/MultiGeneric.ts | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/typescript/sdk/src/utils/MultiGeneric.ts b/typescript/sdk/src/utils/MultiGeneric.ts index 71b45db39..6470e6527 100644 --- a/typescript/sdk/src/utils/MultiGeneric.ts +++ b/typescript/sdk/src/utils/MultiGeneric.ts @@ -1,4 +1,4 @@ -import { AllChains, AllDeprecatedChains } from '../consts/chains'; +import { AllDeprecatedChains } from '../consts/chains'; import { ChainMap, ChainName, Remotes } from '../types'; export class MultiGeneric { @@ -9,9 +9,6 @@ export class MultiGeneric { * @throws if chain is invalid or has not been set */ protected get(chain: Chain): Value { - if (!chain || !AllChains.includes(chain)) { - throw new Error(`Invalid chain ${chain}`); - } const value = this.chainMap[chain] ?? null; if (!value) { throw new Error(`No chain value found for ${chain}`); @@ -24,9 +21,6 @@ export class MultiGeneric { * @returns value or null if chain value has not been set */ protected tryGet(chain: Chain): Value | null { - if (!chain || !AllChains.includes(chain)) { - return null; - } return this.chainMap[chain] ?? null; }