Browse Source

Remove content-directory and media from checks and fix ts errors

Leszek Wiesner 4 years ago
parent
commit
c22db57d3e
4 changed files with 9 additions and 19 deletions
  1. 3 0
      cli/.eslintignore
  2. 0 18
      cli/src/Api.ts
  3. 1 1
      cli/src/base/ApiCommandBase.ts
  4. 5 0
      cli/tsconfig.json

+ 3 - 0
cli/.eslintignore

@@ -1,2 +1,5 @@
 /lib
+# Temporarly ignore before merging `Sumer`
+/src/commands/media
+/src/commands/content-directory
 .eslintrc.js

+ 0 - 18
cli/src/Api.ts

@@ -33,7 +33,6 @@ import { Class, ClassId, CuratorGroup, CuratorGroupId, Entity, EntityId } from '
 import { ContentId, DataObject } from '@joystream/types/media'
 import { ServiceProviderRecord } from '@joystream/types/discovery'
 import _ from 'lodash'
-import ExitCodes from './ExitCodes'
 
 export const DEFAULT_API_URI = 'ws://localhost:9944/'
 const DEFAULT_DECIMALS = new BN(12)
@@ -90,23 +89,6 @@ export default class Api {
     return new Api(api, chainType.isDevelopment || chainType.isLocal)
   }
 
-  private queryMultiOnce(queries: Parameters<typeof ApiPromise.prototype.queryMulti>[0]): Promise<Codec[]> {
-    return new Promise((resolve, reject) => {
-      let unsub: () => void
-      this._api
-        .queryMulti(queries, (res) => {
-          // unsub should already be set at this point
-          if (!unsub) {
-            reject(new CLIError('API queryMulti issue - unsub method not set!', { exit: ExitCodes.ApiError }))
-          }
-          unsub()
-          resolve(res)
-        })
-        .then((unsubscribe) => (unsub = unsubscribe))
-        .catch((e) => reject(e))
-    })
-  }
-
   async bestNumber(): Promise<number> {
     return (await this._api.derive.chain.bestNumber()).toNumber()
   }

+ 1 - 1
cli/src/base/ApiCommandBase.ts

@@ -430,7 +430,7 @@ export default abstract class ApiCommandBase extends StateAwareCommandBase {
     if (Array.isArray(p)) {
       return p.map((v) => this.humanize(v))
     } else if (typeof p === 'object' && p !== null) {
-      if ((p as Codec).toHuman) {
+      if ((p as any).toHuman) {
         return (p as Codec).toHuman()
       } else if (p instanceof BN) {
         return p.toString()

+ 5 - 0
cli/tsconfig.json

@@ -20,5 +20,10 @@
   },
   "include": [
     "src/**/*"
+  ],
+  /* Temporary exclude before merging `Sumer` */
+  "exclude": [
+    "src/commands/content-directory/*",
+    "src/commands/media/*"
   ]
 }