From 90f067183567d07c5fb4da4d9c4c0da5ae7f85de Mon Sep 17 00:00:00 2001 From: Alessio Onori Date: Fri, 28 Jun 2024 09:21:51 +0200 Subject: [PATCH] console.time --- charts/polkadot-k8s-payouts/Chart.yaml | 4 ++-- package.json | 2 +- src/claimer.ts | 6 ++++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/charts/polkadot-k8s-payouts/Chart.yaml b/charts/polkadot-k8s-payouts/Chart.yaml index 9b0a10c..50b02bb 100644 --- a/charts/polkadot-k8s-payouts/Chart.yaml +++ b/charts/polkadot-k8s-payouts/Chart.yaml @@ -1,5 +1,5 @@ description: Polkadot K8s Payouts name: polkadot-k8s-payouts -version: v1.2.12 -appVersion: v1.2.12 +version: v1.2.13 +appVersion: v1.2.13 apiVersion: v2 diff --git a/package.json b/package.json index 536459c..c530c51 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "polkadot-payouts", - "version": "1.2.12", + "version": "1.2.13", "description": "Automated transfers among accounts", "repository": "git@github.com:w3f/accountant.git", "author": "W3F Infrastructure Team ", diff --git a/src/claimer.ts b/src/claimer.ts index a5246f1..4ecc9dc 100644 --- a/src/claimer.ts +++ b/src/claimer.ts @@ -108,9 +108,11 @@ export class Claimer { } + console.time("gatherUnclaimedInfo") for (const [address, validatorInfo] of validatorsMap) { await this.gatherUnclaimedInfo(address,validatorInfo) } + console.timeEnd("gatherUnclaimedInfo") return validatorsMap } @@ -146,7 +148,7 @@ export class Claimer { const claimedIdx: Set = new Set - console.time("stakingQuery") + // console.time("stakingQuery") // const stakingQuery = await this.api.derive.staking.query(validatorAddress,{withLedger:true, withClaimedRewardsEras: false}) //withClaimedRewardsEras: true is heavy apparently => https://github.com/polkadot-js/api/issues/5923 // stakingQuery.stakingLedger.legacyClaimedRewards.forEach(r=>claimedIdx.add(r.toNumber())) // stakingQuery.claimedRewardsEras.forEach(r=>claimedIdx.add(r.toNumber())) @@ -158,7 +160,7 @@ export class Claimer { claimedIdx.add(i) } } - console.timeEnd("stakingQuery") + // console.timeEnd("stakingQuery") const unclaimed: number[] = Array.from(setDifference(ownRewardsIdx,claimedIdx))