Joystream Stats 2 年 前
コミット
6aa2fe5625
4 ファイル変更5 行追加22 行削除
  1. 4 17
      api.ts
  2. 0 2
      content.ts
  3. 1 2
      index.ts
  4. 0 1
      storage.ts

+ 4 - 17
api.ts

@@ -4,7 +4,6 @@ import moment from "moment";
 // types
 import { AccountBalance, ElectionInfo, Round, ProposalDetail } from "./types";
 import { Option, u32, u64, Vec, StorageKey } from "@polkadot/types";
-import type { Codec, Observable } from "@polkadot/types/types";
 import {
   AccountId,
   AccountInfo,
@@ -15,26 +14,14 @@ import {
   EventRecord,
   Exposure,
   Hash,
-  Moment,
 } from "@polkadot/types/interfaces";
 import { SignedBlock } from "@polkadot/types/interfaces/runtime";
 import { types } from "@joystream/types";
 import { MemberId, PostId, ThreadId } from "@joystream/types/common";
 import { CategoryId, Category, Thread, Post } from "@joystream/types/forum";
-import {
-  Candidate,
-  CouncilMember,
-  CouncilStage,
-} from "@joystream/types/council";
+import { CouncilStage } from "@joystream/types/council";
 import { Membership } from "@joystream/types/members";
-import {
-  Proposal,
-  ProposalId,
-  ProposalCreationParameters,
-  DiscussionPost,
-  SpendingParams,
-  VoteKind,
-} from "@joystream/types/proposals";
+import { ProposalId, DiscussionPost } from "@joystream/types/proposals";
 import { WorkerId, Worker } from "@joystream/types/working-group";
 import { ProposalOf, ProposalDetailsOf } from "@joystream/types/augment/types";
 
@@ -384,8 +371,8 @@ export const getProposal = async (
     status,
     votingResults,
     exactExecutionBlock,
-    nrOfCouncilConfirmations,
-    stakingAccountId,
+    //nrOfCouncilConfirmations,
+    //stakingAccountId,
   } = proposal;
   const stage: string = status.isActive ? "Active" : "Finalized";
   const member: Membership = await getMember(api, proposerId);

+ 0 - 2
content.ts

@@ -7,8 +7,6 @@ import {
   ChannelCategoryId,
   Video,
   VideoId,
-  VideoCategory,
-  VideoCategoryId,
 } from "@joystream/types/content";
 import { ChannelId } from "@joystream/types/storage";
 import { Hash } from "@polkadot/types/interfaces";

+ 1 - 2
index.ts

@@ -1,5 +1,4 @@
 import { CacheEvent } from "./types";
-import { Moment } from "@polkadot/types/interfaces";
 
 export const sum = (a: number[]) =>
   a.reduce((s: number, i: number) => s + i, 0);
@@ -17,7 +16,7 @@ export const eventStats = (blockEventsCache: Map<number, CacheEvent[]>) => {
     [key: string]: { [key: string]: [{ key: number; data: any }] };
   } = {};
   for (let [key, blockEvents] of blockEventsCache) {
-    blockEvents.map(({ section, method, data }) => {
+    blockEvents.forEach(({ section, method, data }) => {
       if (!sections[section]) sections[section] = {};
       if (sections[section][method])
         sections[section][method].push({ key, data });

+ 0 - 1
storage.ts

@@ -1,5 +1,4 @@
 import { ApiPromise } from "@polkadot/api";
-import type { ITuple } from "@polkadot/types/types";
 import {
   Bag,
   BagId,