git.delta.rocks / unique-network / refs/commits / ab5c2b54037a

difftreelog

fix test name()

Trubnikov Sergey2023-05-10parent: #e5a95d6.patch.diff
in: master

2 files changed

modifiedtests/src/eth/nativeFungible.test.tsdiffbeforeafterboth
--- a/tests/src/eth/nativeFungible.test.ts
+++ b/tests/src/eth/nativeFungible.test.ts
@@ -16,6 +16,7 @@
 
 import {IKeyringPair} from '@polkadot/types/types';
 import {expect, itEth, usingEthPlaygrounds} from './util';
+import {UniqueHelper} from '../util/playgrounds/unique';
 
 describe('NativeFungible: ERC20 calls', () => {
   let donor: IKeyringPair;
@@ -60,13 +61,7 @@
     const collectionAddress = helper.ethAddress.fromCollectionId(0);
     const contract = await helper.ethNativeContract.collection(collectionAddress, 'ft', owner);
 
-    let realName;
-    switch ((await helper.chain.getChainProperties().tokenSymbol)[0]) {
-      case 'OPL': realName = 'opal'; break;
-      case 'QTZ': realName = 'quartz'; break;
-      case 'UNC': realName = 'unique'; break;
-      default: realName = ''; break;
-    }
+    const realName = await UniqueHelper.detectNetwork(helper.getApi());
     const name = await contract.methods.name().call({from: owner});
     expect(name).to.be.eq(realName);
   });
modifiedtests/src/util/playgrounds/unique.tsdiffbeforeafterboth
498498
499 if (xcmChains.indexOf(spec.specName) > -1) return spec.specName;499 if (xcmChains.indexOf(spec.specName) > -1) return spec.specName;
500500
501 if (['quartz', 'unique'].indexOf(spec.specName) > -1) return spec.specName;501 if (['quartz', 'unique', 'sapphire'].indexOf(spec.specName) > -1) return spec.specName;
502 return 'opal';502 return 'opal';
503 }503 }
504504