From c54922b13e4439340599d400bb49f5012b92cf48 Mon Sep 17 00:00:00 2001 From: str-mv Date: Wed, 11 Aug 2021 08:52:40 +0000 Subject: [PATCH] Tests fix + global folders mask in config --- --- a/tests/package.json +++ b/tests/package.json @@ -23,7 +23,7 @@ "scripts": { "lint": "eslint --ext .ts,.js src/", "fix": "eslint --ext .ts,.js src/ --fix", - "test": "mocha --timeout 9999999 -r ts-node/register ./**/*.test.ts ./**/eth/**/*.test.ts", + "test": "mocha --timeout 9999999 -r ts-node/register './**/*.test.ts'", "testEth": "mocha --timeout 9999999 -r ts-node/register ./**/eth/**/*.test.ts", "load": "mocha --timeout 9999999 -r ts-node/register ./**/*.load.ts", "loadTransfer": "ts-node src/transfer.nload.ts", --- a/tests/src/eth/crossTransfer.test.ts +++ b/tests/src/eth/crossTransfer.test.ts @@ -8,11 +8,10 @@ createFungibleItemExpectSuccess, transferExpectSuccess, transferFromExpectSuccess, - CrossAccountId, - createItemExpectSuccess, - normalizeAccountId } from '../util/helpers'; + createItemExpectSuccess } from '../util/helpers'; import { collectionIdToAddress, createEthAccountWithBalance, + subToEth, GAS_ARGS, itWeb3 } from './util/helpers'; import fungibleAbi from './fungibleAbi.json'; import nonFungibleAbi from './nonFungibleAbi.json'; @@ -26,10 +25,10 @@ const alice = privateKey('//Alice'); const bob = privateKey('//Bob'); const charlie = privateKey('//Charlie'); - const ethAccountVariant: CrossAccountId = normalizeAccountId(charlie.address); await createFungibleItemExpectSuccess(alice, collection, { Value: 200n }, { substrate: alice.address }); - await transferExpectSuccess(collection, 0, alice, ethAccountVariant , 200, 'Fungible'); - await transferExpectSuccess(collection, 0, charlie, bob , 200, 'Fungible'); + await transferExpectSuccess(collection, 0, alice, {ethereum: subToEth(charlie.address)} , 200, 'Fungible'); + await transferFromExpectSuccess(collection, 0, alice, {ethereum: subToEth(charlie.address)}, charlie, 50, 'Fungible'); + await transferExpectSuccess(collection, 0, charlie, bob, 50, 'Fungible'); }); itWeb3('The private key X create a EVM address. Alice sends a token to the substrate address corresponding to this EVM address, and X can send it to Bob in the EVM', async ({ api, web3 }) => { @@ -54,7 +53,7 @@ }); describe.only('Token transfer between substrate address and EVM address. NFT', () => { - itWeb3.skip('The private key X create a substrate address. Alice sends a token to the corresponding EVM address, and X can send it to Bob in the substrate', async () => { + itWeb3('The private key X create a substrate address. Alice sends a token to the corresponding EVM address, and X can send it to Bob in the substrate', async () => { const collection = await createCollectionExpectSuccess({ name: 'token name', mode: { type: 'NFT' }, @@ -62,9 +61,9 @@ const alice = privateKey('//Alice'); const bob = privateKey('//Bob'); const charlie = privateKey('//Charlie'); - const ethAccountVariant: CrossAccountId = normalizeAccountId(charlie.address); const tokenId = await createItemExpectSuccess(alice, collection, 'NFT', { substrate: alice.address }); - await transferExpectSuccess(collection, tokenId, alice, ethAccountVariant, 1, 'NFT'); + await transferExpectSuccess(collection, tokenId, alice, { ethereum: subToEth(charlie.address) }, 1, 'NFT'); + await transferFromExpectSuccess(collection, tokenId, alice, {ethereum: subToEth(charlie.address)}, charlie, 1, 'NFT'); await transferExpectSuccess(collection, tokenId, charlie, bob, 1, 'NFT'); }); -- gitstuff