Overrides types for Crab, Darwinia (#4543)

This commit is contained in:
WoeOm 2021-01-30 15:41:22 +08:00 committed by GitHub
parent b043d7de13
commit 1af085e642
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -89,7 +89,8 @@ function extractSingle (api: ApiPromise, allAccounts: string[], derive: DeriveSt
? [exposure.own.unwrap(), exposure.total.unwrap()]
: [BN_ZERO, BN_ZERO];
const skipRewards = bondTotal.isZero();
const minNominated = (exposure.others || []).reduce((min: BN, { value }): BN => {
// 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();
return min.isZero() || actual.lt(min)