浏览代码

Fix checks - remove StorageProviderRecord and run formatter on protobuf library

Leszek Wiesner 3 年之前
父节点
当前提交
0804bfbb34
共有 2 个文件被更改,包括 1 次插入20 次删除
  1. 0 19
      cli/src/Api.ts
  2. 1 1
      content-metadata-protobuf/src/index.ts

+ 0 - 19
cli/src/Api.ts

@@ -60,7 +60,6 @@ import {
   VideoCategoryId,
 } from '@joystream/types/content'
 import { ContentId, DataObject } from '@joystream/types/storage'
-import { ServiceProviderRecord } from '@joystream/types/discovery'
 import _ from 'lodash'
 
 export const DEFAULT_API_URI = 'ws://localhost:9944/'
@@ -577,30 +576,12 @@ export default class Api {
     return dataObject.isEmpty ? null : dataObject
   }
 
-  async ipnsIdentity(storageProviderId: number): Promise<string | null> {
-    const accountInfo = await this._api.query.discovery.accountInfoByStorageProviderId<ServiceProviderRecord>(
-      storageProviderId
-    )
-    return accountInfo.isEmpty || accountInfo.expires_at.toNumber() <= (await this.bestNumber())
-      ? null
-      : accountInfo.identity.toString()
-  }
-
   async getRandomBootstrapEndpoint(): Promise<string | null> {
     const endpoints = await this._api.query.discovery.bootstrapEndpoints<Vec<Url>>()
     const randomEndpoint = _.sample(endpoints.toArray())
     return randomEndpoint ? randomEndpoint.toString() : null
   }
 
-  async isAnyProviderAvailable(): Promise<boolean> {
-    const accounInfoEntries = await this.entriesByIds<StorageProviderId, ServiceProviderRecord>(
-      this._api.query.discovery.accountInfoByStorageProviderId
-    )
-
-    const bestNumber = await this.bestNumber()
-    return !!accounInfoEntries.filter(([, info]) => info.expires_at.toNumber() > bestNumber).length
-  }
-
   async storageProviderEndpoint(storageProviderId: number): Promise<string> {
     const value = await this._api.query.storageWorkingGroup.workerStorage(storageProviderId)
     return this._api.createType('Text', value).toString()

+ 1 - 1
content-metadata-protobuf/src/index.ts

@@ -7,4 +7,4 @@ export * from '../compiled/proto/Video_pb'
 export * from '../compiled/proto/Channel_pb'
 export * from '../compiled/proto/Person_pb'
 export * from '../compiled/proto/Playlist_pb'
-export * from '../compiled/proto/Series_pb'
+export * from '../compiled/proto/Series_pb'