Skip to content

Commit

Permalink
Use entity address to handle validators fallback
Browse files Browse the repository at this point in the history
  • Loading branch information
buberdds committed Nov 5, 2024
1 parent b7b4eb7 commit 6799266
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions .changelog/2078.internal.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Use entity address to handle validators fallback
8 changes: 4 additions & 4 deletions src/app/state/staking/saga.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,17 +124,17 @@ function* getFallbackValidators(network: NetworkType, errorApi: Error) {
}

// Fall back to dump_validators with refreshed validators' status from RPC
const activeNodes: { [nodeAddress: string]: true } = {}
const activeNodes: { [address: string]: true } = {}
for (const rpcValidator of rpcActiveValidators) {
const nodeAddress = yield* call(publicKeyToAddress, rpcValidator.id)
activeNodes[nodeAddress] = true
const address = yield* call(publicKeyToAddress, rpcValidator.entity_id)
activeNodes[address] = true
}
fallbackValidators = {
...fallbackValidators,
list: fallbackValidators.list.map(v => {
return {
...v,
status: activeNodes[v.nodeAddress] ? ('active' as const) : ('inactive' as const),
status: activeNodes[v.address] ? ('active' as const) : ('inactive' as const),
}
}),
}
Expand Down

0 comments on commit 6799266

Please sign in to comment.