Skip to content

Commit

Permalink
[frenemies] use real-time staking info
Browse files Browse the repository at this point in the history
  • Loading branch information
sblackshear committed Feb 8, 2023
1 parent 8cae774 commit e333a6f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions dapps/frenemies/src/components/Assignment/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,9 @@ export function Assignment() {
if (!assignedValidator) return null;

const name = assignedValidator.fields.metadata.fields.name as string;
const selfStake = BigInt(assignedValidator.fields.metadata.fields.next_epoch_stake);
const delegatedStake =
+assignedValidator.fields.delegation_staking_pool.fields.sui_balance;
const selfStake = +assignedValidator.fields.stake_amount;
BigInt(assignedValidator.fields.metadata.fields.next_epoch_delegation);
const totalStake = selfStake + delegatedStake;

const isInRank = getIsInRank(assignment.goal, assignedValidatorIndex!);
Expand Down
4 changes: 2 additions & 2 deletions dapps/frenemies/src/components/Validators/Validator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ export function ValidatorItem({ index, validator, stake, delegation }: Props) {
};

const delegatedStake =
+validator.fields.delegation_staking_pool.fields.sui_balance;
const selfStake = +validator.fields.stake_amount;
BigInt(validator.fields.metadata.fields.next_epoch_delegation);
const selfStake = BigInt(validator.fields.metadata.fields.next_epoch_stake);
const totalStake = selfStake + delegatedStake;

return (
Expand Down

0 comments on commit e333a6f

Please sign in to comment.