Skip to content

Commit

Permalink
fix: Ensure Account is instantiated with valid accountId
Browse files Browse the repository at this point in the history
`getValidators` creates an `Account` with the passed `accountId` to call
view methods on the validator contracts. Now that this `Account` is 2FA
aware (#2680), it will also call `account.state()` to check if the
current account has 2FA enabled. This call will fail if the original
`accountId` is `undefined`, which `exAccountId` sometimes is. This PR
updates `getValidators()` call to use `accountId` which is known to
exist.
  • Loading branch information
morgsmccauley committed May 23, 2022
1 parent b3a8061 commit 7e9fc20
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/frontend/src/redux/actions/staking.js
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,7 @@ export const handleStakingUpdateAccount = (recentlyStakedValidators = [], exAcco
const validatorDepositMap = await getStakingDeposits(accountId);

if (!selectStakingAllValidatorsLength(getState())) {
await dispatch(staking.getValidators(null, exAccountId));
await dispatch(staking.getValidators(null, accountId));
}

const validators = selectStakingAllValidators(getState())
Expand Down

0 comments on commit 7e9fc20

Please sign in to comment.