From 6beaf73e39d339f6221b7346758822f63bbf99e3 Mon Sep 17 00:00:00 2001 From: mmaurello <93129175+mmaurello@users.noreply.github.com> Date: Tue, 16 Jan 2024 21:17:19 +1300 Subject: [PATCH] Remove equilibrium alphanet config (#182) * remove equilibrium alphanet config * remove unused assets from moonbase alpha * add changeset --- .changeset/fuzzy-cherries-dress.md | 6 ++ .../src/ConfigBuilder/ConfigBuilder.test.ts | 20 +++---- .../src/ConfigService/ConfigService.test.ts | 9 +-- packages/config/src/chains.ts | 49 ++-------------- .../config/src/configs/equilibriumAlphanet.ts | 56 ------------------- packages/config/src/configs/index.ts | 2 - packages/config/src/configs/moonbaseAlpha.ts | 44 --------------- packages/sdk/src/polkadot/PolkadotService.ts | 6 +- 8 files changed, 23 insertions(+), 169 deletions(-) create mode 100644 .changeset/fuzzy-cherries-dress.md delete mode 100644 packages/config/src/configs/equilibriumAlphanet.ts diff --git a/.changeset/fuzzy-cherries-dress.md b/.changeset/fuzzy-cherries-dress.md new file mode 100644 index 00000000..10f8632f --- /dev/null +++ b/.changeset/fuzzy-cherries-dress.md @@ -0,0 +1,6 @@ +--- +'@moonbeam-network/xcm-config': patch +'@moonbeam-network/xcm-sdk': patch +--- + +Remove equilibrium alphanet config diff --git a/packages/config/src/ConfigBuilder/ConfigBuilder.test.ts b/packages/config/src/ConfigBuilder/ConfigBuilder.test.ts index 94619cd1..c182b682 100644 --- a/packages/config/src/ConfigBuilder/ConfigBuilder.test.ts +++ b/packages/config/src/ConfigBuilder/ConfigBuilder.test.ts @@ -2,9 +2,9 @@ import { Ecosystem } from '@moonbeam-network/xcm-types'; import { ConfigService } from '../ConfigService'; import { dev } from '../assets'; -import { equilibriumAlphanet, moonbaseAlpha } from '../chains'; -import { equilibriumAlphanetConfig } from '../configs/equilibriumAlphanet'; +import { moonbaseAlpha, pendulumAlphanet } from '../chains'; import { moonbaseAlphaConfig } from '../configs/moonbaseAlpha'; +import { pendulumAlphanetConfig } from '../configs/pendulumAlphanet'; import { ConfigBuilder } from './ConfigBuilder'; describe('configBuilder', () => { @@ -13,7 +13,7 @@ describe('configBuilder', () => { .assets(Ecosystem.AlphanetRelay) .asset(dev) .source(moonbaseAlpha) - .destination(equilibriumAlphanet) + .destination(pendulumAlphanet) .build(); expect(config).toStrictEqual({ @@ -22,12 +22,12 @@ describe('configBuilder', () => { chain: moonbaseAlpha, config: moonbaseAlphaConfig.getAssetDestinationConfig( dev, - equilibriumAlphanet, + pendulumAlphanet, ), }, destination: { - chain: equilibriumAlphanet, - config: equilibriumAlphanetConfig.getAssetDestinationConfig( + chain: pendulumAlphanet, + config: pendulumAlphanetConfig.getAssetDestinationConfig( dev, moonbaseAlpha, ), @@ -41,7 +41,7 @@ describe('configBuilder', () => { .assets(Ecosystem.AlphanetRelay) .asset(dev) .source(moonbaseAlpha) - .destination(equilibriumAlphanet) + .destination(pendulumAlphanet) .build(); expect(config).toStrictEqual({ @@ -50,12 +50,12 @@ describe('configBuilder', () => { chain: moonbaseAlpha, config: moonbaseAlphaConfig.getAssetDestinationConfig( dev, - equilibriumAlphanet, + pendulumAlphanet, ), }, destination: { - chain: equilibriumAlphanet, - config: equilibriumAlphanetConfig.getAssetDestinationConfig( + chain: pendulumAlphanet, + config: pendulumAlphanetConfig.getAssetDestinationConfig( dev, moonbaseAlpha, ), diff --git a/packages/config/src/ConfigService/ConfigService.test.ts b/packages/config/src/ConfigService/ConfigService.test.ts index fc3e88e1..55ca9ecc 100644 --- a/packages/config/src/ConfigService/ConfigService.test.ts +++ b/packages/config/src/ConfigService/ConfigService.test.ts @@ -9,12 +9,7 @@ import { Parachain, } from '@moonbeam-network/xcm-types'; import { assetsList, dev, glmr, tt1, unit } from '../assets'; -import { - equilibriumAlphanet, - hydraDX, - moonbaseAlpha, - moonbeam, -} from '../chains'; +import { hydraDX, moonbaseAlpha, moonbeam, pendulumAlphanet } from '../chains'; import { ConfigService } from './ConfigService'; import { AssetConfig } from '../types/AssetConfig'; @@ -123,7 +118,7 @@ describe('config service', () => { ); expect(chains).toStrictEqual( - expect.arrayContaining([moonbaseAlpha, equilibriumAlphanet]), + expect.arrayContaining([moonbaseAlpha, pendulumAlphanet]), ); }); }); diff --git a/packages/config/src/chains.ts b/packages/config/src/chains.ts index c23e606c..0b17c818 100644 --- a/packages/config/src/chains.ts +++ b/packages/config/src/chains.ts @@ -47,7 +47,6 @@ import { ring, rmrk, sdn, - soon, sub, teer, tt1, @@ -403,33 +402,6 @@ export const equilibrium = new Parachain({ ws: 'wss://node.pol.equilibrium.io', }); -export const equilibriumAlphanet = new Parachain({ - assetsData: [ - { - asset: dev, - decimals: 9, - id: 1_735_159_154, - }, - { - asset: eq, - id: 25_969, - }, - { - asset: eqd, - id: 6_648_164, - }, - ], - ecosystem: Ecosystem.AlphanetRelay, - genesisHash: - '0x0ba4508078664cfd04f00bf17892dd1a0764ce61d90857f76c6a2ea61f008247', - isTestChain: true, - key: 'equilibrium-alphanet', - name: 'EquilibriumAlphanet', - parachainId: 2011, - ss58Format: 68, - ws: 'wss://devnet.equilab.io/alphanet/collator/api/wss', -}); - export const hydraDX = new Parachain({ assetsData: [ { @@ -699,24 +671,16 @@ export const moonbaseAlpha = new EvmParachain({ asset: atom, id: '244316754493307480955066032215622931381', }, - { - asset: auq, - id: '69536036667157951501899290870203586130', - }, + // { + // asset: auq, + // id: '69536036667157951501899290870203586130', + // }, { asset: dev, id: '0x0000000000000000000000000000000000000802', metadataId: 0, min: 0.01, }, - { - asset: eq, - id: '190590555344745888270686124937537713878', - }, - { - asset: eqd, - id: '187224307232923873519830480073807488153', - }, { asset: lit, id: '65216491554813189869575508812319036608', @@ -733,10 +697,6 @@ export const moonbaseAlpha = new EvmParachain({ asset: pica, id: '22417088946346045371238623691600461855', }, - { - asset: soon, - id: '205153165378836428058230526014907639736', - }, { asset: tt1, id: '156305701417244550631956600137082963628', @@ -1455,7 +1415,6 @@ export const chainsList: AnyChain[] = [ darwiniaCrab, darwiniaPangoro, equilibrium, - equilibriumAlphanet, hydraDX, integritee, interlay, diff --git a/packages/config/src/configs/equilibriumAlphanet.ts b/packages/config/src/configs/equilibriumAlphanet.ts deleted file mode 100644 index bc453de0..00000000 --- a/packages/config/src/configs/equilibriumAlphanet.ts +++ /dev/null @@ -1,56 +0,0 @@ -import { - BalanceBuilder, - ExtrinsicBuilder, - FeeBuilder, -} from '@moonbeam-network/xcm-builder'; -import { dev, eq, eqd } from '../assets'; -import { equilibriumAlphanet, moonbaseAlpha } from '../chains'; -import { AssetConfig } from '../types/AssetConfig'; -import { ChainConfig } from '../types/ChainConfig'; - -export const equilibriumAlphanetConfig = new ChainConfig({ - assets: [ - new AssetConfig({ - asset: eq, - balance: BalanceBuilder().substrate().system().accountEquilibrium(), - destination: moonbaseAlpha, - destinationFee: { - amount: FeeBuilder().assetManager().assetTypeUnitsPerSecond(), - asset: eq, - balance: BalanceBuilder().substrate().system().accountEquilibrium(), - }, - extrinsic: ExtrinsicBuilder().eqBalances().transferXcm(), - }), - new AssetConfig({ - asset: eqd, - balance: BalanceBuilder().substrate().system().accountEquilibrium(), - destination: moonbaseAlpha, - destinationFee: { - amount: FeeBuilder().assetManager().assetTypeUnitsPerSecond(), - asset: eq, - balance: BalanceBuilder().substrate().system().accountEquilibrium(), - }, - extrinsic: ExtrinsicBuilder().eqBalances().transferXcm(), - fee: { - asset: eq, - balance: BalanceBuilder().substrate().system().accountEquilibrium(), - }, - }), - new AssetConfig({ - asset: dev, - balance: BalanceBuilder().substrate().system().accountEquilibrium(), - destination: moonbaseAlpha, - destinationFee: { - amount: 0.00005, - asset: dev, - balance: BalanceBuilder().substrate().system().accountEquilibrium(), - }, - extrinsic: ExtrinsicBuilder().eqBalances().transferXcm(), - fee: { - asset: eq, - balance: BalanceBuilder().substrate().system().accountEquilibrium(), - }, - }), - ], - chain: equilibriumAlphanet, -}); diff --git a/packages/config/src/configs/index.ts b/packages/config/src/configs/index.ts index 1a09e5d9..f42f0247 100644 --- a/packages/config/src/configs/index.ts +++ b/packages/config/src/configs/index.ts @@ -13,7 +13,6 @@ import { darwiniaConfig } from './darwinia'; import { darwiniaCrabConfig } from './darwiniaCrab'; import { darwiniaPangoroConfig } from './darwiniaPangoro'; import { equilibriumConfig } from './equilibrium'; -import { equilibriumAlphanetConfig } from './equilibriumAlphanet'; import { hydraDxConfig } from './hydraDX'; import { integriteeConfig } from './integritee'; import { interlayConfig } from './interlay'; @@ -61,7 +60,6 @@ export const chainsConfigList: ChainConfig[] = [ darwiniaConfig, darwiniaCrabConfig, darwiniaPangoroConfig, - equilibriumAlphanetConfig, equilibriumConfig, hydraDxConfig, integriteeConfig, diff --git a/packages/config/src/configs/moonbaseAlpha.ts b/packages/config/src/configs/moonbaseAlpha.ts index dea9b312..ceb95b63 100644 --- a/packages/config/src/configs/moonbaseAlpha.ts +++ b/packages/config/src/configs/moonbaseAlpha.ts @@ -4,8 +4,6 @@ import { ampe, atom, dev, - eq, - eqd, lit, otp, paring, @@ -18,7 +16,6 @@ import { alphanetAssetHub, alphanetRelay, darwiniaPangoro, - equilibriumAlphanet, litentryAlphanet, moonbaseAlpha, moonbaseBeta, @@ -32,17 +29,6 @@ import { ChainConfig } from '../types/ChainConfig'; export const moonbaseAlphaConfig = new ChainConfig({ assets: [ - new AssetConfig({ - asset: dev, - balance: BalanceBuilder().substrate().system().account(), - contract: ContractBuilder().Xtokens().transfer(), - destination: equilibriumAlphanet, - destinationFee: { - amount: 4, - asset: dev, - balance: BalanceBuilder().substrate().system().account(), - }, - }), new AssetConfig({ asset: dev, balance: BalanceBuilder().substrate().system().account(), @@ -132,36 +118,6 @@ export const moonbaseAlphaConfig = new ChainConfig({ balance: BalanceBuilder().substrate().system().account(), }, }), - new AssetConfig({ - asset: eq, - balance: BalanceBuilder().substrate().assets().account(), - contract: ContractBuilder().Xtokens().transfer(), - destination: equilibriumAlphanet, - destinationFee: { - amount: 14, - asset: eq, - balance: BalanceBuilder().substrate().assets().account(), - }, - fee: { - asset: dev, - balance: BalanceBuilder().substrate().system().account(), - }, - }), - new AssetConfig({ - asset: eqd, - balance: BalanceBuilder().substrate().assets().account(), - contract: ContractBuilder().Xtokens().transfer(), - destination: equilibriumAlphanet, - destinationFee: { - amount: 4, - asset: eqd, - balance: BalanceBuilder().substrate().assets().account(), - }, - fee: { - asset: dev, - balance: BalanceBuilder().substrate().system().account(), - }, - }), new AssetConfig({ asset: lit, balance: BalanceBuilder().substrate().assets().account(), diff --git a/packages/sdk/src/polkadot/PolkadotService.ts b/packages/sdk/src/polkadot/PolkadotService.ts index f61fef9b..ef634242 100644 --- a/packages/sdk/src/polkadot/PolkadotService.ts +++ b/packages/sdk/src/polkadot/PolkadotService.ts @@ -9,7 +9,6 @@ import { darwiniaPangoro, eq, equilibrium, - equilibriumAlphanet, paring, } from '@moonbeam-network/xcm-config'; import { @@ -74,10 +73,7 @@ export class PolkadotService { // TODO: Remove this once Equilibrium is updated // or find better way if issue appears on other chains - if ( - key === 'token' && - [equilibriumAlphanet.key, equilibrium.key].includes(this.chain.key) - ) { + if (key === 'token' && [equilibrium.key].includes(this.chain.key)) { return eq; }