Pārlūkot izejas kodu

Merge branch 'fix-imports'

Ricardo Maltez 3 gadi atpakaļ
vecāks
revīzija
d56f5fb983
2 mainītis faili ar 6 papildinājumiem un 5 dzēšanām
  1. 3 2
      api.ts
  2. 3 3
      rewards.ts

+ 3 - 2
api.ts

@@ -45,10 +45,11 @@ import {
 import { WorkerId, Worker } from "@joystream/types/working-group";
 import {
   ProposalOf,
-  ProposalDetailsOf,
-  WorkerOf,
+  ProposalDetailsOf
 } from "@joystream/types/augment/types";
 
+import {WorkerOf, } from "@joystream/types/augment-codec/all";
+
 // blocks
 export const getBlock = (api: ApiPromise, hash: Hash): Promise<SignedBlock> =>
   api.rpc.chain.getBlock(hash);

+ 3 - 3
rewards.ts

@@ -11,7 +11,6 @@ import {
   RewardRelationship,
   RewardRelationshipId,
 } from "@joystream/types/recurring-rewards";
-import { WorkerOf } from "@joystream/types/augment/types";
 
 // lib
 import { getPercent, getTotalMinted } from "./";
@@ -27,6 +26,7 @@ import {
   getValidators,
   getValidatorCount,
 } from "./api";
+import {WorkerOf} from "@joystream/types/augment-codec/all";
 
 export const filterMethods = {
   getBurnedTokens: ({ section, method }: CacheEvent) =>
@@ -75,11 +75,11 @@ export const getWorkerRow = (
   const mtjoy = (mtjoy: number): string => (mtjoy / 1000000).toFixed(1);
 
   const { id, memberId, account, handle, status, reward } = worker;
-  const earnedEnd = reward.total_reward_received.toNumber();
+  const earnedEnd = Number(reward.total_reward_received.toBigInt());
   if (!earnedEnd) return ``;
   const totalEarned = mtjoy(earnedEnd);
   const earnedTerm = mtjoy(earnedEnd - earnedStart);
-  const amount = reward.amount_per_payout.toNumber();
+  const amount = Number(reward.amount_per_payout.toBigInt());
   const rewardPerBlock = (amount / Number(reward.payout_interval)).toFixed();
   const url = `https://pioneer.joystreamstats.live/#/members/${handle}`; // TODO
   // TODO compare earning to term start and show difference