git.delta.rocks / unique-network / refs/commits / 71a39d07af30

difftreelog

Merge pull request #693 from UniqueNetwork/tests/increase_timeout

ut-akuznetsov2022-11-07parents: #1e082e3 #da93be2.patch.diff
in: master
Tests up

15 files changed

addedtests/src/eth/createFTCollection.seqtest.tsdiffbeforeafterboth

no changes

modifiedtests/src/eth/createFTCollection.test.tsdiffbeforeafterboth
31 });31 });
32 });32 });
3333
34 itEth('Create collection', async ({helper}) => {
35 const owner = await helper.eth.createAccountWithBalance(donor);
36
37 const name = 'CollectionEVM';
38 const description = 'Some description';
39 const prefix = 'token prefix';
40
41 // todo:playgrounds this might fail when in async environment.
42 const collectionCountBefore = +(await helper.callRpc('api.rpc.unique.collectionStats')).created;
43
44 const {collectionId} = await helper.eth.createFungibleCollection(owner, name, DECIMALS, description, prefix);
45
46 const collectionCountAfter = +(await helper.callRpc('api.rpc.unique.collectionStats')).created;
47 const data = (await helper.ft.getData(collectionId))!;
48
49 expect(collectionCountAfter - collectionCountBefore).to.be.eq(1);
50 expect(collectionId).to.be.eq(collectionCountAfter);
51 expect(data.name).to.be.eq(name);
52 expect(data.description).to.be.eq(description);
53 expect(data.raw.tokenPrefix).to.be.eq(prefix);
54 expect(data.raw.mode).to.be.deep.eq({Fungible: DECIMALS.toString()});
55 });
56
57 // todo:playgrounds this test will fail when in async environment.
58 itEth('Check collection address exist', async ({helper}) => {
59 const owner = await helper.eth.createAccountWithBalance(donor);
60
61 const expectedCollectionId = +(await helper.callRpc('api.rpc.unique.collectionStats')).created + 1;
62 const expectedCollectionAddress = helper.ethAddress.fromCollectionId(expectedCollectionId);
63 const collectionHelpers = helper.ethNativeContract.collectionHelpers(owner);
64
65 expect(await collectionHelpers.methods
66 .isCollectionExist(expectedCollectionAddress)
67 .call()).to.be.false;
68
69
70 await helper.eth.createFungibleCollection(owner, 'A', DECIMALS, 'A', 'A');
71
72
73 expect(await collectionHelpers.methods
74 .isCollectionExist(expectedCollectionAddress)
75 .call()).to.be.true;
76 });
77
78 itEth('Set sponsorship', async ({helper}) => {34 itEth('Set sponsorship', async ({helper}) => {
79 const owner = await helper.eth.createAccountWithBalance(donor);35 const owner = await helper.eth.createAccountWithBalance(donor);
addedtests/src/eth/createNFTCollection.seqtest.tsdiffbeforeafterboth

no changes

modifiedtests/src/eth/createNFTCollection.test.tsdiffbeforeafterboth
28 });28 });
29 });29 });
30
31 itEth('Create collection', async ({helper}) => {
32 const owner = await helper.eth.createAccountWithBalance(donor);
33
34 const name = 'CollectionEVM';
35 const description = 'Some description';
36 const prefix = 'token prefix';
37
38 // todo:playgrounds this might fail when in async environment.
39 const collectionCountBefore = +(await helper.callRpc('api.rpc.unique.collectionStats')).created;
40 const {collectionId, collectionAddress, events} = await helper.eth.createNFTCollection(owner, name, description, prefix);
41
42 expect(events).to.be.deep.equal([
43 {
44 address: '0x6C4E9fE1AE37a41E93CEE429e8E1881aBdcbb54F',
45 event: 'CollectionCreated',
46 args: {
47 owner: owner,
48 collectionId: collectionAddress,
49 },
50 },
51 ]);
52
53 const collectionCountAfter = +(await helper.callRpc('api.rpc.unique.collectionStats')).created;
54
55 const collection = helper.nft.getCollectionObject(collectionId);
56 const data = (await collection.getData())!;
57
58 expect(collectionCountAfter - collectionCountBefore).to.be.eq(1);
59 expect(collectionId).to.be.eq(collectionCountAfter);
60 expect(data.name).to.be.eq(name);
61 expect(data.description).to.be.eq(description);
62 expect(data.raw.tokenPrefix).to.be.eq(prefix);
63 expect(data.raw.mode).to.be.eq('NFT');
64
65 const options = await collection.getOptions();
66
67 expect(options.tokenPropertyPermissions).to.be.empty;
68 });
6930
70 itEth('Create collection with properties', async ({helper}) => {31 itEth('Create collection with properties', async ({helper}) => {
71 const owner = await helper.eth.createAccountWithBalance(donor);32 const owner = await helper.eth.createAccountWithBalance(donor);
109 ]);70 ]);
110 });71 });
111
112 // this test will occasionally fail when in async environment.
113 itEth.skip('Check collection address exist', async ({helper}) => {
114 const owner = await helper.eth.createAccountWithBalance(donor);
115
116 const expectedCollectionId = +(await helper.callRpc('api.rpc.unique.collectionStats')).created + 1;
117 const expectedCollectionAddress = helper.ethAddress.fromCollectionId(expectedCollectionId);
118 const collectionHelpers = helper.ethNativeContract.collectionHelpers(owner);
119
120 expect(await collectionHelpers.methods
121 .isCollectionExist(expectedCollectionAddress)
122 .call()).to.be.false;
123
124 await collectionHelpers.methods
125 .createNFTCollection('A', 'A', 'A')
126 .send({value: Number(2n * helper.balance.getOneTokenNominal())});
127
128 expect(await collectionHelpers.methods
129 .isCollectionExist(expectedCollectionAddress)
130 .call()).to.be.true;
131 });
13272
133 itEth('Set sponsorship', async ({helper}) => {73 itEth('Set sponsorship', async ({helper}) => {
134 const owner = await helper.eth.createAccountWithBalance(donor);74 const owner = await helper.eth.createAccountWithBalance(donor);
modifiedtests/src/eth/fungible.test.tsdiffbeforeafterboth
52describe('Fungible: Plain calls', () => {52describe('Fungible: Plain calls', () => {
53 let donor: IKeyringPair;53 let donor: IKeyringPair;
54 let alice: IKeyringPair;54 let alice: IKeyringPair;
55 let owner: IKeyringPair;
5556
56 before(async function() {57 before(async function() {
57 await usingEthPlaygrounds(async (helper, privateKey) => {58 await usingEthPlaygrounds(async (helper, privateKey) => {
58 donor = await privateKey({filename: __filename});59 donor = await privateKey({filename: __filename});
59 [alice] = await helper.arrange.createAccounts([20n], donor);60 [alice, owner] = await helper.arrange.createAccounts([20n, 20n], donor);
60 });61 });
61 });62 });
6263
148 }149 }
149 });150 });
150151
151 itEth('Can perform burnFromCross()', async ({helper, privateKey}) => {152 itEth('Can perform burnFromCross()', async ({helper}) => {
152 const owner = await privateKey('//Alice');
153 const sender = await helper.eth.createAccountWithBalance(donor);153 const sender = await helper.eth.createAccountWithBalance(donor, 100n);
154154
155 const collection = await helper.ft.mintCollection(owner, {name: 'A', description: 'B', tokenPrefix: 'C'}, 0);155 const collection = await helper.ft.mintCollection(owner, {name: 'A', description: 'B', tokenPrefix: 'C'}, 0);
156156
261 });261 });
262262
263 itEth('Can perform transferFromCross()', async ({helper, privateKey}) => {263 itEth('Can perform transferFromCross()', async ({helper, privateKey}) => {
264 const owner = await privateKey('//Alice');
265 const sender = await helper.eth.createAccountWithBalance(donor);264 const sender = await helper.eth.createAccountWithBalance(donor, 100n);
266265
267 const collection = await helper.ft.mintCollection(owner, {name: 'A', description: 'B', tokenPrefix: 'C'}, 0);266 const collection = await helper.ft.mintCollection(owner, {name: 'A', description: 'B', tokenPrefix: 'C'}, 0);
268267
365describe('Fungible: Substrate calls', () => {364describe('Fungible: Substrate calls', () => {
366 let donor: IKeyringPair;365 let donor: IKeyringPair;
367 let alice: IKeyringPair;366 let alice: IKeyringPair;
367 let owner: IKeyringPair;
368368
369 before(async function() {369 before(async function() {
370 await usingEthPlaygrounds(async (helper, privateKey) => {370 await usingEthPlaygrounds(async (helper, privateKey) => {
371 donor = await privateKey({filename: __filename});371 donor = await privateKey({filename: __filename});
372 [alice] = await helper.arrange.createAccounts([20n], donor);372 [alice, owner] = await helper.arrange.createAccounts([20n, 20n], donor);
373 });373 });
374 });374 });
375375
455 });455 });
456456
457 itEth('Events emitted for transferFromCross()', async ({helper, privateKey}) => {457 itEth('Events emitted for transferFromCross()', async ({helper, privateKey}) => {
458 const owner = await privateKey('//Alice');
459 const sender = await helper.eth.createAccountWithBalance(donor);458 const sender = await helper.eth.createAccountWithBalance(donor, 100n);
460459
461 const collection = await helper.ft.mintCollection(owner, {name: 'A', description: 'B', tokenPrefix: 'C'}, 0);460 const collection = await helper.ft.mintCollection(owner, {name: 'A', description: 'B', tokenPrefix: 'C'}, 0);
462461
addedtests/src/eth/migration.seqtest.tsdiffbeforeafterboth

no changes

deletedtests/src/eth/migration.test.tsdiffbeforeafterboth

no changes

modifiedtests/src/eth/nonFungible.test.tsdiffbeforeafterboth
138138
139describe('NFT: Plain calls', () => {139describe('NFT: Plain calls', () => {
140 let donor: IKeyringPair;140 let donor: IKeyringPair;
141 let alice: IKeyringPair;141 let minter: IKeyringPair;
142 let bob: IKeyringPair;
143 let charlie: IKeyringPair;
142144
143 before(async function() {145 before(async function() {
144 await usingEthPlaygrounds(async (helper, privateKey) => {146 await usingEthPlaygrounds(async (helper, privateKey) => {
145 donor = await privateKey({filename: __filename});147 donor = await privateKey({filename: __filename});
146 [alice] = await helper.arrange.createAccounts([10n], donor);148 [minter, bob, charlie] = await helper.arrange.createAccounts([100n, 100n, 100n], donor);
147 });149 });
148 });150 });
149151
176 const caller = await helper.eth.createAccountWithBalance(donor);178 const caller = await helper.eth.createAccountWithBalance(donor);
177 const receiver = helper.eth.createAccount();179 const receiver = helper.eth.createAccount();
178180
179 const collection = await helper.nft.mintCollection(alice);181 const collection = await helper.nft.mintCollection(minter);
180 await collection.addAdmin(alice, {Ethereum: caller});182 await collection.addAdmin(minter, {Ethereum: caller});
181183
182 const collectionAddress = helper.ethAddress.fromCollectionId(collection.collectionId);184 const collectionAddress = helper.ethAddress.fromCollectionId(collection.collectionId);
183 const contract = helper.ethNativeContract.collection(collectionAddress, 'nft', caller);185 const contract = helper.ethNativeContract.collection(collectionAddress, 'nft', caller);
208 itEth('Can perform burn()', async ({helper}) => {210 itEth('Can perform burn()', async ({helper}) => {
209 const caller = await helper.eth.createAccountWithBalance(donor);211 const caller = await helper.eth.createAccountWithBalance(donor);
210212
211 const collection = await helper.nft.mintCollection(alice, {});213 const collection = await helper.nft.mintCollection(minter, {});
212 const {tokenId} = await collection.mintToken(alice, {Ethereum: caller});214 const {tokenId} = await collection.mintToken(minter, {Ethereum: caller});
213215
214 const collectionAddress = helper.ethAddress.fromCollectionId(collection.collectionId);216 const collectionAddress = helper.ethAddress.fromCollectionId(collection.collectionId);
215 const contract = helper.ethNativeContract.collection(collectionAddress, 'nft', caller);217 const contract = helper.ethNativeContract.collection(collectionAddress, 'nft', caller);
229 const owner = await helper.eth.createAccountWithBalance(donor);231 const owner = await helper.eth.createAccountWithBalance(donor);
230 const spender = helper.eth.createAccount();232 const spender = helper.eth.createAccount();
231233
232 const collection = await helper.nft.mintCollection(alice, {});234 const collection = await helper.nft.mintCollection(minter, {});
233 const {tokenId} = await collection.mintToken(alice, {Ethereum: owner});235 const {tokenId} = await collection.mintToken(minter, {Ethereum: owner});
234236
235 const collectionAddress = helper.ethAddress.fromCollectionId(collection.collectionId);237 const collectionAddress = helper.ethAddress.fromCollectionId(collection.collectionId);
236 const contract = helper.ethNativeContract.collection(collectionAddress, 'nft', owner);238 const contract = helper.ethNativeContract.collection(collectionAddress, 'nft', owner);
246 }248 }
247 });249 });
248250
249 itEth('Can perform burnFromCross()', async ({helper, privateKey}) => {251 itEth('Can perform burnFromCross()', async ({helper}) => {
250 const minter = await privateKey('//Alice');
251 const collection = await helper.nft.mintCollection(minter, {name: 'A', description: 'B', tokenPrefix: 'C'});252 const collection = await helper.nft.mintCollection(minter, {name: 'A', description: 'B', tokenPrefix: 'C'});
252253
253 const owner = await privateKey('//Bob');254 const owner = bob;
254 const spender = await helper.eth.createAccountWithBalance(donor);255 const spender = await helper.eth.createAccountWithBalance(donor, 100n);
255256
256 const token = await collection.mintToken(minter, {Substrate: owner.address});257 const token = await collection.mintToken(minter, {Substrate: owner.address});
257258
276 }277 }
277 });278 });
278279
279 itEth('Can perform approveCross()', async ({helper, privateKey}) => {280 itEth('Can perform approveCross()', async ({helper}) => {
280 const minter = await privateKey('//Alice');
281 const collection = await helper.nft.mintCollection(minter, {name: 'A', description: 'B', tokenPrefix: 'C'});281 const collection = await helper.nft.mintCollection(minter, {name: 'A', description: 'B', tokenPrefix: 'C'});
282282
283 const owner = await helper.eth.createAccountWithBalance(donor);283 const owner = await helper.eth.createAccountWithBalance(donor, 100n);
284 const receiver = await privateKey('//Charlie');284 const receiver = charlie;
285285
286 const token = await collection.mintToken(minter, {Ethereum: owner});286 const token = await collection.mintToken(minter, {Ethereum: owner});
287287
309 const spender = await helper.eth.createAccountWithBalance(donor);309 const spender = await helper.eth.createAccountWithBalance(donor);
310 const receiver = helper.eth.createAccount();310 const receiver = helper.eth.createAccount();
311311
312 const collection = await helper.nft.mintCollection(alice, {});312 const collection = await helper.nft.mintCollection(minter, {});
313 const {tokenId} = await collection.mintToken(alice, {Ethereum: owner});313 const {tokenId} = await collection.mintToken(minter, {Ethereum: owner});
314314
315 const collectionAddress = helper.ethAddress.fromCollectionId(collection.collectionId);315 const collectionAddress = helper.ethAddress.fromCollectionId(collection.collectionId);
316 const contract = helper.ethNativeContract.collection(collectionAddress, 'nft', owner);316 const contract = helper.ethNativeContract.collection(collectionAddress, 'nft', owner);
373 });373 });
374374
375 itEth('Can perform transfer()', async ({helper}) => {375 itEth('Can perform transfer()', async ({helper}) => {
376 const collection = await helper.nft.mintCollection(alice, {});376 const collection = await helper.nft.mintCollection(minter, {});
377 const owner = await helper.eth.createAccountWithBalance(donor);377 const owner = await helper.eth.createAccountWithBalance(donor);
378 const receiver = helper.eth.createAccount();378 const receiver = helper.eth.createAccount();
379379
380 const {tokenId} = await collection.mintToken(alice, {Ethereum: owner});380 const {tokenId} = await collection.mintToken(minter, {Ethereum: owner});
381381
382 const collectionAddress = helper.ethAddress.fromCollectionId(collection.collectionId);382 const collectionAddress = helper.ethAddress.fromCollectionId(collection.collectionId);
383 const contract = helper.ethNativeContract.collection(collectionAddress, 'nft', owner);383 const contract = helper.ethNativeContract.collection(collectionAddress, 'nft', owner);
407describe('NFT: Fees', () => {407describe('NFT: Fees', () => {
408 let donor: IKeyringPair;408 let donor: IKeyringPair;
409 let alice: IKeyringPair;409 let alice: IKeyringPair;
410 let bob: IKeyringPair;
411 let charlie: IKeyringPair;
410412
411 before(async function() {413 before(async function() {
412 await usingEthPlaygrounds(async (helper, privateKey) => {414 await usingEthPlaygrounds(async (helper, privateKey) => {
413 donor = await privateKey({filename: __filename});415 donor = await privateKey({filename: __filename});
414 [alice] = await helper.arrange.createAccounts([10n], donor);416 [alice, bob, charlie] = await helper.arrange.createAccounts([10n, 10n, 10n], donor);
415 });417 });
416 });418 });
417419
443 expect(cost < BigInt(0.2 * Number(helper.balance.getOneTokenNominal())));445 expect(cost < BigInt(0.2 * Number(helper.balance.getOneTokenNominal())));
444 });446 });
447
448 itEth('Can perform transferFromCross()', async ({helper, privateKey}) => {
449 const collectionMinter = alice;
450 const owner = bob;
451 const receiver = charlie;
452 const collection = await helper.nft.mintCollection(collectionMinter, {name: 'A', description: 'B', tokenPrefix: 'C'});
453
454 const spender = await helper.eth.createAccountWithBalance(donor, 100n);
455
456 const token = await collection.mintToken(collectionMinter, {Substrate: owner.address});
457
458 const address = helper.ethAddress.fromCollectionId(collection.collectionId);
459 const contract = helper.ethNativeContract.collection(address, 'nft');
460
461 await token.approve(owner, {Ethereum: spender});
462
463 {
464 const ownerCross = helper.ethCrossAccount.fromKeyringPair(owner);
465 const recieverCross = helper.ethCrossAccount.fromKeyringPair(receiver);
466 const result = await contract.methods.transferFromCross(ownerCross, recieverCross, token.tokenId).send({from: spender});
467 const event = result.events.Transfer;
468 expect(event).to.be.like({
469 address: helper.ethAddress.fromCollectionId(collection.collectionId),
470 event: 'Transfer',
471 returnValues: {
472 from: helper.address.substrateToEth(owner.address),
473 to: helper.address.substrateToEth(receiver.address),
474 tokenId: token.tokenId.toString(),
475 },
476 });
477 }
478
479 expect(await token.getOwner()).to.be.like({Substrate: receiver.address});
480 });
445481
446 itEth('transfer() call fee is less than 0.2UNQ', async ({helper}) => {482 itEth('transfer() call fee is less than 0.2UNQ', async ({helper}) => {
447 const owner = await helper.eth.createAccountWithBalance(donor);483 const owner = await helper.eth.createAccountWithBalance(donor);
modifiedtests/src/eth/reFungible.test.tsdiffbeforeafterboth
104104
105describe('Refungible: Plain calls', () => {105describe('Refungible: Plain calls', () => {
106 let donor: IKeyringPair;106 let donor: IKeyringPair;
107 let minter: IKeyringPair;
108 let bob: IKeyringPair;
109 let charlie: IKeyringPair;
107110
108 before(async function() {111 before(async function() {
109 await usingEthPlaygrounds(async (helper, privateKey) => {112 await usingEthPlaygrounds(async (helper, privateKey) => {
110 requirePalletsOrSkip(this, helper, [Pallets.ReFungible]);113 requirePalletsOrSkip(this, helper, [Pallets.ReFungible]);
111114
112 donor = await privateKey({filename: __filename});115 donor = await privateKey({filename: __filename});
116 [minter, bob, charlie] = await helper.arrange.createAccounts([100n, 100n, 100n], donor);
113 });117 });
114 });118 });
115119
227 }231 }
228 });232 });
229233
230 itEth('Can perform burnFrom()', async ({helper, privateKey}) => {234 itEth('Can perform burnFrom()', async ({helper}) => {
231 const minter = await privateKey('//Alice');
232 const collection = await helper.rft.mintCollection(minter, {name: 'A', description: 'B', tokenPrefix: 'C'});235 const collection = await helper.rft.mintCollection(minter, {name: 'A', description: 'B', tokenPrefix: 'C'});
233236
234 const owner = await helper.eth.createAccountWithBalance(donor);237 const owner = await helper.eth.createAccountWithBalance(donor, 100n);
235 const spender = await helper.eth.createAccountWithBalance(donor);238 const spender = await helper.eth.createAccountWithBalance(donor, 100n);
236239
237 const token = await collection.mintToken(minter, 100n, {Ethereum: owner});240 const token = await collection.mintToken(minter, 100n, {Ethereum: owner});
238241
261 expect(await collection.getTokenBalance(token.tokenId, {Ethereum: owner})).to.be.eq(0n);264 expect(await collection.getTokenBalance(token.tokenId, {Ethereum: owner})).to.be.eq(0n);
262 });265 });
263266
264 itEth('Can perform burnFromCross()', async ({helper, privateKey}) => {267 itEth('Can perform burnFromCross()', async ({helper}) => {
265 const minter = await privateKey('//Alice');
266 const collection = await helper.rft.mintCollection(minter, {name: 'A', description: 'B', tokenPrefix: 'C'});268 const collection = await helper.rft.mintCollection(minter, {name: 'A', description: 'B', tokenPrefix: 'C'});
267269
268 const owner = await privateKey('//Bob');270 const owner = bob;
269 const spender = await helper.eth.createAccountWithBalance(donor);271 const spender = await helper.eth.createAccountWithBalance(donor, 100n);
270272
271 const token = await collection.mintToken(minter, 100n, {Substrate: owner.address});273 const token = await collection.mintToken(minter, 100n, {Substrate: owner.address});
272274
294 expect(await collection.getTokenBalance(token.tokenId, {Substrate: owner.address})).to.be.eq(0n);296 expect(await collection.getTokenBalance(token.tokenId, {Substrate: owner.address})).to.be.eq(0n);
295 });297 });
296298
297 itEth('Can perform transferFromCross()', async ({helper, privateKey}) => {299 itEth('Can perform transferFromCross()', async ({helper}) => {
298 const minter = await privateKey('//Alice');
299 const collection = await helper.rft.mintCollection(minter, {name: 'A', description: 'B', tokenPrefix: 'C'});300 const collection = await helper.rft.mintCollection(minter, {name: 'A', description: 'B', tokenPrefix: 'C'});
300301
301 const owner = await privateKey('//Bob');302 const owner = bob;
302 const spender = await helper.eth.createAccountWithBalance(donor);303 const spender = await helper.eth.createAccountWithBalance(donor, 100n);
303 const receiver = await privateKey('//Charlie');304 const receiver = charlie;
304305
305 const token = await collection.mintToken(minter, 100n, {Substrate: owner.address});306 const token = await collection.mintToken(minter, 100n, {Substrate: owner.address});
306307
modifiedtests/src/eth/scheduling.test.tsdiffbeforeafterboth
27 });27 });
2828
29 itEth.ifWithPallets('Successfully schedules and periodically executes an EVM contract', [Pallets.Scheduler], async ({helper, privateKey}) => {29 itEth.ifWithPallets('Successfully schedules and periodically executes an EVM contract', [Pallets.Scheduler], async ({helper, privateKey}) => {
30 const alice = await privateKey('//Alice');30 const donor = await privateKey({filename: __filename});
31 const [alice] = await helper.arrange.createAccounts([1000n], donor);
3132
32 const scheduledId = await helper.arrange.makeScheduledId();33 const scheduledId = await helper.arrange.makeScheduledId();
3334
addedtests/src/inflation.seqtest.tsdiffbeforeafterboth

no changes

deletedtests/src/inflation.test.tsdiffbeforeafterboth

no changes

addedtests/src/scheduler.seqtest.tsdiffbeforeafterboth

no changes

deletedtests/src/scheduler.test.tsdiffbeforeafterboth

no changes

modifiedtests/src/util/playgrounds/unique.dev.tsdiffbeforeafterboth
422 return promise;422 return promise;
423 }423 }
424424
425 async forParachainBlockNumber(blockNumber: bigint, timeout?: number) {425 async forParachainBlockNumber(blockNumber: bigint | number, timeout?: number) {
426 timeout = timeout ?? 300_000;426 timeout = timeout ?? 30 * 60 * 1000;
427 // eslint-disable-next-line no-async-promise-executor427 // eslint-disable-next-line no-async-promise-executor
428 const promise = new Promise<void>(async (resolve) => {428 const promise = new Promise<void>(async (resolve) => {
429 const unsubscribe = await this.helper.getApi().rpc.chain.subscribeNewHeads((data: any) => {429 const unsubscribe = await this.helper.getApi().rpc.chain.subscribeNewHeads((data: any) => {
437 return promise;437 return promise;
438 }438 }
439 439
440 async forRelayBlockNumber(blockNumber: bigint, timeout?: number) {440 async forRelayBlockNumber(blockNumber: bigint | number, timeout?: number) {
441 timeout = timeout ?? 300_000;441 timeout = timeout ?? 30 * 60 * 1000;
442 // eslint-disable-next-line no-async-promise-executor442 // eslint-disable-next-line no-async-promise-executor
443 const promise = new Promise<void>(async (resolve) => {443 const promise = new Promise<void>(async (resolve) => {
444 const unsubscribe = await this.helper.getApi().query.parachainSystem.validationData((data: any) => {444 const unsubscribe = await this.helper.getApi().query.parachainSystem.validationData((data: any) => {