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

difftreelog

test(ss58Format) fix format address, remove accounts constants

h3lpkey2022-06-08parent: #2074c93.patch.diff
in: master

6 files changed

deletedtests/src/accounts.tsdiffbeforeafterboth

no changes

modifiedtests/src/creditFeesToTreasury.test.tsdiffbeforeafterboth
18import chai from 'chai';18import chai from 'chai';
19import chaiAsPromised from 'chai-as-promised';19import chaiAsPromised from 'chai-as-promised';
20import {default as usingApi, submitTransactionAsync, submitTransactionExpectFailAsync} from './substrate/substrate-api';20import {default as usingApi, submitTransactionAsync, submitTransactionExpectFailAsync} from './substrate/substrate-api';
21import {alicesPublicKey, bobsPublicKey} from './accounts';
22import {IKeyringPair} from '@polkadot/types/types';21import {IKeyringPair} from '@polkadot/types/types';
23import {22import {
24 createCollectionExpectSuccess,23 createCollectionExpectSuccess,
71 });70 });
7271
73 it('Total issuance does not change', async () => {72 it('Total issuance does not change', async () => {
74 await usingApi(async (api, privateKeyWrapper) => {73 await usingApi(async (api) => {
75 await skipInflationBlock(api);74 await skipInflationBlock(api);
76 await waitNewBlocks(api, 1);75 await waitNewBlocks(api, 1);
7776
78 const totalBefore = (await api.query.balances.totalIssuance()).toBigInt();77 const totalBefore = (await api.query.balances.totalIssuance()).toBigInt();
7978
80 const alicePrivateKey = privateKeyWrapper('//Alice');
81 const amount = 1n;79 const amount = 1n;
82 const transfer = api.tx.balances.transfer(bobsPublicKey, amount);80 const transfer = api.tx.balances.transfer(bob.address, amount);
8381
84 const result = getGenericResult(await submitTransactionAsync(alicePrivateKey, transfer));82 const result = getGenericResult(await submitTransactionAsync(alice, transfer));
8583
86 const totalAfter = (await api.query.balances.totalIssuance()).toBigInt();84 const totalAfter = (await api.query.balances.totalIssuance()).toBigInt();
8785
91 });89 });
9290
93 it('Sender balance decreased by fee+sent amount, Treasury balance increased by fee', async () => {91 it('Sender balance decreased by fee+sent amount, Treasury balance increased by fee', async () => {
94 await usingApi(async (api, privateKeyWrapper) => {92 await usingApi(async (api) => {
95 await skipInflationBlock(api);93 await skipInflationBlock(api);
96 await waitNewBlocks(api, 1);94 await waitNewBlocks(api, 1);
9795
98 const alicePrivateKey = privateKeyWrapper('//Alice');
99 const treasuryBalanceBefore: bigint = (await api.query.system.account(TREASURY)).data.free.toBigInt();96 const treasuryBalanceBefore: bigint = (await api.query.system.account(TREASURY)).data.free.toBigInt();
100 const aliceBalanceBefore: bigint = (await api.query.system.account(alicesPublicKey)).data.free.toBigInt();97 const aliceBalanceBefore: bigint = (await api.query.system.account(alice.address)).data.free.toBigInt();
10198
102 const amount = 1n;99 const amount = 1n;
103 const transfer = api.tx.balances.transfer(bobsPublicKey, amount);100 const transfer = api.tx.balances.transfer(bob.address, amount);
104 const result = getGenericResult(await submitTransactionAsync(alicePrivateKey, transfer));101 const result = getGenericResult(await submitTransactionAsync(alice, transfer));
105102
106 const treasuryBalanceAfter: bigint = (await api.query.system.account(TREASURY)).data.free.toBigInt();103 const treasuryBalanceAfter: bigint = (await api.query.system.account(TREASURY)).data.free.toBigInt();
107 const aliceBalanceAfter: bigint = (await api.query.system.account(alicesPublicKey)).data.free.toBigInt();104 const aliceBalanceAfter: bigint = (await api.query.system.account(alice.address)).data.free.toBigInt();
108 const fee = aliceBalanceBefore - aliceBalanceAfter - amount;105 const fee = aliceBalanceBefore - aliceBalanceAfter - amount;
109 const treasuryIncrease = treasuryBalanceAfter - treasuryBalanceBefore;106 const treasuryIncrease = treasuryBalanceAfter - treasuryBalanceBefore;
110107
114 });111 });
115112
116 it('Treasury balance increased by failed tx fee', async () => {113 it('Treasury balance increased by failed tx fee', async () => {
117 await usingApi(async (api, privateKeyWrapper) => {114 await usingApi(async (api) => {
118 //await skipInflationBlock(api);115 //await skipInflationBlock(api);
119 await waitNewBlocks(api, 1);116 await waitNewBlocks(api, 1);
120117
121 const bobPrivateKey = privateKeyWrapper('//Bob');
122 const treasuryBalanceBefore = (await api.query.system.account(TREASURY)).data.free.toBigInt();118 const treasuryBalanceBefore = (await api.query.system.account(TREASURY)).data.free.toBigInt();
123 const bobBalanceBefore = (await api.query.system.account(bobsPublicKey)).data.free.toBigInt();119 const bobBalanceBefore = (await api.query.system.account(bob.address)).data.free.toBigInt();
124120
125 const badTx = api.tx.balances.setBalance(alicesPublicKey, 0, 0);121 const badTx = api.tx.balances.setBalance(alice.address, 0, 0);
126 await expect(submitTransactionExpectFailAsync(bobPrivateKey, badTx)).to.be.rejected;122 await expect(submitTransactionExpectFailAsync(bob, badTx)).to.be.rejected;
127123
128 const treasuryBalanceAfter = (await api.query.system.account(TREASURY)).data.free.toBigInt();124 const treasuryBalanceAfter = (await api.query.system.account(TREASURY)).data.free.toBigInt();
129 const bobBalanceAfter = (await api.query.system.account(bobsPublicKey)).data.free.toBigInt();125 const bobBalanceAfter = (await api.query.system.account(bob.address)).data.free.toBigInt();
130 const fee = bobBalanceBefore - bobBalanceAfter;126 const fee = bobBalanceBefore - bobBalanceAfter;
131 const treasuryIncrease = treasuryBalanceAfter - treasuryBalanceBefore;127 const treasuryIncrease = treasuryBalanceAfter - treasuryBalanceBefore;
132128
140 await waitNewBlocks(api, 1);136 await waitNewBlocks(api, 1);
141137
142 const treasuryBalanceBefore = (await api.query.system.account(TREASURY)).data.free.toBigInt();138 const treasuryBalanceBefore = (await api.query.system.account(TREASURY)).data.free.toBigInt();
143 const aliceBalanceBefore = (await api.query.system.account(alicesPublicKey)).data.free.toBigInt();139 const aliceBalanceBefore = (await api.query.system.account(alice.address)).data.free.toBigInt();
144140
145 await createCollectionExpectSuccess();141 await createCollectionExpectSuccess();
146142
147 const treasuryBalanceAfter = (await api.query.system.account(TREASURY)).data.free.toBigInt();143 const treasuryBalanceAfter = (await api.query.system.account(TREASURY)).data.free.toBigInt();
148 const aliceBalanceAfter = (await api.query.system.account(alicesPublicKey)).data.free.toBigInt();144 const aliceBalanceAfter = (await api.query.system.account(alice.address)).data.free.toBigInt();
149 const fee = aliceBalanceBefore - aliceBalanceAfter;145 const fee = aliceBalanceBefore - aliceBalanceAfter;
150 const treasuryIncrease = treasuryBalanceAfter - treasuryBalanceBefore;146 const treasuryIncrease = treasuryBalanceAfter - treasuryBalanceBefore;
151147
158 await skipInflationBlock(api);154 await skipInflationBlock(api);
159 await waitNewBlocks(api, 1);155 await waitNewBlocks(api, 1);
160156
161 const aliceBalanceBefore: bigint = (await api.query.system.account(alicesPublicKey)).data.free.toBigInt();157 const aliceBalanceBefore: bigint = (await api.query.system.account(alice.address)).data.free.toBigInt();
162158
163 await createCollectionExpectSuccess();159 await createCollectionExpectSuccess();
164160
165 const aliceBalanceAfter: bigint = (await api.query.system.account(alicesPublicKey)).data.free.toBigInt();161 const aliceBalanceAfter: bigint = (await api.query.system.account(alice.address)).data.free.toBigInt();
166 const fee = aliceBalanceBefore - aliceBalanceAfter;162 const fee = aliceBalanceBefore - aliceBalanceAfter;
167163
168 expect(fee / UNIQUE < BigInt(Math.ceil(saneMaximumFee + createCollectionDeposit))).to.be.true;164 expect(fee / UNIQUE < BigInt(Math.ceil(saneMaximumFee + createCollectionDeposit))).to.be.true;
178 const collectionId = await createCollectionExpectSuccess();174 const collectionId = await createCollectionExpectSuccess();
179 const tokenId = await createItemExpectSuccess(alice, collectionId, 'NFT');175 const tokenId = await createItemExpectSuccess(alice, collectionId, 'NFT');
180176
181 const aliceBalanceBefore: bigint = (await api.query.system.account(alicesPublicKey)).data.free.toBigInt();177 const aliceBalanceBefore: bigint = (await api.query.system.account(alice.address)).data.free.toBigInt();
182 await transferExpectSuccess(collectionId, tokenId, alice, bob, 1, 'NFT');178 await transferExpectSuccess(collectionId, tokenId, alice, bob, 1, 'NFT');
183 const aliceBalanceAfter: bigint = (await api.query.system.account(alicesPublicKey)).data.free.toBigInt();179 const aliceBalanceAfter: bigint = (await api.query.system.account(alice.address)).data.free.toBigInt();
184180
185 const fee = Number(aliceBalanceBefore - aliceBalanceAfter) / Number(UNIQUE);181 const fee = Number(aliceBalanceBefore - aliceBalanceAfter) / Number(UNIQUE);
186 const expectedTransferFee = 0.1;182 const expectedTransferFee = 0.1;
modifiedtests/src/substrate/substrate-api.tsdiffbeforeafterboth
88 await promisifySubstrate(api, async () => {88 await promisifySubstrate(api, async () => {
89 if (api) {89 if (api) {
90 await api.isReadyOrError;90 await api.isReadyOrError;
91 const ss58Format = (api.registry.getChainProperties())!.toHuman().ss58Format;91 const ss58Format = (api.registry.getChainProperties())!.toJSON().ss58Format;
92 const privateKeyWrapper = (account: string) => privateKey(account, Number(ss58Format));92 const privateKeyWrapper = (account: string) => privateKey(account, Number(ss58Format));
93 result = await action(api, privateKeyWrapper);93 result = await action(api, privateKeyWrapper);
94 }94 }
modifiedtests/src/transfer.test.tsdiffbeforeafterboth
17import {ApiPromise} from '@polkadot/api';17import {ApiPromise} from '@polkadot/api';
18import {IKeyringPair} from '@polkadot/types/types';18import {IKeyringPair} from '@polkadot/types/types';
19import {expect} from 'chai';19import {expect} from 'chai';
20import {alicesPublicKey, bobsPublicKey} from './accounts';
21import getBalance from './substrate/get-balance';20import getBalance from './substrate/get-balance';
22import {default as usingApi, submitTransactionAsync} from './substrate/substrate-api';21import {default as usingApi, submitTransactionAsync} from './substrate/substrate-api';
23import {22import {
47let charlie: IKeyringPair;46let charlie: IKeyringPair;
4847
49describe('Integration Test Transfer(recipient, collection_id, item_id, value)', () => {48describe('Integration Test Transfer(recipient, collection_id, item_id, value)', () => {
49 before(async () => {
50 await usingApi(async (api, privateKeyWrapper) => {
51 alice = privateKeyWrapper('//Alice');
52 bob = privateKeyWrapper('//Bob');
53 });
54 });
55
50 it('Balance transfers and check balance', async () => {56 it('Balance transfers and check balance', async () => {
51 await usingApi(async (api, privateKeyWrapper) => {57 await usingApi(async (api, privateKeyWrapper) => {
52 const [alicesBalanceBefore, bobsBalanceBefore] = await getBalance(api, [alicesPublicKey, bobsPublicKey]);58 const [alicesBalanceBefore, bobsBalanceBefore] = await getBalance(api, [alice.address, bob.address]);
53
54 const alicePrivateKey = privateKeyWrapper('//Alice');
5559
56 const transfer = api.tx.balances.transfer(bobsPublicKey, 1n);60 const transfer = api.tx.balances.transfer(bob.address, 1n);
57 const events = await submitTransactionAsync(alicePrivateKey, transfer);61 const events = await submitTransactionAsync(alice, transfer);
58 const result = getCreateItemResult(events);62 const result = getCreateItemResult(events);
59 // tslint:disable-next-line:no-unused-expression63 // tslint:disable-next-line:no-unused-expression
60 expect(result.success).to.be.true;64 expect(result.success).to.be.true;
6165
62 const [alicesBalanceAfter, bobsBalanceAfter] = await getBalance(api, [alicesPublicKey, bobsPublicKey]);66 const [alicesBalanceAfter, bobsBalanceAfter] = await getBalance(api, [alice.address, bob.address]);
6367
64 // tslint:disable-next-line:no-unused-expression68 // tslint:disable-next-line:no-unused-expression
65 expect(alicesBalanceAfter < alicesBalanceBefore).to.be.true;69 expect(alicesBalanceAfter < alicesBalanceBefore).to.be.true;
73 // Find unused address77 // Find unused address
74 const pk = await findUnusedAddress(api);78 const pk = await findUnusedAddress(api);
7579
76 const badTransfer = api.tx.balances.transfer(bobsPublicKey, 1n);80 const badTransfer = api.tx.balances.transfer(bob.address, 1n);
77 // const events = await submitTransactionAsync(pk, badTransfer);81 // const events = await submitTransactionAsync(pk, badTransfer);
78 const badTransaction = async () => {82 const badTransaction = async () => {
79 const events = await submitTransactionAsync(pk, badTransfer);83 const events = await submitTransactionAsync(pk, badTransfer);
8791
88 it('User can transfer owned token', async () => {92 it('User can transfer owned token', async () => {
89 await usingApi(async (api, privateKeyWrapper) => {93 await usingApi(async (api, privateKeyWrapper) => {
90 const alice = privateKeyWrapper('//Alice');
91 const bob = privateKeyWrapper('//Bob');
92 // nft94 // nft
93 const nftCollectionId = await createCollectionExpectSuccess();95 const nftCollectionId = await createCollectionExpectSuccess();
94 const newNftTokenId = await createItemExpectSuccess(alice, nftCollectionId, 'NFT');96 const newNftTokenId = await createItemExpectSuccess(alice, nftCollectionId, 'NFT');
114116
115 it('Collection admin can transfer owned token', async () => {117 it('Collection admin can transfer owned token', async () => {
116 await usingApi(async (api, privateKeyWrapper) => {118 await usingApi(async (api, privateKeyWrapper) => {
117 const alice = privateKeyWrapper('//Alice');
118 const bob = privateKeyWrapper('//Bob');
119 // nft119 // nft
120 const nftCollectionId = await createCollectionExpectSuccess();120 const nftCollectionId = await createCollectionExpectSuccess();
121 await addCollectionAdminExpectSuccess(alice, nftCollectionId, bob.address);121 await addCollectionAdminExpectSuccess(alice, nftCollectionId, bob.address);
316describe('Transfers to self (potentially over substrate-evm boundary)', () => {316describe('Transfers to self (potentially over substrate-evm boundary)', () => {
317 itWeb3('Transfers to self. In case of same frontend', async ({api, privateKeyWrapper}) => {317 itWeb3('Transfers to self. In case of same frontend', async ({api, privateKeyWrapper}) => {
318 const collectionId = await createCollectionExpectSuccess({mode: {type: 'Fungible', decimalPoints: 0}});318 const collectionId = await createCollectionExpectSuccess({mode: {type: 'Fungible', decimalPoints: 0}});
319 const alice = privateKeyWrapper('//Alice');
320 const aliceProxy = subToEth(alice.address);319 const aliceProxy = subToEth(alice.address);
321 const tokenId = await createItemExpectSuccess(alice, collectionId, 'Fungible', {Substrate: alice.address});320 const tokenId = await createItemExpectSuccess(alice, collectionId, 'Fungible', {Substrate: alice.address});
322 await transferExpectSuccess(collectionId, tokenId, alice, {Ethereum: aliceProxy}, 10, 'Fungible');321 await transferExpectSuccess(collectionId, tokenId, alice, {Ethereum: aliceProxy}, 10, 'Fungible');
328327
329 itWeb3('Transfers to self. In case of substrate-evm boundary', async ({api, privateKeyWrapper}) => {328 itWeb3('Transfers to self. In case of substrate-evm boundary', async ({api, privateKeyWrapper}) => {
330 const collectionId = await createCollectionExpectSuccess({mode: {type: 'Fungible', decimalPoints: 0}});329 const collectionId = await createCollectionExpectSuccess({mode: {type: 'Fungible', decimalPoints: 0}});
331 const alice = privateKeyWrapper('//Alice');
332 const aliceProxy = subToEth(alice.address);330 const aliceProxy = subToEth(alice.address);
333 const tokenId = await createItemExpectSuccess(alice, collectionId, 'Fungible', {Substrate: alice.address});331 const tokenId = await createItemExpectSuccess(alice, collectionId, 'Fungible', {Substrate: alice.address});
334 const balanceAliceBefore = await getTokenBalance(api, collectionId, normalizeAccountId(alice), tokenId);332 const balanceAliceBefore = await getTokenBalance(api, collectionId, normalizeAccountId(alice), tokenId);
340338
341 itWeb3('Transfers to self. In case of inside substrate-evm', async ({api, privateKeyWrapper}) => {339 itWeb3('Transfers to self. In case of inside substrate-evm', async ({api, privateKeyWrapper}) => {
342 const collectionId = await createCollectionExpectSuccess({mode: {type: 'Fungible', decimalPoints: 0}});340 const collectionId = await createCollectionExpectSuccess({mode: {type: 'Fungible', decimalPoints: 0}});
343 const alice = privateKeyWrapper('//Alice');
344 const tokenId = await createItemExpectSuccess(alice, collectionId, 'Fungible', {Substrate: alice.address});341 const tokenId = await createItemExpectSuccess(alice, collectionId, 'Fungible', {Substrate: alice.address});
345 const balanceAliceBefore = await getTokenBalance(api, collectionId, normalizeAccountId(alice), tokenId);342 const balanceAliceBefore = await getTokenBalance(api, collectionId, normalizeAccountId(alice), tokenId);
346 await transferExpectSuccess(collectionId, tokenId, alice, alice , 10, 'Fungible');343 await transferExpectSuccess(collectionId, tokenId, alice, alice , 10, 'Fungible');
351348
352 itWeb3('Transfers to self. In case of inside substrate-evm when not enought "Fungibles"', async ({api, privateKeyWrapper}) => {349 itWeb3('Transfers to self. In case of inside substrate-evm when not enought "Fungibles"', async ({api, privateKeyWrapper}) => {
353 const collectionId = await createCollectionExpectSuccess({mode: {type: 'Fungible', decimalPoints: 0}});350 const collectionId = await createCollectionExpectSuccess({mode: {type: 'Fungible', decimalPoints: 0}});
354 const alice = privateKeyWrapper('//Alice');
355 const tokenId = await createItemExpectSuccess(alice, collectionId, 'Fungible', {Substrate: alice.address});351 const tokenId = await createItemExpectSuccess(alice, collectionId, 'Fungible', {Substrate: alice.address});
356 const balanceAliceBefore = await getTokenBalance(api, collectionId, normalizeAccountId(alice), tokenId);352 const balanceAliceBefore = await getTokenBalance(api, collectionId, normalizeAccountId(alice), tokenId);
357 await transferExpectFailure(collectionId, tokenId, alice, alice , 11);353 await transferExpectFailure(collectionId, tokenId, alice, alice , 11);
modifiedtests/src/util/helpers.tsdiffbeforeafterboth
23import BN from 'bn.js';23import BN from 'bn.js';
24import chai from 'chai';24import chai from 'chai';
25import chaiAsPromised from 'chai-as-promised';25import chaiAsPromised from 'chai-as-promised';
26import {alicesPublicKey} from '../accounts';
27import {default as usingApi, executeTransaction, submitTransactionAsync, submitTransactionExpectFailAsync} from '../substrate/substrate-api';26import {default as usingApi, executeTransaction, submitTransactionAsync, submitTransactionExpectFailAsync} from '../substrate/substrate-api';
28import {hexToStr, strToUTF16, utf16ToStr} from './util';27import {hexToStr, strToUTF16, utf16ToStr} from './util';
29import {UpDataStructsRpcCollection, UpDataStructsCreateItemData, UpDataStructsProperty} from '@polkadot/types/lookup';28import {UpDataStructsRpcCollection, UpDataStructsCreateItemData, UpDataStructsProperty} from '@polkadot/types/lookup';
4039
41export function normalizeAccountId(input: string | AccountId | CrossAccountId | IKeyringPair): CrossAccountId {40export function normalizeAccountId(input: string | AccountId | CrossAccountId | IKeyringPair): CrossAccountId {
42 if (typeof input === 'string') {41 if (typeof input === 'string') {
43 if (input.length === 48 || input.length === 47) {42 if (input.length >= 47) {
44 return {Substrate: input};43 return {Substrate: input};
45 } else if (input.length === 42 && input.startsWith('0x')) {44 } else if (input.length === 42 && input.startsWith('0x')) {
46 return {Ethereum: input.toLowerCase()};45 return {Ethereum: input.toLowerCase()};
363 // tslint:disable-next-line:no-unused-expression362 // tslint:disable-next-line:no-unused-expression
364 expect(collection).to.be.not.null;363 expect(collection).to.be.not.null;
365 expect(collectionCountAfter).to.be.equal(collectionCountBefore + 1, 'Error: NFT collection NOT created.');364 expect(collectionCountAfter).to.be.equal(collectionCountBefore + 1, 'Error: NFT collection NOT created.');
366 expect(collection.owner.toString()).to.be.equal(toSubstrateAddress(alicesPublicKey));365 expect(collection.owner.toString()).to.be.equal(toSubstrateAddress(alicePrivateKey));
367 expect(utf16ToStr(collection.name.toJSON() as any)).to.be.equal(name);366 expect(utf16ToStr(collection.name.toJSON() as any)).to.be.equal(name);
368 expect(utf16ToStr(collection.description.toJSON() as any)).to.be.equal(description);367 expect(utf16ToStr(collection.description.toJSON() as any)).to.be.equal(description);
369 expect(hexToStr(collection.tokenPrefix.toJSON())).to.be.equal(tokenPrefix);368 expect(hexToStr(collection.tokenPrefix.toJSON())).to.be.equal(tokenPrefix);
411 // tslint:disable-next-line:no-unused-expression410 // tslint:disable-next-line:no-unused-expression
412 expect(collection).to.be.not.null;411 expect(collection).to.be.not.null;
413 expect(collectionCountAfter).to.be.equal(collectionCountBefore + 1, 'Error: NFT collection NOT created.');412 expect(collectionCountAfter).to.be.equal(collectionCountBefore + 1, 'Error: NFT collection NOT created.');
414 expect(collection.owner.toString()).to.be.equal(toSubstrateAddress(alicesPublicKey));413 expect(collection.owner.toString()).to.be.equal(toSubstrateAddress(alicePrivateKey));
415 expect(utf16ToStr(collection.name.toJSON() as any)).to.be.equal(name);414 expect(utf16ToStr(collection.name.toJSON() as any)).to.be.equal(name);
416 expect(utf16ToStr(collection.description.toJSON() as any)).to.be.equal(description);415 expect(utf16ToStr(collection.description.toJSON() as any)).to.be.equal(description);
417 expect(hexToStr(collection.tokenPrefix.toJSON())).to.be.equal(tokenPrefix);416 expect(hexToStr(collection.tokenPrefix.toJSON())).to.be.equal(tokenPrefix);
modifiedtests/src/xcmTransfer.test.tsdiffbeforeafterboth
24import {getGenericResult} from './util/helpers';24import {getGenericResult} from './util/helpers';
25import waitNewBlocks from './substrate/wait-new-blocks';25import waitNewBlocks from './substrate/wait-new-blocks';
26import getBalance from './substrate/get-balance';26import getBalance from './substrate/get-balance';
27import {alicesPublicKey} from './accounts';
2827
29chai.use(chaiAsPromised);28chai.use(chaiAsPromised);
30const expect = chai.expect;29const expect = chai.expect;
144 let balanceBefore: bigint;143 let balanceBefore: bigint;
145 144
146 await usingApi(async (api) => {145 await usingApi(async (api) => {
147 [balanceBefore] = await getBalance(api, [alicesPublicKey]);146 [balanceBefore] = await getBalance(api, [alice.address]);
148 });147 });
149148
150 await usingApi(async (api) => {149 await usingApi(async (api) => {
181 await usingApi(async (api) => {180 await usingApi(async (api) => {
182 // todo do something about instant sealing, where there might not be any new blocks181 // todo do something about instant sealing, where there might not be any new blocks
183 await waitNewBlocks(api, 3);182 await waitNewBlocks(api, 3);
184 const [balanceAfter] = await getBalance(api, [alicesPublicKey]);183 const [balanceAfter] = await getBalance(api, [alice.address]);
185 expect(balanceAfter > balanceBefore).to.be.true;184 expect(balanceAfter > balanceBefore).to.be.true;
186 });185 });
187 });186 });