Skip to content

Commit

Permalink
--dry-run flag hard fix; Cosmos-SDK v0.45.8 version bump
Browse files Browse the repository at this point in the history
  • Loading branch information
iTiky committed Sep 8, 2022
1 parent 89d547c commit 6025064
Show file tree
Hide file tree
Showing 4 changed files with 64 additions and 801 deletions.
20 changes: 20 additions & 0 deletions cmd/archwayd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ import (
"github.com/CosmWasm/wasmd/x/wasm"
wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper"
wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types"

"github.com/archway-network/archway/app"
"github.com/archway-network/archway/app/params"
)
Expand Down Expand Up @@ -69,6 +70,15 @@ func NewRootCmd() (*cobra.Command, params.EncodingConfig) {
cmd.SetOut(cmd.OutOrStdout())
cmd.SetErr(cmd.ErrOrStderr())

// This is hard fix for Cosmos SDK v0.45.X (part 1)
// We drop this flag here for it not to be used during clientCtx build below.
// Having the "--dry-run" set, an in-memory Keyring backend is used.
// This backend returns an error for every GetKey (by address / by name) request.
dryRun, _ := cmd.Flags().GetBool(flags.FlagDryRun)
if dryRun {
cmd.Flags().Set(flags.FlagDryRun, "false")
}

initClientCtx, err := client.ReadPersistentCommandFlags(initClientCtx, cmd.Flags())
if err != nil {
return err
Expand All @@ -83,6 +93,16 @@ func NewRootCmd() (*cobra.Command, params.EncodingConfig) {
return err
}

// This is hard fix for Cosmos SDK v0.45.X (part 2)
// 1. We re-set the "--dry-run" flag to its original value.
// 2. We drop the "--keyring-backend" flag.
// This prevents the in-memory Keyring re-creation (override) during the
// client.GetClientTxContext's ReadPersistentCommandFlags sub-call.
if dryRun {
cmd.Flags().Set(flags.FlagDryRun, "true")
cmd.Flags().Set(flags.FlagKeyringBackend, "")
}

return server.InterceptConfigsPreRunHandler(cmd, "", nil)
},
}
Expand Down
20 changes: 11 additions & 9 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ require (
github.com/CosmWasm/wasmd v0.25.0
github.com/CosmWasm/wasmvm v1.0.0
github.com/archway-network/voter v0.0.0-00010101000000-000000000000
github.com/cosmos/cosmos-sdk v0.45.7
github.com/cosmos/cosmos-sdk v0.45.8
github.com/cosmos/ibc-go/v3 v3.1.0
github.com/dvsekhvalnov/jose2go v0.0.0-20200901110807-248326c1351b
github.com/gogo/protobuf v1.3.3
Expand All @@ -21,9 +21,9 @@ require (
github.com/spf13/cobra v1.5.0
github.com/spf13/pflag v1.0.5
github.com/stretchr/testify v1.8.0
github.com/tendermint/tendermint v0.34.20
github.com/tendermint/tendermint v0.34.21
github.com/tendermint/tm-db v0.6.7
google.golang.org/genproto v0.0.0-20220519153652-3a47de7e79bd
google.golang.org/genproto v0.0.0-20220725144611-272f38e5d71b
google.golang.org/grpc v1.48.0
google.golang.org/protobuf v1.28.0
sigs.k8s.io/yaml v1.2.0
Expand All @@ -47,9 +47,10 @@ require (
github.com/cosmos/btcutil v1.0.4 // indirect
github.com/cosmos/go-bip39 v1.0.0 // indirect
github.com/cosmos/gorocksdb v1.2.0 // indirect
github.com/cosmos/iavl v0.19.0 // indirect
github.com/cosmos/iavl v0.19.1 // indirect
github.com/cosmos/ledger-cosmos-go v0.11.1 // indirect
github.com/cosmos/ledger-go v0.9.2 // indirect
github.com/creachadair/taskgroup v0.3.2 // indirect
github.com/danieljoos/wincred v1.0.2 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f // indirect
Expand Down Expand Up @@ -84,13 +85,13 @@ require (
github.com/jmhodges/levigo v1.0.0 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/keybase/go-keychain v0.0.0-20190712205309-48d3d31d256d // indirect
github.com/klauspost/compress v1.15.1 // indirect
github.com/klauspost/compress v1.15.9 // indirect
github.com/lib/pq v1.10.6 // indirect
github.com/libp2p/go-buffer-pool v0.1.0 // indirect
github.com/magiconair/properties v1.8.6 // indirect
github.com/mattn/go-colorable v0.1.12 // indirect
github.com/mattn/go-isatty v0.0.14 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect
github.com/mimoo/StrobeGo v0.0.0-20181016162300-f8f6d4d2b643 // indirect
github.com/minio/highwayhash v1.0.2 // indirect
github.com/mitchellh/go-homedir v1.1.0 // indirect
Expand Down Expand Up @@ -120,9 +121,10 @@ require (
github.com/zondax/hid v0.9.0 // indirect
go.etcd.io/bbolt v1.3.6 // indirect
golang.org/x/crypto v0.0.0-20220525230936-793ad666bf5e // indirect
golang.org/x/net v0.0.0-20220617184016-355a448f1bc9 // indirect
golang.org/x/sys v0.0.0-20220615213510-4f61da869c0c // indirect
golang.org/x/term v0.0.0-20220526004731-065cf7ba2467 // indirect
golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e // indirect
golang.org/x/net v0.0.0-20220726230323-06994584191e // indirect
golang.org/x/sys v0.0.0-20220727055044-e65921a090b8 // indirect
golang.org/x/term v0.0.0-20220722155259-a9ba230a4035 // indirect
golang.org/x/text v0.3.7 // indirect
gopkg.in/ini.v1 v1.66.6 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
Expand Down
Loading

0 comments on commit 6025064

Please sign in to comment.