git.delta.rocks / unique-network / refs/commits / 68bf2bb2d784

difftreelog

fix use config for xcm urls

Daniel Shiposha2022-10-14parent: #294182f.patch.diff
in: master

4 files changed

modifiedtests/src/config.tsdiffbeforeafterboth
before · tests/src/config.ts
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 process from 'process';1819const config = {20  substrateUrl: process.env.substrateUrl || 'ws://127.0.0.1:9944',21  frontierUrl: process.env.frontierUrl || 'http://127.0.0.1:9933',22};2324export default config;
after · tests/src/config.ts
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 process from 'process';1819const config = {20  substrateUrl: process.env.substrateUrl || 'ws://127.0.0.1:9944',21  frontierUrl: process.env.frontierUrl || 'http://127.0.0.1:9933',22  relayUrl: process.env.relayUrl || 'ws://127.0.0.1:9844',23  acalaUrl: process.env.acalaUrl || 'ws://127.0.0.1:9946',24  karuraUrl: process.env.acalaUrl || 'ws://127.0.0.1:9946',25  moonbeamUrl: process.env.moonbeamUrl || 'ws://127.0.0.1:9947',26  moonriverUrl: process.env.moonbeamUrl || 'ws://127.0.0.1:9947',27  westmintUrl: process.env.westmintUrl || 'ws://127.0.0.1:9948',28};2930export default config;
modifiedtests/src/xcm/xcmOpal.test.tsdiffbeforeafterboth
--- a/tests/src/xcm/xcmOpal.test.ts
+++ b/tests/src/xcm/xcmOpal.test.ts
@@ -15,16 +15,14 @@
 // along with Unique Network. If not, see <http://www.gnu.org/licenses/>.
 
 import {IKeyringPair} from '@polkadot/types/types';
+import config from '../config';
 import {itSub, expect, describeXcm, usingPlaygrounds, usingWestmintPlaygrounds, usingRelayPlaygrounds} from '../util/playgrounds';
 
 const STATEMINE_CHAIN = 1000;
 const UNIQUE_CHAIN = 2095;
-
-const RELAY_PORT = '9844';
-const STATEMINE_PORT = '9948';
 
-const relayUrl = 'ws://127.0.0.1:' + RELAY_PORT;
-const statemineUrl = 'ws://127.0.0.1:' + STATEMINE_PORT;
+const relayUrl = config.relayUrl;
+const westmintUrl = config.westmintUrl;
 
 const STATEMINE_PALLET_INSTANCE = 50;
 const ASSET_ID = 100;
@@ -65,7 +63,7 @@
       bob = privateKey('//Bob'); // funds donor
     });
 
-    await usingWestmintPlaygrounds(statemineUrl, async (helper) => {
+    await usingWestmintPlaygrounds(westmintUrl, async (helper) => {
       // 350.00 (three hundred fifty) DOT
       const fundingAmount = 3_500_000_000_000n; 
 
@@ -157,7 +155,7 @@
   });
 
   itSub('Should connect and send USDT from Westmint to Opal', async ({helper}) => {
-    await usingWestmintPlaygrounds(statemineUrl, async (helper) => {
+    await usingWestmintPlaygrounds(westmintUrl, async (helper) => {
       const dest = {
         V1: {
           parents: 1,
@@ -286,7 +284,7 @@
     balanceOpalFinal = await helper.balance.getSubstrate(alice.address);
     expect(balanceOpalAfter > balanceOpalFinal).to.be.true;
 
-    await usingWestmintPlaygrounds(statemineUrl, async (helper) => {
+    await usingWestmintPlaygrounds(westmintUrl, async (helper) => {
       await helper.wait.newBlocks(3);
       
       // The USDT token never paid fees. Its amount not changed from begin value.
modifiedtests/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;
 
modifiedtests/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;