git.delta.rocks / unique-network / refs/commits / 5b175538d295

difftreelog

wait 3 blocks to confirm xcm transfer

Igor Kozyrev2022-02-10parent: #aac898b.patch.diff
in: master

1 file changed

modifiedtests/src/xcmTransfer.test.tsdiffbeforeafterboth
23const KARURA_CHAIN = 2000;23const KARURA_CHAIN = 2000;
24const KARURA_PORT = '9946';24const KARURA_PORT = '9946';
2525
26describe('Integration test: Exchanging QTZ/OPL with Karura', () => {26describe('Integration test: Exchanging OPL with Karura', () => {
27 let alice: IKeyringPair;27 let alice: IKeyringPair;
28 28
29 before(async () => {29 before(async () => {
124124
125 await usingApi(async (api) => {125 await usingApi(async (api) => {
126 // todo do something about instant sealing, where there might not be any new blocks126 // todo do something about instant sealing, where there might not be any new blocks
127 await waitNewBlocks(api, 1);127 await waitNewBlocks(api, 3);
128 const {free} = (await api.query.tokens.accounts(alice.addressRaw, {ForeignAsset: 0})).toJSON() as any;128 const {free} = (await api.query.tokens.accounts(alice.addressRaw, {ForeignAsset: 0})).toJSON() as any;
129 expect(free > balanceOnKaruraBefore).to.be.true;129 expect(free > balanceOnKaruraBefore).to.be.true;
130 }, {provider: new WsProvider('ws://127.0.0.1:' + KARURA_PORT)});130 }, {provider: new WsProvider('ws://127.0.0.1:' + KARURA_PORT)});
170170
171 await usingApi(async (api) => {171 await usingApi(async (api) => {
172 // todo do something about instant sealing, where there might not be any new blocks172 // todo do something about instant sealing, where there might not be any new blocks
173 await waitNewBlocks(api, 1);173 await waitNewBlocks(api, 3);
174 const [balanceAfter] = await getBalance(api, [alicesPublicKey]);174 const [balanceAfter] = await getBalance(api, [alicesPublicKey]);
175 expect(balanceAfter > balanceBefore).to.be.true;175 expect(balanceAfter > balanceBefore).to.be.true;
176 });176 });