Skip to content

Commit

Permalink
resolve TODO, add votersCount
Browse files Browse the repository at this point in the history
  • Loading branch information
oXtxNt9U committed Oct 17, 2024
1 parent 282a6ea commit 2e97fc6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/api-sync/source/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ export class Sync implements Contracts.ApiSync.Service {
validatorPublicKey: dirtyValidator.blsPublicKey,
validatorResigned: dirtyValidator.isResigned,
validatorVoteBalance: dirtyValidator.voteBalance,
validatorVotersCount: dirtyValidator.votersCount,
// updated at end of db transaction
// - validatorRank
// - validatorApproval
Expand Down Expand Up @@ -497,6 +498,8 @@ export class Sync implements Contracts.ApiSync.Service {
COALESCE(EXCLUDED.attributes->'validatorResigned', "Wallet".attributes->'validatorResigned'),
'validatorVoteBalance',
COALESCE((EXCLUDED.attributes->>'validatorVoteBalance')::text, ("Wallet".attributes->>'validatorVoteBalance')::text),
'validatorVotersCount',
COALESCE(EXCLUDED.attributes->'validatorVotersCount', "Wallet".attributes->'validatorVotersCount'),
'validatorLastBlock',
COALESCE(EXCLUDED.attributes->>'validatorLastBlock', "Wallet".attributes->>'validatorLastBlock'),
'validatorForgedFees',
Expand All @@ -512,7 +515,6 @@ export class Sync implements Contracts.ApiSync.Service {
);
}

// TODO: only update when round changes?
await entityManager.query("SELECT update_validator_ranks();", []);
});

Expand Down

0 comments on commit 2e97fc6

Please sign in to comment.