From db139c3da77a90ffc383d9f606ef675f284920ee Mon Sep 17 00:00:00 2001 From: Michael FIG Date: Sat, 27 Jun 2020 19:49:29 -0600 Subject: [PATCH] fix: correct the export process, using a temporary cosmos-sdk patch --- packages/cosmic-swingset/app/export.go | 3 ++- packages/cosmic-swingset/go.mod | 4 ++++ packages/cosmic-swingset/go.sum | 2 ++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/packages/cosmic-swingset/app/export.go b/packages/cosmic-swingset/app/export.go index 687ac1033eb..5c0bfab61bc 100644 --- a/packages/cosmic-swingset/app/export.go +++ b/packages/cosmic-swingset/app/export.go @@ -9,6 +9,7 @@ import ( "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/x/distribution/types" "github.com/cosmos/cosmos-sdk/x/slashing" "github.com/cosmos/cosmos-sdk/x/staking" ) @@ -61,7 +62,7 @@ func (app *AgoricApp) prepForZeroHeightGenesis(ctx sdk.Context, jailWhiteList [] // withdraw all validator commission app.stakingKeeper.IterateValidators(ctx, func(_ int64, val staking.ValidatorI) (stop bool) { _, err := app.distrKeeper.WithdrawValidatorCommission(ctx, val.GetOperator()) - if err != nil { + if err != nil && err != types.ErrNoValidatorCommission { log.Fatal(err) } return false diff --git a/packages/cosmic-swingset/go.mod b/packages/cosmic-swingset/go.mod index feaf59881e4..10e737e5f51 100644 --- a/packages/cosmic-swingset/go.mod +++ b/packages/cosmic-swingset/go.mod @@ -30,3 +30,7 @@ require ( replace github.com/keybase/go-keychain => github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 replace github.com/Agoric/agoric-sdk => ../.. + +// Need this to fix https://github.com/cosmos/cosmos-sdk/issues/6528 +// FIXME: Remove these lines when the bug is fixed upstream in a version we can upgrade to. +replace github.com/cosmos/cosmos-sdk => github.com/agoric-labs/cosmos-sdk v0.0.0-20200628000041-4699b719b4ff diff --git a/packages/cosmic-swingset/go.sum b/packages/cosmic-swingset/go.sum index 39d50e376b6..32fee27d653 100644 --- a/packages/cosmic-swingset/go.sum +++ b/packages/cosmic-swingset/go.sum @@ -35,6 +35,8 @@ github.com/Workiva/go-datastructures v1.0.52 h1:PLSK6pwn8mYdaoaCZEMsXBpBotr4HHn9 github.com/Workiva/go-datastructures v1.0.52/go.mod h1:Z+F2Rca0qCsVYDS8z7bAGm8f3UkzuWYS/oBZz5a7VVA= github.com/aead/siphash v1.0.1/go.mod h1:Nywa3cDsYNNK3gaciGTWPwHt0wlpNV15vwmswBAUSII= github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5/go.mod h1:SkGFH1ia65gfNATL8TAiHDNxPzPdmEL5uirI2Uyuz6c= +github.com/agoric-labs/cosmos-sdk v0.0.0-20200628000041-4699b719b4ff h1:KXDyssuWktP68jBoSQ0oXYPBLA8gGEDzc77zCiqY/3A= +github.com/agoric-labs/cosmos-sdk v0.0.0-20200628000041-4699b719b4ff/go.mod h1:T3u1b0ahtqJpdI2Fk6JcmntR7/YLjMq+J6hZrHPZTzc= github.com/agoric-labs/cosmos-sdk v0.34.4-0.20200428210309-3cf84258cc12 h1:xnDgoo7cqnbvMFXp7QYrNwYPpAe0wtBuVSkG40PHb1U= github.com/agoric-labs/cosmos-sdk v0.34.4-0.20200428210309-3cf84258cc12/go.mod h1:tvCen72hkJxkYT1/CsOaKHjZ4PouX4Isp4w9aRL2K4c= github.com/agoric-labs/cosmos-sdk v0.37.0 h1:y9OTnnORhLHPnfxLIaK4Pv/7Z7KcpnbTxpE5xxWlUUY=