From 43c4d7c3fb53b7f9cd155dcd1553cec43ff5fc21 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Federico=20Kunze=20K=C3=BCllmer?= <31522760+fedekunze@users.noreply.github.com> Date: Tue, 18 Jan 2022 22:02:10 +0100 Subject: [PATCH] deps: bump Cosmos SDK version to `v0.45.0` (#912) * deps: bump SDK version to v0.45.0 * changelog * deprecation fix * deprecation fix 2 --- CHANGELOG.md | 1 + client/testnet.go | 38 ++----------------------------------- go.mod | 4 +--- go.sum | 4 ++-- testutil/network/network.go | 3 ++- 5 files changed, 8 insertions(+), 42 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9910f0f8..a99751bf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -44,6 +44,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ ### State Machine Breaking +* (deps) [tharis#912](https://github.com/tharsis/ethermint/pull/912) Bump Cosmos SDK version to [`v0.45.0`](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.45.0) * (evm) [tharsis#840](https://github.com/tharsis/ethermint/pull/840) Store empty topics as empty array rather than nil. * (feemarket) [tharsis#822](https://github.com/tharsis/ethermint/pull/822) Update EIP1559 base fee in `BeginBlock`. * (evm) [tharsis#817](https://github.com/tharsis/ethermint/pull/817) Use `effectiveGasPrice` in ante handler, add `effectiveGasPrice` to tx receipt. diff --git a/client/testnet.go b/client/testnet.go index fb4e5e10..4bee072e 100644 --- a/client/testnet.go +++ b/client/testnet.go @@ -25,6 +25,7 @@ import ( cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" sdkserver "github.com/cosmos/cosmos-sdk/server" srvconfig "github.com/cosmos/cosmos-sdk/server/config" + "github.com/cosmos/cosmos-sdk/testutil" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" @@ -272,8 +273,7 @@ func initTestnetFiles( return err } - // TODO: remove when using Cosmos SDK v0.45 - addr, secret, err := GenerateSaveCoinKey(kb, nodeDirName, true, algo) + addr, secret, err := testutil.GenerateSaveCoinKey(kb, nodeDirName, "", true, algo) if err != nil { _ = os.RemoveAll(args.outputDir) return err @@ -564,37 +564,3 @@ func startTestnet(cmd *cobra.Command, args startArgs) error { return nil } - -// TODO: remove - -// GenerateSaveCoinKey returns the address of a public key, along with the secret -// phrase to recover the private key. -func GenerateSaveCoinKey(keybase keyring.Keyring, keyName string, overwrite bool, algo keyring.SignatureAlgo) (sdk.AccAddress, string, error) { - exists := false - _, err := keybase.Key(keyName) - if err == nil { - exists = true - } - - // ensure no overwrite - if !overwrite && exists { - return sdk.AccAddress([]byte{}), "", fmt.Errorf( - "key already exists, overwrite is disabled") - } - - // generate a private key, with recovery phrase - if exists { - err = keybase.Delete(keyName) - if err != nil { - return sdk.AccAddress([]byte{}), "", fmt.Errorf( - "failed to overwrite key") - } - } - - info, secret, err := keybase.NewMnemonic(keyName, keyring.English, sdk.GetConfig().GetFullBIP44Path(), keyring.DefaultBIP39Passphrase, algo) - if err != nil { - return sdk.AccAddress([]byte{}), "", err - } - - return sdk.AccAddress(info.GetPubKey().Address()), secret, nil -} diff --git a/go.mod b/go.mod index 6b542d67..1359d7f7 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.17 require ( github.com/btcsuite/btcd v0.22.0-beta github.com/btcsuite/btcutil v1.0.3-0.20201208143702-a53e38424cce - github.com/cosmos/cosmos-sdk v0.44.5 + github.com/cosmos/cosmos-sdk v0.45.0 github.com/cosmos/go-bip39 v1.0.0 github.com/cosmos/ibc-go/v3 v3.0.0-alpha2 github.com/davecgh/go-spew v1.1.1 @@ -152,8 +152,6 @@ require ( replace ( github.com/99designs/keyring => github.com/cosmos/keyring v1.1.7-0.20210622111912-ef00f8ac3d76 - // TODO: remove once v0.45 is released - github.com/cosmos/cosmos-sdk => github.com/cosmos/cosmos-sdk v0.44.6-0.20220104141845-0be9863cfed1 github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alpha.regen.1 google.golang.org/grpc => google.golang.org/grpc v1.33.2 ) diff --git a/go.sum b/go.sum index 75f5c4bc..ae0b3bc1 100644 --- a/go.sum +++ b/go.sum @@ -226,8 +226,8 @@ github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfc github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/cosmos/btcutil v1.0.4 h1:n7C2ngKXo7UC9gNyMNLbzqz7Asuf+7Qv4gnX/rOdQ44= github.com/cosmos/btcutil v1.0.4/go.mod h1:Ffqc8Hn6TJUdDgHBwIZLtrLQC1KdJ9jGJl/TvgUaxbU= -github.com/cosmos/cosmos-sdk v0.44.6-0.20220104141845-0be9863cfed1 h1:nN+l89gOFpd6ipMR6N/3qu+p/T4me2xMU1P6jc0zbQ8= -github.com/cosmos/cosmos-sdk v0.44.6-0.20220104141845-0be9863cfed1/go.mod h1:XXS/asyCqWNWkx2rW6pSuen+EVcpAFxq6khrhnZgHaQ= +github.com/cosmos/cosmos-sdk v0.45.0 h1:DHD+CIRZ+cYgiLXuTEUL/aprnfPsWSwaww/fIZEsZlk= +github.com/cosmos/cosmos-sdk v0.45.0/go.mod h1:XXS/asyCqWNWkx2rW6pSuen+EVcpAFxq6khrhnZgHaQ= github.com/cosmos/go-bip39 v0.0.0-20180819234021-555e2067c45d/go.mod h1:tSxLoYXyBmiFeKpvmq4dzayMdCjCnu8uqmCysIGBT2Y= github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY= github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4xuwvCdJw= diff --git a/testutil/network/network.go b/testutil/network/network.go index 8d7a9151..5d23a55e 100644 --- a/testutil/network/network.go +++ b/testutil/network/network.go @@ -41,6 +41,7 @@ import ( "github.com/cosmos/cosmos-sdk/simapp" "github.com/cosmos/cosmos-sdk/simapp/params" storetypes "github.com/cosmos/cosmos-sdk/store/types" + "github.com/cosmos/cosmos-sdk/testutil" sdk "github.com/cosmos/cosmos-sdk/types" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" @@ -380,7 +381,7 @@ func New(l Logger, baseDir string, cfg Config) (*Network, error) { return nil, err } - addr, secret, err := server.GenerateSaveCoinKey(kb, nodeDirName, true, algo) + addr, secret, err := testutil.GenerateSaveCoinKey(kb, nodeDirName, "", true, algo) if err != nil { return nil, err }