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

difftreelog

test(util) fix linting warnings

Fahrrader2022-09-05parent: #dbce17d.patch.diff
in: master

2 files changed

modifiedtests/src/util/playgrounds/unique.dev.tsdiffbeforeafterboth
99
1010
11export class SilentLogger {11export class SilentLogger {
12 log(msg: any, level: any): void { }12 log(_msg: any, _level: any): void { }
13 level = {13 level = {
14 ERROR: 'ERROR' as const,14 ERROR: 'ERROR' as const,
15 WARNING: 'WARNING' as const,15 WARNING: 'WARNING' as const,
34 enable() { 34 enable() {
35 const outFn = (printer: any) => (...args: any[]) => {35 const outFn = (printer: any) => (...args: any[]) => {
36 for (const arg of args) {36 for (const arg of args) {
37 for (const arg of args) {
38 if (typeof arg !== 'string')37 if (typeof arg !== 'string')
39 continue;38 continue;
40 if (arg.includes('1000:: Normal connection closure') || arg.includes('Not decorating unknown runtime apis: UniqueApi/2, RmrkApi/1') || arg.includes('RPC methods not decorated:') || arg === 'Normal connection closure')39 if (arg.includes('1000:: Normal connection closure') || arg.includes('Not decorating unknown runtime apis: UniqueApi/2, RmrkApi/1') || arg.includes('RPC methods not decorated:') || arg === 'Normal connection closure')
41 return;40 return;
42 }
43 }41 }
44 printer(...args);42 printer(...args);
45 };43 };
68 this.arrange = new ArrangeGroup(this);66 this.arrange = new ArrangeGroup(this);
69 }67 }
7068
71 async connect(wsEndpoint: string, listeners?: any): Promise<void> {69 async connect(wsEndpoint: string/*, listeners?: any*/): Promise<void> {
72 const wsProvider = new WsProvider(wsEndpoint);70 const wsProvider = new WsProvider(wsEndpoint);
73 this.api = new ApiPromise({71 this.api = new ApiPromise({
74 provider: wsProvider,72 provider: wsProvider,
133 }131 }
134 }132 }
135133
136 await Promise.all(transactions).catch(e => {});134 await Promise.all(transactions).catch(_e => {});
137 135
138 //#region TODO remove this region, when nonce problem will be solved136 //#region TODO remove this region, when nonce problem will be solved
139 const checkBalances = async () => {137 const checkBalances = async () => {
169 * @returns 167 * @returns
170 */168 */
171 async waitNewBlocks(blocksCount = 1): Promise<void> {169 async waitNewBlocks(blocksCount = 1): Promise<void> {
170 // eslint-disable-next-line no-async-promise-executor
172 const promise = new Promise<void>(async (resolve) => {171 const promise = new Promise<void>(async (resolve) => {
173 const unsubscribe = await this.helper.api!.rpc.chain.subscribeNewHeads(() => {172 const unsubscribe = await this.helper.api!.rpc.chain.subscribeNewHeads(() => {
174 if (blocksCount > 0) {173 if (blocksCount > 0) {
modifiedtests/src/util/playgrounds/unique.tsdiffbeforeafterboth
317 if(options !== null) return transaction.signAndSend(sender, options, callback);317 if(options !== null) return transaction.signAndSend(sender, options, callback);
318 return transaction.signAndSend(sender, callback);318 return transaction.signAndSend(sender, callback);
319 };319 };
320 // eslint-disable-next-line no-async-promise-executor
320 return new Promise(async (resolve, reject) => {321 return new Promise(async (resolve, reject) => {
321 try {322 try {
322 const unsub = await sign((result: any) => {323 const unsub = await sign((result: any) => {
1100 return this.getCollectionObject(this.helper.util.extractCollectionIdFromCreationResult(creationResult, errorLabel));1101 return this.getCollectionObject(this.helper.util.extractCollectionIdFromCreationResult(creationResult, errorLabel));
1101 }1102 }
11021103
1103 getCollectionObject(collectionId: number): any {1104 getCollectionObject(_collectionId: number): any {
1104 return null;1105 return null;
1105 }1106 }
11061107
1107 getTokenObject(collectionId: number, tokenId: number): any {1108 getTokenObject(_collectionId: number, _tokenId: number): any {
1108 return null;1109 return null;
1109 }1110 }
1110}1111}