Skip to content
This repository was archived by the owner on Mar 18, 2025. It is now read-only.

Commit 24b4c95

Browse files
committed
fix elected info
1 parent 2439db1 commit 24b4c95

File tree

3 files changed

+166
-164
lines changed

3 files changed

+166
-164
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@
104104
"@bull-board/koa": "^5.15.0",
105105
"@koa/router": "^12.0.1",
106106
"@octokit/rest": "^20.0.2",
107-
"@polkadot/api": "^10.12.2",
107+
"@polkadot/api": "^11.0.2",
108108
"@polkadot/keyring": "^12.6.2",
109109
"@types/cron": "^2.4.0",
110110
"@types/jest": "^29.5.12",

packages/common/src/scorekeeper/NumNominations.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,15 +65,17 @@ export const autoNumNominations = async (
6565
);
6666

6767
// Query the staking info of the validator set
68-
const query = await api?.derive.staking.electedInfo();
69-
const { info } = query;
68+
const { info } = await api?.derive.staking.electedInfo({
69+
withExposureMeta: true,
70+
});
7071

7172
const totalStakeAmounts = [];
7273

7374
// add formatted totals to list
7475
for (const validator of info) {
75-
const { exposure } = validator;
76-
const { total, own, others } = exposure;
76+
const { exposureMeta } = validator;
77+
if (!exposureMeta?.isSome) continue;
78+
const { total } = exposureMeta.value;
7779

7880
const totalValue = total.unwrap();
7981

0 commit comments

Comments
 (0)