diff --git a/src/createXcmTypes/util/getChainIdBySpecName.spec.ts b/src/createXcmTypes/util/getChainIdBySpecName.spec.ts deleted file mode 100644 index c6a7baa4..00000000 --- a/src/createXcmTypes/util/getChainIdBySpecName.spec.ts +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright 2023 Parity Technologies (UK) Ltd. - -import { Registry } from '../../registry'; -import { getChainIdBySpecName } from './getChainIdBySpecName'; - -type Test = [expected: string, specName: string, registry: Registry]; - -describe('getChainIdBySpecName', () => { - it('should return the correct chainId when given a valid specName', () => { - const tests: Test[] = [ - ['0', 'kusama', new Registry('kusama', {})], - ['1000', 'statemine', new Registry('statemine', {})], - ['1001', 'collectives', new Registry('collectives', {})], - ['1002', 'bridge-hub-kusama', new Registry('bridge-hub-kusama', {})], - ]; - - for (const test of tests) { - const [expected, specName, registry] = test; - - const result = getChainIdBySpecName(registry, specName); - expect(result).toEqual(expected); - } - }); -}); diff --git a/src/createXcmTypes/util/getChainIdBySpecName.ts b/src/createXcmTypes/util/getChainIdBySpecName.ts deleted file mode 100644 index eb3be207..00000000 --- a/src/createXcmTypes/util/getChainIdBySpecName.ts +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright 2023 Parity Technologies (UK) Ltd. - -import { KUSAMA_ASSET_HUB_SPEC_NAMES, POLKADOT_ASSET_HUB_SPEC_NAMES, WESTEND_ASSET_HUB_SPEC_NAMES } from '../../consts'; -import { Registry } from '../../registry'; -/** - * returns a chains ID based on its relay chain and specName - * - * @param registry Registry - * @param specName string - * @returns - */ -export const getChainIdBySpecName = (registry: Registry, specName: string): string => { - let result = ''; - - Object.entries(registry.currentRelayRegistry).forEach((chainInfo) => { - if (chainInfo[1].specName.toLowerCase() === specName.toLowerCase()) { - result = chainInfo[0]; - } - }); - - // if the specName isnt found in the registry, check against AssetHub specNames - // to ensure updated specNames are accounted for - if (result.length === 0) { - if ( - POLKADOT_ASSET_HUB_SPEC_NAMES.includes(specName.toLowerCase()) || - KUSAMA_ASSET_HUB_SPEC_NAMES.includes(specName.toLowerCase()) || - WESTEND_ASSET_HUB_SPEC_NAMES.includes(specName.toLowerCase()) - ) { - result = '1000'; - } - } - - return result; -};