difftreelog
Tests fix + global folders mask in config
in: master
2 files changed
tests/package.jsondiffbeforeafterboth23 "scripts": {23 "scripts": {24 "lint": "eslint --ext .ts,.js src/",24 "lint": "eslint --ext .ts,.js src/",25 "fix": "eslint --ext .ts,.js src/ --fix",25 "fix": "eslint --ext .ts,.js src/ --fix",26 "test": "mocha --timeout 9999999 -r ts-node/register ./**/*.test.ts ./**/eth/**/*.test.ts",26 "test": "mocha --timeout 9999999 -r ts-node/register './**/*.test.ts'",27 "testEth": "mocha --timeout 9999999 -r ts-node/register ./**/eth/**/*.test.ts",27 "testEth": "mocha --timeout 9999999 -r ts-node/register ./**/eth/**/*.test.ts",28 "load": "mocha --timeout 9999999 -r ts-node/register ./**/*.load.ts",28 "load": "mocha --timeout 9999999 -r ts-node/register ./**/*.load.ts",29 "loadTransfer": "ts-node src/transfer.nload.ts",29 "loadTransfer": "ts-node src/transfer.nload.ts",tests/src/eth/crossTransfer.test.tsdiffbeforeafterboth8 createFungibleItemExpectSuccess, 8 createFungibleItemExpectSuccess, 9 transferExpectSuccess, 9 transferExpectSuccess, 10 transferFromExpectSuccess, 10 transferFromExpectSuccess, 11 CrossAccountId,12 createItemExpectSuccess,11 createItemExpectSuccess } from '../util/helpers';13 normalizeAccountId } from '../util/helpers';14import { collectionIdToAddress, 12import { collectionIdToAddress, 15 createEthAccountWithBalance, 13 createEthAccountWithBalance, 14 subToEth,16 GAS_ARGS, itWeb3 } from './util/helpers';15 GAS_ARGS, itWeb3 } from './util/helpers';17import fungibleAbi from './fungibleAbi.json';16import fungibleAbi from './fungibleAbi.json';18import nonFungibleAbi from './nonFungibleAbi.json';17import nonFungibleAbi from './nonFungibleAbi.json';26 const alice = privateKey('//Alice');25 const alice = privateKey('//Alice');27 const bob = privateKey('//Bob');26 const bob = privateKey('//Bob');28 const charlie = privateKey('//Charlie');27 const charlie = privateKey('//Charlie');29 const ethAccountVariant: CrossAccountId = normalizeAccountId(charlie.address);30 await createFungibleItemExpectSuccess(alice, collection, { Value: 200n }, { substrate: alice.address });28 await createFungibleItemExpectSuccess(alice, collection, { Value: 200n }, { substrate: alice.address });31 await transferExpectSuccess(collection, 0, alice, ethAccountVariant , 200, 'Fungible');29 await transferExpectSuccess(collection, 0, alice, {ethereum: subToEth(charlie.address)} , 200, 'Fungible');30 await transferFromExpectSuccess(collection, 0, alice, {ethereum: subToEth(charlie.address)}, charlie, 50, 'Fungible');32 await transferExpectSuccess(collection, 0, charlie, bob , 200, 'Fungible');31 await transferExpectSuccess(collection, 0, charlie, bob, 50, 'Fungible');33 });32 });343335 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 }) => {34 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});53});555456describe.only('Token transfer between substrate address and EVM address. NFT', () => {55describe.only('Token transfer between substrate address and EVM address. NFT', () => {57 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 () => {56 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 () => {58 const collection = await createCollectionExpectSuccess({57 const collection = await createCollectionExpectSuccess({59 name: 'token name',58 name: 'token name',60 mode: { type: 'NFT' },59 mode: { type: 'NFT' },61 });60 });62 const alice = privateKey('//Alice');61 const alice = privateKey('//Alice');63 const bob = privateKey('//Bob');62 const bob = privateKey('//Bob');64 const charlie = privateKey('//Charlie');63 const charlie = privateKey('//Charlie');65 const ethAccountVariant: CrossAccountId = normalizeAccountId(charlie.address);66 const tokenId = await createItemExpectSuccess(alice, collection, 'NFT', { substrate: alice.address });64 const tokenId = await createItemExpectSuccess(alice, collection, 'NFT', { substrate: alice.address });67 await transferExpectSuccess(collection, tokenId, alice, ethAccountVariant, 1, 'NFT');65 await transferExpectSuccess(collection, tokenId, alice, { ethereum: subToEth(charlie.address) }, 1, 'NFT');66 await transferFromExpectSuccess(collection, tokenId, alice, {ethereum: subToEth(charlie.address)}, charlie, 1, 'NFT');68 await transferExpectSuccess(collection, tokenId, charlie, bob, 1, 'NFT');67 await transferExpectSuccess(collection, tokenId, charlie, bob, 1, 'NFT');69 });68 });7069