difftreelog
fix use config for xcm urls
in: master
4 files changed
tests/src/config.tsdiffbeforeafterboth--- a/tests/src/config.ts
+++ b/tests/src/config.ts
@@ -19,6 +19,12 @@
const config = {
substrateUrl: process.env.substrateUrl || 'ws://127.0.0.1:9944',
frontierUrl: process.env.frontierUrl || 'http://127.0.0.1:9933',
+ relayUrl: process.env.relayUrl || 'ws://127.0.0.1:9844',
+ acalaUrl: process.env.acalaUrl || 'ws://127.0.0.1:9946',
+ karuraUrl: process.env.acalaUrl || 'ws://127.0.0.1:9946',
+ moonbeamUrl: process.env.moonbeamUrl || 'ws://127.0.0.1:9947',
+ moonriverUrl: process.env.moonbeamUrl || 'ws://127.0.0.1:9947',
+ westmintUrl: process.env.westmintUrl || 'ws://127.0.0.1:9948',
};
-export default config;
\ No newline at end of file
+export default config;
tests/src/xcm/xcmOpal.test.tsdiffbeforeafterboth1// Copyright 2019-2022 Unique Network (Gibraltar) Ltd.2// This file is part of Unique Network.34// Unique Network is free software: you can redistribute it and/or modify5// it under the terms of the GNU General Public License as published by6// the Free Software Foundation, either version 3 of the License, or7// (at your option) any later version.89// Unique Network is distributed in the hope that it will be useful,10// but WITHOUT ANY WARRANTY; without even the implied warranty of11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the12// GNU General Public License for more details.1314// You should have received a copy of the GNU General Public License15// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.1617import {IKeyringPair} from '@polkadot/types/types';18import {itSub, expect, describeXcm, usingPlaygrounds, usingWestmintPlaygrounds, usingRelayPlaygrounds} from '../util/playgrounds';1920const STATEMINE_CHAIN = 1000;21const UNIQUE_CHAIN = 2095;2223const RELAY_PORT = '9844';24const STATEMINE_PORT = '9948';2526const relayUrl = 'ws://127.0.0.1:' + RELAY_PORT;27const statemineUrl = 'ws://127.0.0.1:' + STATEMINE_PORT;2829const STATEMINE_PALLET_INSTANCE = 50;30const ASSET_ID = 100;31const ASSET_METADATA_DECIMALS = 18;32const ASSET_METADATA_NAME = 'USDT';33const ASSET_METADATA_DESCRIPTION = 'USDT';34const ASSET_METADATA_MINIMAL_BALANCE = 1n;3536const WESTMINT_DECIMALS = 12;3738const TRANSFER_AMOUNT = 1_000_000_000_000_000_000n;3940// 10,000.00 (ten thousands) USDT41const ASSET_AMOUNT = 1_000_000_000_000_000_000_000n; 4243describeXcm('[XCM] Integration test: Exchanging USDT with Westmint', () => {44 let alice: IKeyringPair;45 let bob: IKeyringPair;46 47 let balanceStmnBefore: bigint;48 let balanceStmnAfter: bigint;4950 let balanceOpalBefore: bigint;51 let balanceOpalAfter: bigint;52 let balanceOpalFinal: bigint;5354 let balanceBobBefore: bigint;55 let balanceBobAfter: bigint;56 let balanceBobFinal: bigint;5758 let balanceBobRelayTokenBefore: bigint;59 let balanceBobRelayTokenAfter: bigint;606162 before(async () => {63 await usingPlaygrounds(async (_helper, privateKey) => {64 alice = privateKey('//Alice');65 bob = privateKey('//Bob'); // funds donor66 });6768 await usingWestmintPlaygrounds(statemineUrl, async (helper) => {69 // 350.00 (three hundred fifty) DOT70 const fundingAmount = 3_500_000_000_000n; 7172 await helper.assets.create(alice, ASSET_ID, alice.address, ASSET_METADATA_MINIMAL_BALANCE);73 await helper.assets.setMetadata(alice, ASSET_ID, ASSET_METADATA_NAME, ASSET_METADATA_DESCRIPTION, ASSET_METADATA_DECIMALS);74 await helper.assets.mint(alice, ASSET_ID, alice.address, ASSET_AMOUNT);7576 // funding parachain sovereing account (Parachain: 2095)77 const parachainSovereingAccount = helper.address.paraSiblingSovereignAccount(UNIQUE_CHAIN);78 await helper.balance.transferToSubstrate(bob, parachainSovereingAccount, fundingAmount);79 });808182 await usingPlaygrounds(async (helper) => {83 const location = {84 V1: {85 parents: 1,86 interior: {X3: [87 {88 Parachain: STATEMINE_CHAIN,89 },90 {91 PalletInstance: STATEMINE_PALLET_INSTANCE,92 },93 {94 GeneralIndex: ASSET_ID,95 },96 ]},97 },98 };99100 const metadata =101 {102 name: ASSET_ID,103 symbol: ASSET_METADATA_NAME,104 decimals: ASSET_METADATA_DECIMALS,105 minimalBalance: ASSET_METADATA_MINIMAL_BALANCE,106 };107 await helper.getSudo().foreignAssets.register(alice, alice.address, location, metadata);108 balanceOpalBefore = await helper.balance.getSubstrate(alice.address);109 });110111112 // Providing the relay currency to the unique sender account113 await usingRelayPlaygrounds(relayUrl, async (helper) => {114 const destination = {115 V1: {116 parents: 0,117 interior: {X1: {118 Parachain: UNIQUE_CHAIN,119 },120 },121 }};122123 const beneficiary = {124 V1: {125 parents: 0,126 interior: {X1: {127 AccountId32: {128 network: 'Any',129 id: alice.addressRaw,130 },131 }},132 },133 };134135 const assets = {136 V1: [137 {138 id: {139 Concrete: {140 parents: 0,141 interior: 'Here',142 },143 },144 fun: {145 Fungible: 50_000_000_000_000_000n,146 },147 },148 ],149 };150151 const feeAssetItem = 0;152 const weightLimit = 5_000_000_000;153154 await helper.xcm.limitedReserveTransferAssets(alice, destination, beneficiary, assets, feeAssetItem, weightLimit);155 });156 157 });158159 itSub('Should connect and send USDT from Westmint to Opal', async ({helper}) => {160 await usingWestmintPlaygrounds(statemineUrl, async (helper) => {161 const dest = {162 V1: {163 parents: 1,164 interior: {X1: {165 Parachain: UNIQUE_CHAIN,166 },167 },168 }};169170 const beneficiary = {171 V1: {172 parents: 0,173 interior: {X1: {174 AccountId32: {175 network: 'Any',176 id: alice.addressRaw,177 },178 }},179 },180 };181182 const assets = {183 V1: [184 {185 id: {186 Concrete: {187 parents: 0,188 interior: {189 X2: [190 {191 PalletInstance: STATEMINE_PALLET_INSTANCE,192 },193 {194 GeneralIndex: ASSET_ID,195 }, 196 ]},197 },198 },199 fun: {200 Fungible: TRANSFER_AMOUNT,201 },202 },203 ],204 };205206 const feeAssetItem = 0;207 const weightLimit = 5000000000;208209 balanceStmnBefore = await helper.balance.getSubstrate(alice.address);210 await helper.xcm.limitedReserveTransferAssets(alice, dest, beneficiary, assets, feeAssetItem, weightLimit);211212 balanceStmnAfter = await helper.balance.getSubstrate(alice.address);213214 // common good parachain take commission in it native token215 console.log(216 'Opal to Westmint transaction fees on Westmint: %s WND',217 helper.util.bigIntToDecimals(balanceStmnBefore - balanceStmnAfter, WESTMINT_DECIMALS),218 );219 expect(balanceStmnBefore > balanceStmnAfter).to.be.true;220221 });222223224 // ensure that asset has been delivered225 await helper.wait.newBlocks(3);226227 // expext collection id will be with id 1228 const free = await helper.ft.getBalance(1, {Substrate: alice.address});229230 balanceOpalAfter = await helper.balance.getSubstrate(alice.address);231232 // commission has not paid in USDT token233 expect(free == TRANSFER_AMOUNT).to.be.true;234 console.log(235 'Opal to Westmint transaction fees on Opal: %s USDT',236 helper.util.bigIntToDecimals(TRANSFER_AMOUNT - free),237 );238 // ... and parachain native token239 expect(balanceOpalAfter == balanceOpalBefore).to.be.true;240 console.log(241 'Opal to Westmint transaction fees on Opal: %s WND',242 helper.util.bigIntToDecimals(balanceOpalAfter - balanceOpalBefore, WESTMINT_DECIMALS),243 ); 244 });245246 itSub('Should connect and send USDT from Unique to Statemine back', async ({helper}) => {247 const destination = {248 V1: {249 parents: 1,250 interior: {X2: [251 {252 Parachain: STATEMINE_CHAIN,253 },254 {255 AccountId32: {256 network: 'Any',257 id: alice.addressRaw,258 },259 },260 ]},261 },262 };263264 const currencies: [any, bigint][] = [265 [266 {267 ForeignAssetId: 0,268 },269 //10_000_000_000_000_000n,270 TRANSFER_AMOUNT,271 ], 272 [273 {274 NativeAssetId: 'Parent',275 },276 400_000_000_000_000n,277 ],278 ];279280 const feeItem = 1;281 const destWeight = 500000000000;282283 await helper.xTokens.transferMulticurrencies(alice, currencies, feeItem, destination, destWeight);284 285 // the commission has been paid in parachain native token286 balanceOpalFinal = await helper.balance.getSubstrate(alice.address);287 expect(balanceOpalAfter > balanceOpalFinal).to.be.true;288289 await usingWestmintPlaygrounds(statemineUrl, async (helper) => {290 await helper.wait.newBlocks(3);291 292 // The USDT token never paid fees. Its amount not changed from begin value.293 // Also check that xcm transfer has been succeeded 294 expect((await helper.assets.account(ASSET_ID, alice.address))! == ASSET_AMOUNT).to.be.true;295 });296 });297298 itSub('Should connect and send Relay token to Unique', async ({helper}) => {299 const TRANSFER_AMOUNT_RELAY = 50_000_000_000_000_000n;300301 balanceBobBefore = await helper.balance.getSubstrate(bob.address);302 balanceBobRelayTokenBefore = await helper.tokens.accounts(bob.address, {NativeAssetId: 'Parent'});303304 // Providing the relay currency to the unique sender account305 await usingRelayPlaygrounds(relayUrl, async (helper) => {306 const destination = {307 V1: {308 parents: 0,309 interior: {X1: {310 Parachain: UNIQUE_CHAIN,311 },312 },313 }};314315 const beneficiary = {316 V1: {317 parents: 0,318 interior: {X1: {319 AccountId32: {320 network: 'Any',321 id: bob.addressRaw,322 },323 }},324 },325 };326327 const assets = {328 V1: [329 {330 id: {331 Concrete: {332 parents: 0,333 interior: 'Here',334 },335 },336 fun: {337 Fungible: TRANSFER_AMOUNT_RELAY,338 },339 },340 ],341 };342343 const feeAssetItem = 0;344 const weightLimit = 5_000_000_000;345346 await helper.xcm.limitedReserveTransferAssets(bob, destination, beneficiary, assets, feeAssetItem, weightLimit);347 });348 349 await helper.wait.newBlocks(3);350351 balanceBobAfter = await helper.balance.getSubstrate(bob.address); 352 balanceBobRelayTokenAfter = await helper.tokens.accounts(bob.address, {NativeAssetId: 'Parent'});353354 const wndFee = balanceBobRelayTokenAfter - TRANSFER_AMOUNT_RELAY - balanceBobRelayTokenBefore; 355 console.log(356 'Relay (Westend) to Opal transaction fees: %s OPL',357 helper.util.bigIntToDecimals(balanceBobAfter - balanceBobBefore),358 );359 console.log(360 'Relay (Westend) to Opal transaction fees: %s WND',361 helper.util.bigIntToDecimals(wndFee, WESTMINT_DECIMALS),362 );363 expect(balanceBobBefore == balanceBobAfter).to.be.true;364 expect(balanceBobRelayTokenBefore < balanceBobRelayTokenAfter).to.be.true;365 });366367 itSub('Should connect and send Relay token back', async ({helper}) => {368 const destination = {369 V1: {370 parents: 1,371 interior: {X2: [372 {373 Parachain: STATEMINE_CHAIN,374 },375 {376 AccountId32: {377 network: 'Any',378 id: bob.addressRaw,379 },380 },381 ]},382 },383 };384385 const currencies: any = [386 [387 {388 NativeAssetId: 'Parent',389 },390 50_000_000_000_000_000n,391 ],392 ];393394 const feeItem = 0;395 const destWeight = 500000000000;396397 await helper.xTokens.transferMulticurrencies(bob, currencies, feeItem, destination, destWeight);398399 balanceBobFinal = await helper.balance.getSubstrate(bob.address);400 console.log('Relay (Westend) to Opal transaction fees: %s OPL', balanceBobAfter - balanceBobFinal);401 });402});1// Copyright 2019-2022 Unique Network (Gibraltar) Ltd.2// This file is part of Unique Network.34// Unique Network is free software: you can redistribute it and/or modify5// it under the terms of the GNU General Public License as published by6// the Free Software Foundation, either version 3 of the License, or7// (at your option) any later version.89// Unique Network is distributed in the hope that it will be useful,10// but WITHOUT ANY WARRANTY; without even the implied warranty of11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the12// GNU General Public License for more details.1314// You should have received a copy of the GNU General Public License15// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.1617import {IKeyringPair} from '@polkadot/types/types';18import config from '../config';19import {itSub, expect, describeXcm, usingPlaygrounds, usingWestmintPlaygrounds, usingRelayPlaygrounds} from '../util/playgrounds';2021const STATEMINE_CHAIN = 1000;22const UNIQUE_CHAIN = 2095;2324const relayUrl = config.relayUrl;25const westmintUrl = config.westmintUrl;2627const STATEMINE_PALLET_INSTANCE = 50;28const ASSET_ID = 100;29const ASSET_METADATA_DECIMALS = 18;30const ASSET_METADATA_NAME = 'USDT';31const ASSET_METADATA_DESCRIPTION = 'USDT';32const ASSET_METADATA_MINIMAL_BALANCE = 1n;3334const WESTMINT_DECIMALS = 12;3536const TRANSFER_AMOUNT = 1_000_000_000_000_000_000n;3738// 10,000.00 (ten thousands) USDT39const ASSET_AMOUNT = 1_000_000_000_000_000_000_000n; 4041describeXcm('[XCM] Integration test: Exchanging USDT with Westmint', () => {42 let alice: IKeyringPair;43 let bob: IKeyringPair;44 45 let balanceStmnBefore: bigint;46 let balanceStmnAfter: bigint;4748 let balanceOpalBefore: bigint;49 let balanceOpalAfter: bigint;50 let balanceOpalFinal: bigint;5152 let balanceBobBefore: bigint;53 let balanceBobAfter: bigint;54 let balanceBobFinal: bigint;5556 let balanceBobRelayTokenBefore: bigint;57 let balanceBobRelayTokenAfter: bigint;585960 before(async () => {61 await usingPlaygrounds(async (_helper, privateKey) => {62 alice = privateKey('//Alice');63 bob = privateKey('//Bob'); // funds donor64 });6566 await usingWestmintPlaygrounds(westmintUrl, async (helper) => {67 // 350.00 (three hundred fifty) DOT68 const fundingAmount = 3_500_000_000_000n; 6970 await helper.assets.create(alice, ASSET_ID, alice.address, ASSET_METADATA_MINIMAL_BALANCE);71 await helper.assets.setMetadata(alice, ASSET_ID, ASSET_METADATA_NAME, ASSET_METADATA_DESCRIPTION, ASSET_METADATA_DECIMALS);72 await helper.assets.mint(alice, ASSET_ID, alice.address, ASSET_AMOUNT);7374 // funding parachain sovereing account (Parachain: 2095)75 const parachainSovereingAccount = helper.address.paraSiblingSovereignAccount(UNIQUE_CHAIN);76 await helper.balance.transferToSubstrate(bob, parachainSovereingAccount, fundingAmount);77 });787980 await usingPlaygrounds(async (helper) => {81 const location = {82 V1: {83 parents: 1,84 interior: {X3: [85 {86 Parachain: STATEMINE_CHAIN,87 },88 {89 PalletInstance: STATEMINE_PALLET_INSTANCE,90 },91 {92 GeneralIndex: ASSET_ID,93 },94 ]},95 },96 };9798 const metadata =99 {100 name: ASSET_ID,101 symbol: ASSET_METADATA_NAME,102 decimals: ASSET_METADATA_DECIMALS,103 minimalBalance: ASSET_METADATA_MINIMAL_BALANCE,104 };105 await helper.getSudo().foreignAssets.register(alice, alice.address, location, metadata);106 balanceOpalBefore = await helper.balance.getSubstrate(alice.address);107 });108109110 // Providing the relay currency to the unique sender account111 await usingRelayPlaygrounds(relayUrl, async (helper) => {112 const destination = {113 V1: {114 parents: 0,115 interior: {X1: {116 Parachain: UNIQUE_CHAIN,117 },118 },119 }};120121 const beneficiary = {122 V1: {123 parents: 0,124 interior: {X1: {125 AccountId32: {126 network: 'Any',127 id: alice.addressRaw,128 },129 }},130 },131 };132133 const assets = {134 V1: [135 {136 id: {137 Concrete: {138 parents: 0,139 interior: 'Here',140 },141 },142 fun: {143 Fungible: 50_000_000_000_000_000n,144 },145 },146 ],147 };148149 const feeAssetItem = 0;150 const weightLimit = 5_000_000_000;151152 await helper.xcm.limitedReserveTransferAssets(alice, destination, beneficiary, assets, feeAssetItem, weightLimit);153 });154 155 });156157 itSub('Should connect and send USDT from Westmint to Opal', async ({helper}) => {158 await usingWestmintPlaygrounds(westmintUrl, async (helper) => {159 const dest = {160 V1: {161 parents: 1,162 interior: {X1: {163 Parachain: UNIQUE_CHAIN,164 },165 },166 }};167168 const beneficiary = {169 V1: {170 parents: 0,171 interior: {X1: {172 AccountId32: {173 network: 'Any',174 id: alice.addressRaw,175 },176 }},177 },178 };179180 const assets = {181 V1: [182 {183 id: {184 Concrete: {185 parents: 0,186 interior: {187 X2: [188 {189 PalletInstance: STATEMINE_PALLET_INSTANCE,190 },191 {192 GeneralIndex: ASSET_ID,193 }, 194 ]},195 },196 },197 fun: {198 Fungible: TRANSFER_AMOUNT,199 },200 },201 ],202 };203204 const feeAssetItem = 0;205 const weightLimit = 5000000000;206207 balanceStmnBefore = await helper.balance.getSubstrate(alice.address);208 await helper.xcm.limitedReserveTransferAssets(alice, dest, beneficiary, assets, feeAssetItem, weightLimit);209210 balanceStmnAfter = await helper.balance.getSubstrate(alice.address);211212 // common good parachain take commission in it native token213 console.log(214 'Opal to Westmint transaction fees on Westmint: %s WND',215 helper.util.bigIntToDecimals(balanceStmnBefore - balanceStmnAfter, WESTMINT_DECIMALS),216 );217 expect(balanceStmnBefore > balanceStmnAfter).to.be.true;218219 });220221222 // ensure that asset has been delivered223 await helper.wait.newBlocks(3);224225 // expext collection id will be with id 1226 const free = await helper.ft.getBalance(1, {Substrate: alice.address});227228 balanceOpalAfter = await helper.balance.getSubstrate(alice.address);229230 // commission has not paid in USDT token231 expect(free == TRANSFER_AMOUNT).to.be.true;232 console.log(233 'Opal to Westmint transaction fees on Opal: %s USDT',234 helper.util.bigIntToDecimals(TRANSFER_AMOUNT - free),235 );236 // ... and parachain native token237 expect(balanceOpalAfter == balanceOpalBefore).to.be.true;238 console.log(239 'Opal to Westmint transaction fees on Opal: %s WND',240 helper.util.bigIntToDecimals(balanceOpalAfter - balanceOpalBefore, WESTMINT_DECIMALS),241 ); 242 });243244 itSub('Should connect and send USDT from Unique to Statemine back', async ({helper}) => {245 const destination = {246 V1: {247 parents: 1,248 interior: {X2: [249 {250 Parachain: STATEMINE_CHAIN,251 },252 {253 AccountId32: {254 network: 'Any',255 id: alice.addressRaw,256 },257 },258 ]},259 },260 };261262 const currencies: [any, bigint][] = [263 [264 {265 ForeignAssetId: 0,266 },267 //10_000_000_000_000_000n,268 TRANSFER_AMOUNT,269 ], 270 [271 {272 NativeAssetId: 'Parent',273 },274 400_000_000_000_000n,275 ],276 ];277278 const feeItem = 1;279 const destWeight = 500000000000;280281 await helper.xTokens.transferMulticurrencies(alice, currencies, feeItem, destination, destWeight);282 283 // the commission has been paid in parachain native token284 balanceOpalFinal = await helper.balance.getSubstrate(alice.address);285 expect(balanceOpalAfter > balanceOpalFinal).to.be.true;286287 await usingWestmintPlaygrounds(westmintUrl, async (helper) => {288 await helper.wait.newBlocks(3);289 290 // The USDT token never paid fees. Its amount not changed from begin value.291 // Also check that xcm transfer has been succeeded 292 expect((await helper.assets.account(ASSET_ID, alice.address))! == ASSET_AMOUNT).to.be.true;293 });294 });295296 itSub('Should connect and send Relay token to Unique', async ({helper}) => {297 const TRANSFER_AMOUNT_RELAY = 50_000_000_000_000_000n;298299 balanceBobBefore = await helper.balance.getSubstrate(bob.address);300 balanceBobRelayTokenBefore = await helper.tokens.accounts(bob.address, {NativeAssetId: 'Parent'});301302 // Providing the relay currency to the unique sender account303 await usingRelayPlaygrounds(relayUrl, async (helper) => {304 const destination = {305 V1: {306 parents: 0,307 interior: {X1: {308 Parachain: UNIQUE_CHAIN,309 },310 },311 }};312313 const beneficiary = {314 V1: {315 parents: 0,316 interior: {X1: {317 AccountId32: {318 network: 'Any',319 id: bob.addressRaw,320 },321 }},322 },323 };324325 const assets = {326 V1: [327 {328 id: {329 Concrete: {330 parents: 0,331 interior: 'Here',332 },333 },334 fun: {335 Fungible: TRANSFER_AMOUNT_RELAY,336 },337 },338 ],339 };340341 const feeAssetItem = 0;342 const weightLimit = 5_000_000_000;343344 await helper.xcm.limitedReserveTransferAssets(bob, destination, beneficiary, assets, feeAssetItem, weightLimit);345 });346 347 await helper.wait.newBlocks(3);348349 balanceBobAfter = await helper.balance.getSubstrate(bob.address); 350 balanceBobRelayTokenAfter = await helper.tokens.accounts(bob.address, {NativeAssetId: 'Parent'});351352 const wndFee = balanceBobRelayTokenAfter - TRANSFER_AMOUNT_RELAY - balanceBobRelayTokenBefore; 353 console.log(354 'Relay (Westend) to Opal transaction fees: %s OPL',355 helper.util.bigIntToDecimals(balanceBobAfter - balanceBobBefore),356 );357 console.log(358 'Relay (Westend) to Opal transaction fees: %s WND',359 helper.util.bigIntToDecimals(wndFee, WESTMINT_DECIMALS),360 );361 expect(balanceBobBefore == balanceBobAfter).to.be.true;362 expect(balanceBobRelayTokenBefore < balanceBobRelayTokenAfter).to.be.true;363 });364365 itSub('Should connect and send Relay token back', async ({helper}) => {366 const destination = {367 V1: {368 parents: 1,369 interior: {X2: [370 {371 Parachain: STATEMINE_CHAIN,372 },373 {374 AccountId32: {375 network: 'Any',376 id: bob.addressRaw,377 },378 },379 ]},380 },381 };382383 const currencies: any = [384 [385 {386 NativeAssetId: 'Parent',387 },388 50_000_000_000_000_000n,389 ],390 ];391392 const feeItem = 0;393 const destWeight = 500000000000;394395 await helper.xTokens.transferMulticurrencies(bob, currencies, feeItem, destination, destWeight);396397 balanceBobFinal = await helper.balance.getSubstrate(bob.address);398 console.log('Relay (Westend) to Opal transaction fees: %s OPL', balanceBobAfter - balanceBobFinal);399 });400});tests/src/xcm/xcmQuartz.test.tsdiffbeforeafterboth--- a/tests/src/xcm/xcmQuartz.test.ts
+++ b/tests/src/xcm/xcmQuartz.test.ts
@@ -16,20 +16,17 @@
import {IKeyringPair} from '@polkadot/types/types';
import {blake2AsHex} from '@polkadot/util-crypto';
+import config from '../config';
import {XcmV2TraitsOutcome, XcmV2TraitsError} from '../interfaces';
import {itSub, expect, describeXcm, usingPlaygrounds, usingKaruraPlaygrounds, usingRelayPlaygrounds, usingMoonriverPlaygrounds} from '../util/playgrounds';
const QUARTZ_CHAIN = 2095;
const KARURA_CHAIN = 2000;
const MOONRIVER_CHAIN = 2023;
-
-const RELAY_PORT = 9844;
-const KARURA_PORT = 9946;
-const MOONRIVER_PORT = 9947;
-const relayUrl = 'ws://127.0.0.1:' + RELAY_PORT;
-const karuraUrl = 'ws://127.0.0.1:' + KARURA_PORT;
-const moonriverUrl = 'ws://127.0.0.1:' + MOONRIVER_PORT;
+const relayUrl = config.relayUrl;
+const karuraUrl = config.karuraUrl;
+const moonriverUrl = config.moonriverUrl;
const KARURA_DECIMALS = 12;
tests/src/xcm/xcmUnique.test.tsdiffbeforeafterboth--- a/tests/src/xcm/xcmUnique.test.ts
+++ b/tests/src/xcm/xcmUnique.test.ts
@@ -16,20 +16,17 @@
import {IKeyringPair} from '@polkadot/types/types';
import {blake2AsHex} from '@polkadot/util-crypto';
+import config from '../config';
import {XcmV2TraitsError, XcmV2TraitsOutcome} from '../interfaces';
import {itSub, expect, describeXcm, usingPlaygrounds, usingAcalaPlaygrounds, usingRelayPlaygrounds, usingMoonbeamPlaygrounds} from '../util/playgrounds';
const UNIQUE_CHAIN = 2037;
const ACALA_CHAIN = 2000;
const MOONBEAM_CHAIN = 2004;
-
-const RELAY_PORT = 9844;
-const ACALA_PORT = 9946;
-const MOONBEAM_PORT = 9947;
-const relayUrl = 'ws://127.0.0.1:' + RELAY_PORT;
-const acalaUrl = 'ws://127.0.0.1:' + ACALA_PORT;
-const moonbeamUrl = 'ws://127.0.0.1:' + MOONBEAM_PORT;
+const relayUrl = config.relayUrl;
+const acalaUrl = config.acalaUrl;
+const moonbeamUrl = config.moonbeamUrl;
const ACALA_DECIMALS = 12;