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
--- a/tests/src/util/playgrounds/unique.dev.ts
+++ b/tests/src/util/playgrounds/unique.dev.ts
@@ -9,7 +9,7 @@
 
 
 export class SilentLogger {
-  log(msg: any, level: any): void { }
+  log(_msg: any, _level: any): void { }
   level = {
     ERROR: 'ERROR' as const,
     WARNING: 'WARNING' as const,
@@ -34,12 +34,10 @@
   enable() {  
     const outFn = (printer: any) => (...args: any[]) => {
       for (const arg of args) {
-        for (const arg of args) {
-          if (typeof arg !== 'string')
-            continue;
-          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')
-            return;
-        }
+        if (typeof arg !== 'string')
+          continue;
+        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')
+          return;
       }
       printer(...args);
     };
@@ -68,7 +66,7 @@
     this.arrange = new ArrangeGroup(this);
   }
 
-  async connect(wsEndpoint: string, listeners?: any): Promise<void> {
+  async connect(wsEndpoint: string/*, listeners?: any*/): Promise<void> {
     const wsProvider = new WsProvider(wsEndpoint);
     this.api = new ApiPromise({
       provider: wsProvider,
@@ -133,7 +131,7 @@
       }
     }
 
-    await Promise.all(transactions).catch(e => {});
+    await Promise.all(transactions).catch(_e => {});
     
     //#region TODO remove this region, when nonce problem will be solved
     const checkBalances = async () => {
@@ -162,13 +160,14 @@
 
     return accounts;
   };
-
+ 
   /**
    * Wait for specified bnumber of blocks
    * @param blocksCount number of blocks to wait
    * @returns 
    */
   async waitNewBlocks(blocksCount = 1): Promise<void> {
+    // eslint-disable-next-line no-async-promise-executor
     const promise = new Promise<void>(async (resolve) => {
       const unsubscribe = await this.helper.api!.rpc.chain.subscribeNewHeads(() => {
         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}