From ab5c2b54037a1dc73e10ca91c916b4fb0730f9a8 Mon Sep 17 00:00:00 2001 From: Trubnikov Sergey Date: Wed, 10 May 2023 13:02:35 +0000 Subject: [PATCH] fix: test name() --- --- 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); }); --- a/tests/src/util/playgrounds/unique.ts +++ b/tests/src/util/playgrounds/unique.ts @@ -498,7 +498,7 @@ if (xcmChains.indexOf(spec.specName) > -1) return spec.specName; - if (['quartz', 'unique'].indexOf(spec.specName) > -1) return spec.specName; + if (['quartz', 'unique', 'sapphire'].indexOf(spec.specName) > -1) return spec.specName; return 'opal'; } -- gitstuff