refactor(client): use address codec (#17503)

This commit is contained in:
Julien Robert
2023-08-23 10:43:47 +00:00
committed by GitHub
parent 029f9ed71e
commit c6b0bb62ac
42 changed files with 428 additions and 224 deletions
+6 -3
View File
@@ -13,7 +13,7 @@ import (
"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/client/flags"
"github.com/cosmos/cosmos-sdk/codec/address"
addresscodec "github.com/cosmos/cosmos-sdk/codec/address"
"github.com/cosmos/cosmos-sdk/crypto/hd"
"github.com/cosmos/cosmos-sdk/crypto/keyring"
"github.com/cosmos/cosmos-sdk/crypto/types"
@@ -52,7 +52,10 @@ func (s *CLITestSuite) SetupSuite() {
WithClient(clitestutil.MockCometRPC{Client: rpcclientmock.Client{}}).
WithAccountRetriever(client.MockAccountRetriever{}).
WithOutput(io.Discard).
WithChainID("test-chain")
WithChainID("test-chain").
WithAddressCodec(addresscodec.NewBech32Codec("cosmos")).
WithValidatorAddressCodec(addresscodec.NewBech32Codec("cosmosvaloper")).
WithConsensusAddressCodec(addresscodec.NewBech32Codec("cosmosvalcons"))
ctxGen := func() client.Context {
bz, _ := s.encCfg.Codec.Marshal(&sdk.TxResponse{})
@@ -97,7 +100,7 @@ func (s *CLITestSuite) TestNewUnjailTxCmd() {
tc := tc
s.Run(tc.name, func() {
cmd := cli.NewUnjailTxCmd(address.NewBech32Codec("cosmosvaloper"))
cmd := cli.NewUnjailTxCmd(addresscodec.NewBech32Codec("cosmosvaloper"))
clientCtx := s.clientCtx
out, err := clitestutil.ExecTestCLICmd(clientCtx, cmd, tc.args)