git.delta.rocks / unique-network / refs/commits / 3c77c1e2ea04

difftreelog

tests: eth_getCode

Max Andreev2023-01-13parent: #48a519d.patch.diff
in: master

5 files changed

modifiedtests/src/apiConsts.test.tsdiffbeforeafterboth
--- a/tests/src/apiConsts.test.ts
+++ b/tests/src/apiConsts.test.ts
@@ -15,7 +15,7 @@
 // along with Unique Network. If not, see <http://www.gnu.org/licenses/>.
 
 import {ApiPromise} from '@polkadot/api';
-import {usingPlaygrounds, itSub, expect} from './util';
+import {usingPlaygrounds, itSub, expect, COLLECTION_HELPER, CONTRACT_HELPER} from './util';
 
 
 const MAX_COLLECTION_DESCRIPTION_LENGTH = 256n;
@@ -40,9 +40,6 @@
   ownerCanDestroy: true,
   transfersEnabled: true,
 };
-
-const EVM_COLLECTION_HELPERS_ADDRESS = '0x6c4e9fe1ae37a41e93cee429e8e1881abdcbb54f';
-const HELPERS_CONTRACT_ADDRESS = '0x842899ECF380553E8a4de75bF534cdf6fBF64049';
 
 describe('integration test: API UNIQUE consts', () => {
   let api: ApiPromise;
@@ -106,11 +103,11 @@
   });
 
   itSub('HELPERS_CONTRACT_ADDRESS', () => {
-    expect(api.consts.evmContractHelpers.contractAddress.toString().toLowerCase()).to.be.equal(HELPERS_CONTRACT_ADDRESS.toLowerCase());
+    expect(api.consts.evmContractHelpers.contractAddress.toString().toLowerCase()).to.be.equal(CONTRACT_HELPER.toLowerCase());
   });
 
   itSub('EVM_COLLECTION_HELPERS_ADDRESS', () => {
-    expect(api.consts.common.contractAddress.toString().toLowerCase()).to.be.equal(EVM_COLLECTION_HELPERS_ADDRESS.toLowerCase());
+    expect(api.consts.common.contractAddress.toString().toLowerCase()).to.be.equal(COLLECTION_HELPER.toLowerCase());
   });
 });
 
modifiedtests/src/eth/collectionHelperAddress.test.tsdiffbeforeafterboth
--- a/tests/src/eth/collectionHelperAddress.test.ts
+++ b/tests/src/eth/collectionHelperAddress.test.ts
@@ -16,9 +16,7 @@
 
 import {itEth, usingEthPlaygrounds, expect} from './util';
 import {IKeyringPair} from '@polkadot/types/types';
-import {Pallets} from '../util';
-
-const EVM_COLLECTION_HELPERS_ADDRESS = '0x6c4e9fe1ae37a41e93cee429e8e1881abdcbb54f';
+import {COLLECTION_HELPER, Pallets} from '../util';
 
 describe('[eth]CollectionHelperAddress test: ERC20/ERC721 ', () => {
   let donor: IKeyringPair;
@@ -36,7 +34,7 @@
     const nftCollection = await helper.ethNativeContract.collection(nftCollectionAddress, 'nft', owner);
 
     expect((await nftCollection.methods.collectionHelperAddress().call())
-      .toString().toLowerCase()).to.be.equal(EVM_COLLECTION_HELPERS_ADDRESS);
+      .toString().toLowerCase()).to.be.equal(COLLECTION_HELPER);
   });
 
   itEth.ifWithPallets('RFT ', [Pallets.ReFungible], async ({helper}) => {
@@ -46,7 +44,7 @@
 
     const rftCollection = await helper.ethNativeContract.collection(rftCollectionAddress, 'rft', owner);
     expect((await rftCollection.methods.collectionHelperAddress().call())
-      .toString().toLowerCase()).to.be.equal(EVM_COLLECTION_HELPERS_ADDRESS);
+      .toString().toLowerCase()).to.be.equal(COLLECTION_HELPER);
   });
 
   itEth('FT', async ({helper}) => {
@@ -56,7 +54,7 @@
     const collection = await helper.ethNativeContract.collection(collectionAddress, 'ft', owner);
 
     expect((await collection.methods.collectionHelperAddress().call())
-      .toString().toLowerCase()).to.be.equal(EVM_COLLECTION_HELPERS_ADDRESS);
+      .toString().toLowerCase()).to.be.equal(COLLECTION_HELPER);
   });
 
   itEth('[collectionHelpers] convert collectionId into address', async ({helper}) => {
modifiedtests/src/eth/createNFTCollection.test.tsdiffbeforeafterboth
--- a/tests/src/eth/createNFTCollection.test.ts
+++ b/tests/src/eth/createNFTCollection.test.ts
@@ -18,6 +18,7 @@
 import {IKeyringPair} from '@polkadot/types/types';
 import {expect, itEth, usingEthPlaygrounds} from './util';
 import {CollectionLimitField} from './util/playgrounds/types';
+import {COLLECTION_HELPER} from '../util';
 
 
 describe('Create NFT collection from EVM', () => {
@@ -42,7 +43,7 @@
 
     expect(events).to.be.deep.equal([
       {
-        address: '0x6C4E9fE1AE37a41E93CEE429e8E1881aBdcbb54F',
+        address: COLLECTION_HELPER,
         event: 'CollectionCreated',
         args: {
           owner: owner,
addedtests/src/eth/getCode.test.tsdiffbeforeafterboth

no changes

modifiedtests/src/util/index.tsdiffbeforeafterboth
--- a/tests/src/util/index.ts
+++ b/tests/src/util/index.ts
@@ -100,6 +100,9 @@
 export const LOCKING_PERIOD = 12n; // 12 blocks of relay
 export const UNLOCKING_PERIOD = 6n; // 6 blocks of parachain
 
+// Native contracts
+export const COLLECTION_HELPER = '0x6c4e9fe1ae37a41e93cee429e8e1881abdcbb54f';
+export const CONTRACT_HELPER = '0x842899ECF380553E8a4de75bF534cdf6fBF64049';
 
 export enum Pallets {
   Inflation = 'inflation',