Update packages/stargate/src/stargateclient.ts

Co-authored-by: Simon Warta <2603011+webmaster128@users.noreply.github.com>
This commit is contained in:
Milan Steiner 2022-04-13 12:43:42 +02:00 committed by GitHub
parent 194c922339
commit 342210aac8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -289,6 +289,7 @@ export class StargateClient {
const sumValues = allDelegations.reduce(
(previousValue: Coin | null, currentValue: DelegationResponse): Coin => {
// Safe because field is set to non-nullable (https://github.com/cosmos/cosmos-sdk/blob/v0.45.3/proto/cosmos/staking/v1beta1/staking.proto#L295)
assert(currentValue.balance);
return previousValue !== null
? this.addCoins(previousValue, currentValue.balance)