From 243b7a89c2108a4291407e6dd36da4facea18550 Mon Sep 17 00:00:00 2001 From: huangyi Date: Thu, 26 Sep 2024 16:43:01 +0800 Subject: [PATCH] cleanup --- go.mod | 1 - gomod2nix.toml | 3 --- x/e2ee/client/cli/encrypt.go | 3 +-- x/e2ee/keyring/keyring.go | 4 ++-- x/e2ee/module.go | 6 ++++-- 5 files changed, 7 insertions(+), 10 deletions(-) diff --git a/go.mod b/go.mod index 448cece5d2..3b01ef6994 100644 --- a/go.mod +++ b/go.mod @@ -41,7 +41,6 @@ require ( github.com/spf13/pflag v1.0.5 github.com/spf13/viper v1.19.0 github.com/stretchr/testify v1.9.0 - github.com/test-go/testify v1.1.4 golang.org/x/crypto v0.27.0 google.golang.org/genproto/googleapis/api v0.0.0-20240701130421-f6361c86f094 google.golang.org/grpc v1.66.1 diff --git a/gomod2nix.toml b/gomod2nix.toml index 62ab40e3d2..5ba1ff4229 100644 --- a/gomod2nix.toml +++ b/gomod2nix.toml @@ -585,9 +585,6 @@ schema = 3 [mod."github.com/tendermint/go-amino"] version = "v0.16.0" hash = "sha256-JW4zO/0vMzf1dXLePOqaMtiLUZgNbuIseh9GV+jQlf0=" - [mod."github.com/test-go/testify"] - version = "v1.1.4" - hash = "sha256-8xygO1Rd4eTrmRe/g7zaifpNkeb6EmjNfUvTWbjDtPg=" [mod."github.com/tidwall/btree"] version = "v0.0.0-20240406140148-2687063b042c" hash = "sha256-8eDLGHhw4qXG6MEa7w5Q9KLwOobXr8Vn5qqyQhuipQw=" diff --git a/x/e2ee/client/cli/encrypt.go b/x/e2ee/client/cli/encrypt.go index 7800d30011..e6f7318aac 100644 --- a/x/e2ee/client/cli/encrypt.go +++ b/x/e2ee/client/cli/encrypt.go @@ -1,7 +1,6 @@ package cli import ( - "context" "errors" "io" "os" @@ -41,7 +40,7 @@ func EncryptCommand() *cobra.Command { // query encryption key from chain state client := types.NewQueryClient(clientCtx) - rsp, err := client.Keys(context.Background(), &types.KeysRequest{ + rsp, err := client.Keys(clientCtx.CmdContext, &types.KeysRequest{ Addresses: recs, }) if err != nil { diff --git a/x/e2ee/keyring/keyring.go b/x/e2ee/keyring/keyring.go index 88332b5bf9..44b4bd6b8e 100644 --- a/x/e2ee/keyring/keyring.go +++ b/x/e2ee/keyring/keyring.go @@ -77,7 +77,7 @@ func New( PassPrefix: prefix, }) default: - return nil, fmt.Errorf("unknown keyring backend %v", backend) + return nil, errorsmod.Wrap(sdkkeyring.ErrUnknownBacked, backend) } if err != nil { @@ -148,7 +148,7 @@ func newRealPrompt(dir string, buf io.Reader) func(string) (string, error) { for { failureCounter++ if failureCounter > maxPassphraseEntryAttempts { - return "", fmt.Errorf("too many failed passphrase attempts") + return "", sdkkeyring.ErrMaxPassPhraseAttempts } buf := bufio.NewReader(buf) diff --git a/x/e2ee/module.go b/x/e2ee/module.go index e868d532c4..5d62e923bf 100644 --- a/x/e2ee/module.go +++ b/x/e2ee/module.go @@ -22,8 +22,10 @@ import ( ) var ( - _ module.AppModule = AppModule{} - _ module.AppModuleBasic = AppModuleBasic{} + _ module.AppModule = AppModule{} + _ module.AppModuleBasic = AppModuleBasic{} + _ module.HasGenesisBasics = AppModuleBasic{} + _ module.HasName = AppModuleBasic{} // this line is used by starport scaffolding # ibc/module/interface )