git.delta.rocks / unique-network / refs/commits / 5930cd35155c

difftreelog

tests(util): fix t isDevNoderying to access discarded blocks

Fahrrader2022-10-14parent: #6360d02.patch.diff
in: master

1 file changed

modifiedtests/src/util/playgrounds/unique.dev.tsdiffbeforeafterboth
260 };260 };
261261
262 isDevNode = async () => {262 isDevNode = async () => {
263 let blockNumber = (await this.helper.callRpc('api.query.system.number')).toJSON();
264 if (blockNumber == 0) {
265 await this.helper.wait.newBlocks(1);
266 blockNumber = (await this.helper.callRpc('api.query.system.number')).toJSON();
267 }
263 const block1 = await this.helper.callRpc('api.rpc.chain.getBlock', [await this.helper.callRpc('api.rpc.chain.getBlockHash', [1])]);268 const block2 = await this.helper.callRpc('api.rpc.chain.getBlock', [await this.helper.callRpc('api.rpc.chain.getBlockHash', [blockNumber])]);
264 const block2 = await this.helper.callRpc('api.rpc.chain.getBlock', [await this.helper.callRpc('api.rpc.chain.getBlockHash', [2])]);269 const block1 = await this.helper.callRpc('api.rpc.chain.getBlock', [await this.helper.callRpc('api.rpc.chain.getBlockHash', [blockNumber - 1])]);
265 const findCreationDate = async (block: any) => {270 const findCreationDate = async (block: any) => {
266 const humanBlock = block.toHuman();271 const humanBlock = block.toHuman();
267 let date;272 let date;