From f075cce3a03c00046df383d5f1aa314c9566f6a2 Mon Sep 17 00:00:00 2001 From: C H Date: Wed, 21 Aug 2024 15:19:57 +0800 Subject: [PATCH] Cleanup gogo/protobuf dep --- contrib/devtools/proto-tools-installer.sh | 5 ----- go.mod | 2 +- x/cyberbank/keeper/keeper.go | 4 ++-- 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/contrib/devtools/proto-tools-installer.sh b/contrib/devtools/proto-tools-installer.sh index f5eadc73..b7c266c2 100644 --- a/contrib/devtools/proto-tools-installer.sh +++ b/contrib/devtools/proto-tools-installer.sh @@ -86,11 +86,6 @@ f_install_buf() { f_install_protoc_gen_gocosmos() { f_print_installing_with_padding protoc-gen-gocosmos - if ! grep "github.com/gogo/protobuf => github.com/regen-network/protobuf" go.mod &>/dev/null ; then - echo -e "\tPlease run this command from somewhere inside the cosmos-sdk folder." - return 1 - fi - go get github.com/regen-network/cosmos-proto/protoc-gen-gocosmos 2>/dev/null f_print_done } diff --git a/go.mod b/go.mod index 90645722..9ee18e04 100644 --- a/go.mod +++ b/go.mod @@ -18,7 +18,6 @@ require ( github.com/cosmos/gogoproto v1.4.10 github.com/cosmos/iavl v0.20.1 github.com/cosmos/ibc-go/v7 v7.6.0 - github.com/gogo/protobuf v1.3.2 github.com/golang/protobuf v1.5.4 github.com/gorilla/mux v1.8.0 github.com/grpc-ecosystem/grpc-gateway v1.16.0 @@ -91,6 +90,7 @@ require ( github.com/go-logr/stdr v1.2.2 // indirect github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 // indirect github.com/gogo/googleapis v1.4.1 // indirect + github.com/gogo/protobuf v1.3.2 // indirect github.com/golang/glog v1.2.1 // indirect github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect github.com/golang/mock v1.6.0 // indirect diff --git a/x/cyberbank/keeper/keeper.go b/x/cyberbank/keeper/keeper.go index 2b04ec2c..6930af55 100644 --- a/x/cyberbank/keeper/keeper.go +++ b/x/cyberbank/keeper/keeper.go @@ -8,7 +8,7 @@ import ( "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" - gogotypes "github.com/gogo/protobuf/types" + gogotypes "github.com/cosmos/gogoproto/types" "github.com/cometbft/cometbft/libs/log" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" @@ -134,7 +134,7 @@ func (k *IndexedKeeper) UpdateAccountsStakeAmpere(ctx sdk.Context) { func (k IndexedKeeper) GetNextAccountNumber(ctx sdk.Context) uint64 { var accNumber uint64 store := ctx.KVStore(k.authKey) - bz := store.Get([]byte("globalAccountNumber")) + bz := store.Get(authtypes.GlobalAccountNumberKey) if bz == nil { accNumber = 0