Skip to content

Commit

Permalink
Remove equilibrium alphanet config (#182)
Browse files Browse the repository at this point in the history
* remove equilibrium alphanet config

* remove unused assets from moonbase alpha

* add changeset
  • Loading branch information
mmaurello authored Jan 16, 2024
1 parent 8635450 commit 6beaf73
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 169 deletions.
6 changes: 6 additions & 0 deletions .changeset/fuzzy-cherries-dress.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@moonbeam-network/xcm-config': patch
'@moonbeam-network/xcm-sdk': patch
---

Remove equilibrium alphanet config
20 changes: 10 additions & 10 deletions packages/config/src/ConfigBuilder/ConfigBuilder.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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', () => {
Expand All @@ -13,7 +13,7 @@ describe('configBuilder', () => {
.assets(Ecosystem.AlphanetRelay)
.asset(dev)
.source(moonbaseAlpha)
.destination(equilibriumAlphanet)
.destination(pendulumAlphanet)
.build();

expect(config).toStrictEqual({
Expand All @@ -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,
),
Expand All @@ -41,7 +41,7 @@ describe('configBuilder', () => {
.assets(Ecosystem.AlphanetRelay)
.asset(dev)
.source(moonbaseAlpha)
.destination(equilibriumAlphanet)
.destination(pendulumAlphanet)
.build();

expect(config).toStrictEqual({
Expand All @@ -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,
),
Expand Down
9 changes: 2 additions & 7 deletions packages/config/src/ConfigService/ConfigService.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -123,7 +118,7 @@ describe('config service', () => {
);

expect(chains).toStrictEqual(
expect.arrayContaining([moonbaseAlpha, equilibriumAlphanet]),
expect.arrayContaining([moonbaseAlpha, pendulumAlphanet]),
);
});
});
Expand Down
49 changes: 4 additions & 45 deletions packages/config/src/chains.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ import {
ring,
rmrk,
sdn,
soon,
sub,
teer,
tt1,
Expand Down Expand Up @@ -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: [
{
Expand Down Expand Up @@ -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',
Expand All @@ -733,10 +697,6 @@ export const moonbaseAlpha = new EvmParachain({
asset: pica,
id: '22417088946346045371238623691600461855',
},
{
asset: soon,
id: '205153165378836428058230526014907639736',
},
{
asset: tt1,
id: '156305701417244550631956600137082963628',
Expand Down Expand Up @@ -1455,7 +1415,6 @@ export const chainsList: AnyChain[] = [
darwiniaCrab,
darwiniaPangoro,
equilibrium,
equilibriumAlphanet,
hydraDX,
integritee,
interlay,
Expand Down
56 changes: 0 additions & 56 deletions packages/config/src/configs/equilibriumAlphanet.ts

This file was deleted.

2 changes: 0 additions & 2 deletions packages/config/src/configs/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -61,7 +60,6 @@ export const chainsConfigList: ChainConfig[] = [
darwiniaConfig,
darwiniaCrabConfig,
darwiniaPangoroConfig,
equilibriumAlphanetConfig,
equilibriumConfig,
hydraDxConfig,
integriteeConfig,
Expand Down
44 changes: 0 additions & 44 deletions packages/config/src/configs/moonbaseAlpha.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ import {
ampe,
atom,
dev,
eq,
eqd,
lit,
otp,
paring,
Expand All @@ -18,7 +16,6 @@ import {
alphanetAssetHub,
alphanetRelay,
darwiniaPangoro,
equilibriumAlphanet,
litentryAlphanet,
moonbaseAlpha,
moonbaseBeta,
Expand All @@ -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(),
Expand Down Expand Up @@ -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(),
Expand Down
6 changes: 1 addition & 5 deletions packages/sdk/src/polkadot/PolkadotService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import {
darwiniaPangoro,
eq,
equilibrium,
equilibriumAlphanet,
paring,
} from '@moonbeam-network/xcm-config';
import {
Expand Down Expand Up @@ -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;
}

Expand Down

0 comments on commit 6beaf73

Please sign in to comment.