From 16b5a1e5d7f0efce74c02c837642b93959279ba1 Mon Sep 17 00:00:00 2001 From: Rikkard29 Date: Tue, 3 Oct 2023 19:29:48 +0200 Subject: [PATCH] Remove obsolete tests --- src/nodes/supported/Crust.test.ts | 34 ------------------ src/nodes/supported/Efinity.test.ts | 33 ------------------ src/nodes/supported/Equilibrium.test.ts | 46 ------------------------- src/nodes/supported/Turing.test.ts | 34 ------------------ src/nodes/supported/Unique.test.ts | 33 ------------------ 5 files changed, 180 deletions(-) delete mode 100644 src/nodes/supported/Crust.test.ts delete mode 100644 src/nodes/supported/Efinity.test.ts delete mode 100644 src/nodes/supported/Equilibrium.test.ts delete mode 100644 src/nodes/supported/Turing.test.ts delete mode 100644 src/nodes/supported/Unique.test.ts diff --git a/src/nodes/supported/Crust.test.ts b/src/nodes/supported/Crust.test.ts deleted file mode 100644 index 62d387f3..00000000 --- a/src/nodes/supported/Crust.test.ts +++ /dev/null @@ -1,34 +0,0 @@ -// Contains test scenario for Parachain to Parachain transfer on Crust - -import { describe, it, vi, expect } from 'vitest' -import { TScenario, Version, XTokensTransferInput } from '../..' -import { createApiInstance, getFees, handleAddress } from '../../utils' -import XTokensTransferImpl from '../XTokensTransferImpl' -import Crust from './Crust' - -describe('Crust', () => { - it('transferXTokens - ParaToPara', async () => { - const api = await createApiInstance('wss://crust-parachain.crustapps.net') - const crust = new Crust() - const currency = 'CRU' - const currencyID = undefined - const paraId = 2006 - const amount = 1000 - const scenario: TScenario = 'ParaToPara' - const fees = getFees(scenario) - const addressSelection = handleAddress(scenario, 'polkadotXCM', api, '', Version.V1, paraId) - const input: XTokensTransferInput = { - api: undefined as any, - currency, - currencyID, - amount, - addressSelection, - fees - } - const transferSpy = vi.spyOn(XTokensTransferImpl, 'transferXTokens').mockImplementation(() => { - return undefined as any - }) - await crust.transferXTokens(input) - expect(transferSpy).toHaveBeenCalledWith(input, 'SelfReserve', fees) - }) -}) diff --git a/src/nodes/supported/Efinity.test.ts b/src/nodes/supported/Efinity.test.ts deleted file mode 100644 index b1f29288..00000000 --- a/src/nodes/supported/Efinity.test.ts +++ /dev/null @@ -1,33 +0,0 @@ -// Contains test scenario for Parachain to Parachain transfer on Efinity - -import { describe, it, vi, expect } from 'vitest' -import { TScenario, Version, XTokensTransferInput } from '../..' -import { createApiInstance, handleAddress } from '../../utils' -import XTokensTransferImpl from '../XTokensTransferImpl' -import Efinity from './Efinity' - -describe('Efinity', () => { - it('transferXTokens - ParaToPara', async () => { - const api = await createApiInstance('wss://rpc.efinity.io') - const efinity = new Efinity() - const currency = 'DOT' - const currencyID = undefined - const paraId = 2006 - const amount = 1000 - const scenario: TScenario = 'ParaToPara' - const addressSelection = handleAddress(scenario, 'polkadotXCM', api, '', Version.V3, paraId) - const input: XTokensTransferInput = { - api: undefined as any, - currency, - currencyID, - amount, - addressSelection, - fees: 0 - } - const transferSpy = vi.spyOn(XTokensTransferImpl, 'transferXTokens').mockImplementation(() => { - return undefined as any - }) - await efinity.transferXTokens(input) - expect(transferSpy).toHaveBeenCalledWith(input, { currencyId: [0, currencyID] }) - }) -}) diff --git a/src/nodes/supported/Equilibrium.test.ts b/src/nodes/supported/Equilibrium.test.ts deleted file mode 100644 index 49a8d4f3..00000000 --- a/src/nodes/supported/Equilibrium.test.ts +++ /dev/null @@ -1,46 +0,0 @@ -// Contains test scenario for Parachain to Relay chain transfer on Equilibrium - -import { describe, it, vi, expect } from 'vitest' -import { PolkadotXCMTransferInput, TScenario, Version } from '../..' -import { - createApiInstance, - createCurrencySpecification, - createHeaderPolkadotXCM, - handleAddress -} from '../../utils' -import PolkadotXCMTransferImpl from '../PolkadotXCMTransferImpl' -import Equilibrium from './Equilibrium' - -describe('Equilibrium', () => { - it('transferPolkadotXCM - ParaToRelay', async () => { - const api = await createApiInstance('wss://node.pol.equilibrium.io/') - const equilibrium = new Equilibrium() - const currency = 'DOT' - const paraId = 2006 - const amount = 1000 - const scenario: TScenario = 'ParaToRelay' - const addressSelection = handleAddress(scenario, 'polkadotXCM', api, '', Version.V1, paraId) - const header = createHeaderPolkadotXCM(scenario, Version.V1, paraId) - const currencySelection = createCurrencySpecification( - amount, - scenario, - Version.V1, - equilibrium.node, - currency - ) - const input: PolkadotXCMTransferInput = { - api: undefined as any, - header, - addressSelection, - currencySelection, - scenario - } - const transferSpy = vi - .spyOn(PolkadotXCMTransferImpl, 'transferPolkadotXCM') - .mockImplementation(() => { - return undefined as any - }) - await equilibrium.transferPolkadotXCM(input) - expect(transferSpy).toHaveBeenCalledWith(input, 'reserveTransferAssets') - }) -}) diff --git a/src/nodes/supported/Turing.test.ts b/src/nodes/supported/Turing.test.ts deleted file mode 100644 index d8b36621..00000000 --- a/src/nodes/supported/Turing.test.ts +++ /dev/null @@ -1,34 +0,0 @@ -// Contains test scenario for Parachain to Parachain transfer on Turing - -import { describe, it, vi, expect } from 'vitest' -import { TScenario, Version, XTokensTransferInput } from '../..' -import { createApiInstance, handleAddress } from '../../utils' -import XTokensTransferImpl from '../XTokensTransferImpl' -import Turing from './Turing' - -describe('Turing', () => { - it('transferXTokens - ParaToPara', async () => { - const api = await createApiInstance('wss://turing-rpc.dwellir.com') - const turing = new Turing() - const fees = 0 - const currency = 'KSM' - const currencyID = undefined - const paraId = 2006 - const amount = 1000 - const scenario: TScenario = 'ParaToPara' - const addressSelection = handleAddress(scenario, 'polkadotXCM', api, '', Version.V3, paraId) - const input: XTokensTransferInput = { - api: undefined as any, - currency, - currencyID, - amount, - addressSelection, - fees: 0 - } - const transferSpy = vi.spyOn(XTokensTransferImpl, 'transferXTokens').mockImplementation(() => { - return undefined as any - }) - await turing.transferXTokens(input) - expect(transferSpy).toHaveBeenCalledWith(input, undefined) - }) -}) diff --git a/src/nodes/supported/Unique.test.ts b/src/nodes/supported/Unique.test.ts deleted file mode 100644 index f9b62a1e..00000000 --- a/src/nodes/supported/Unique.test.ts +++ /dev/null @@ -1,33 +0,0 @@ -// Contains test scenario for Parachain to Parachain transfer on Unique - -import { describe, it, vi, expect } from 'vitest' -import { TScenario, Version, XTokensTransferInput } from '../..' -import { createApiInstance, handleAddress } from '../../utils' -import XTokensTransferImpl from '../XTokensTransferImpl' -import Unique from './Unique' - -describe('Unique', () => { - it('transferXTokens - ParaToPara', async () => { - const api = await createApiInstance('wss://unique.api.onfinality.io/public-ws') - const unique = new Unique() - const currency = 'DOT' - const currencyID = 1 - const paraId = 2006 - const amount = 1000 - const scenario: TScenario = 'ParaToPara' - const addressSelection = handleAddress(scenario, 'polkadotXCM', api, '', Version.V3, paraId) - const input: XTokensTransferInput = { - api: undefined as any, - currency, - currencyID, - amount, - addressSelection, - fees: 0 - } - const transferSpy = vi.spyOn(XTokensTransferImpl, 'transferXTokens').mockImplementation(() => { - return undefined as any - }) - await unique.transferXTokens(input) - expect(transferSpy).toHaveBeenCalledWith(input, { ForeignAssetId: currencyID }) - }) -})