Adjust logic location for skipRewards (#7795)

This commit is contained in:
Jaco 2022-06-24 16:54:40 +02:00 committed by GitHub
parent f3e9f2cd00
commit 53ceec4f30
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -131,12 +131,12 @@ function extractSingle (api: ApiPromise, allAccounts: string[], derive: DeriveSt
? [exposure.own.unwrap(), exposure.total.unwrap()]
: [BN_ZERO, BN_ZERO];
if (bondTotal.isZero()) {
const skipRewards = bondTotal.isZero();
if (skipRewards) {
bondTotal = bondOwn = stakingLedger.total?.unwrap() || BN_ZERO;
}
const skipRewards = bondTotal.isZero();
// some overrides (e.g. Darwinia Crab) does not have the value field in IndividualExposure
const minNominated = (exposure.others || []).reduce((min: BN, { value = api.createType('Compact<Balance>') }): BN => {
const actual = value.unwrap();