Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(bank): migrate bech32 encoding #15567

Merged
merged 25 commits into from
May 24, 2023
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions simapp/simd/cmd/root.go
julienrbrt marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"io"
"os"

"cosmossdk.io/core/address"
"cosmossdk.io/log"
cmtcfg "github.com/cometbft/cometbft/config"
dbm "github.com/cosmos/cosmos-db"
Expand Down Expand Up @@ -108,7 +109,7 @@ func NewRootCmd() *cobra.Command {
},
}

initRootCmd(rootCmd, encodingConfig)
initRootCmd(rootCmd, encodingConfig, tempApp.AccountKeeper.GetAddressCodec())

if err := tempApp.AutoCliOpts().EnhanceRootCommand(rootCmd); err != nil {
panic(err)
Expand Down Expand Up @@ -186,7 +187,7 @@ lru_size = 0`
return customAppTemplate, customAppConfig
}

func initRootCmd(rootCmd *cobra.Command, encodingConfig params.EncodingConfig) {
func initRootCmd(rootCmd *cobra.Command, encodingConfig params.EncodingConfig, ac address.Codec) {
cfg := sdk.GetConfig()
cfg.Seal()

Expand All @@ -203,7 +204,7 @@ func initRootCmd(rootCmd *cobra.Command, encodingConfig params.EncodingConfig) {
// add keybase, auxiliary RPC, query, genesis, and tx child commands
rootCmd.AddCommand(
rpc.StatusCommand(),
genesisCommand(encodingConfig),
genesisCommand(encodingConfig, ac),
queryCommand(),
txCommand(),
keys.Commands(simapp.DefaultNodeHome),
Expand All @@ -218,8 +219,8 @@ func addModuleInitFlags(startCmd *cobra.Command) {
}

// genesisCommand builds genesis-related `simd genesis` command. Users may provide application specific commands as a parameter
func genesisCommand(encodingConfig params.EncodingConfig, cmds ...*cobra.Command) *cobra.Command {
cmd := genutilcli.Commands(encodingConfig.TxConfig, simapp.ModuleBasics, simapp.DefaultNodeHome)
func genesisCommand(encodingConfig params.EncodingConfig, ac address.Codec, cmds ...*cobra.Command) *cobra.Command {
cmd := genutilcli.Commands(encodingConfig.TxConfig, simapp.ModuleBasics, simapp.DefaultNodeHome, ac)

for _, subCmd := range cmds {
cmd.AddCommand(subCmd)
Expand Down
29 changes: 18 additions & 11 deletions tests/e2e/auth/suite.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import (

"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/client/flags"
addresscodec "github.com/cosmos/cosmos-sdk/codec/address"
"github.com/cosmos/cosmos-sdk/crypto/hd"
"github.com/cosmos/cosmos-sdk/crypto/keyring"
kmultisig "github.com/cosmos/cosmos-sdk/crypto/keys/multisig"
Expand Down Expand Up @@ -142,7 +143,7 @@ func (s *E2ETestSuite) TestCLISignGenOnly() {
fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation),
fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync),
}
generatedStd, err := clitestutil.ExecTestCLICmd(val.ClientCtx, bank.NewSendTxCmd(), args)
generatedStd, err := clitestutil.ExecTestCLICmd(val.ClientCtx, bank.NewSendTxCmd(addresscodec.NewBech32Codec("cosmos")), args)
s.Require().NoError(err)
opFile := testutil.WriteToNewTempFile(s.T(), generatedStd.String())
defer opFile.Close()
Expand Down Expand Up @@ -688,7 +689,7 @@ func (s *E2ETestSuite) TestCLISendGenerateSignAndBroadcast() {
s.Require().NoError(err)
s.Require().Equal(0, len(sigs))

resp, err := clitestutil.QueryBalancesExec(val1.ClientCtx, val1.Address)
resp, err := clitestutil.QueryBalancesExec(val1.ClientCtx, val1.Address, addresscodec.NewBech32Codec("cosmos"))
s.Require().NoError(err)

var balRes banktypes.QueryAllBalancesResponse
Expand Down Expand Up @@ -753,7 +754,7 @@ func (s *E2ETestSuite) TestCLISendGenerateSignAndBroadcast() {
s.Require().NoError(s.network.WaitForNextBlock())

// Ensure foo has right amount of funds
resp, err = clitestutil.QueryBalancesExec(val1.ClientCtx, val1.Address)
resp, err = clitestutil.QueryBalancesExec(val1.ClientCtx, val1.Address, addresscodec.NewBech32Codec("cosmos"))
s.Require().NoError(err)

err = val1.ClientCtx.Codec.UnmarshalJSON(resp.Bytes(), &balRes)
Expand All @@ -775,7 +776,7 @@ func (s *E2ETestSuite) TestCLISendGenerateSignAndBroadcast() {

// Ensure destiny account state
err = s.network.RetryForBlocks(func() error {
resp, err = clitestutil.QueryBalancesExec(val1.ClientCtx, addr)
resp, err = clitestutil.QueryBalancesExec(val1.ClientCtx, addr, addresscodec.NewBech32Codec("cosmos"))
return err
}, 3)
s.Require().NoError(err)
Expand All @@ -785,7 +786,7 @@ func (s *E2ETestSuite) TestCLISendGenerateSignAndBroadcast() {
s.Require().Equal(sendTokens.Amount, balRes.Balances.AmountOf(s.cfg.BondDenom))

// Ensure origin account state
resp, err = clitestutil.QueryBalancesExec(val1.ClientCtx, val1.Address)
resp, err = clitestutil.QueryBalancesExec(val1.ClientCtx, val1.Address, addresscodec.NewBech32Codec("cosmos"))
s.Require().NoError(err)

err = val1.ClientCtx.Codec.UnmarshalJSON(resp.Bytes(), &balRes)
Expand Down Expand Up @@ -823,6 +824,7 @@ func (s *E2ETestSuite) TestCLIMultisignInsufficientCosigners() {
sdk.NewCoins(
sdk.NewInt64Coin(s.cfg.BondDenom, 5),
),
addresscodec.NewBech32Codec("cosmos"),
fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation),
fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync),
fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()),
Expand Down Expand Up @@ -906,7 +908,7 @@ func (s *E2ETestSuite) TestCLIMultisignSortSignatures() {

addr, err := multisigRecord.GetAddress()
s.Require().NoError(err)
resp, err := clitestutil.QueryBalancesExec(val1.ClientCtx, addr)
resp, err := clitestutil.QueryBalancesExec(val1.ClientCtx, addr, addresscodec.NewBech32Codec("cosmos"))
s.Require().NoError(err)

var balRes banktypes.QueryAllBalancesResponse
Expand All @@ -924,7 +926,7 @@ func (s *E2ETestSuite) TestCLIMultisignSortSignatures() {
s.Require().NoError(err)
s.Require().NoError(s.network.WaitForNextBlock())

resp, err = clitestutil.QueryBalancesExec(val1.ClientCtx, addr)
resp, err = clitestutil.QueryBalancesExec(val1.ClientCtx, addr, addresscodec.NewBech32Codec("cosmos"))
s.Require().NoError(err)

err = val1.ClientCtx.Codec.UnmarshalJSON(resp.Bytes(), &balRes)
Expand All @@ -940,6 +942,7 @@ func (s *E2ETestSuite) TestCLIMultisignSortSignatures() {
sdk.NewCoins(
sdk.NewInt64Coin(s.cfg.BondDenom, 5),
),
addresscodec.NewBech32Codec("cosmos"),
fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation),
fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync),
fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()),
Expand Down Expand Up @@ -1017,6 +1020,7 @@ func (s *E2ETestSuite) TestSignWithMultisig() {
sdk.NewCoins(
sdk.NewInt64Coin(s.cfg.BondDenom, 5),
),
addresscodec.NewBech32Codec("cosmos"),
fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation),
fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync),
fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()),
Expand Down Expand Up @@ -1064,7 +1068,7 @@ func (s *E2ETestSuite) TestCLIMultisign() {

var balRes banktypes.QueryAllBalancesResponse
err = s.network.RetryForBlocks(func() error {
resp, err := clitestutil.QueryBalancesExec(val1.ClientCtx, addr)
resp, err := clitestutil.QueryBalancesExec(val1.ClientCtx, addr, addresscodec.NewBech32Codec("cosmos"))
if err != nil {
return err
}
Expand All @@ -1081,6 +1085,7 @@ func (s *E2ETestSuite) TestCLIMultisign() {
sdk.NewCoins(
sdk.NewInt64Coin(s.cfg.BondDenom, 5),
),
addresscodec.NewBech32Codec("cosmos"),
fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation),
fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync),
fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()),
Expand Down Expand Up @@ -1174,6 +1179,7 @@ func (s *E2ETestSuite) TestSignBatchMultisig() {
sdk.NewCoins(
sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(1)),
),
addresscodec.NewBech32Codec("cosmos"),
fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation),
fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync),
fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()),
Expand Down Expand Up @@ -1239,6 +1245,7 @@ func (s *E2ETestSuite) TestMultisignBatch() {
sdk.NewCoins(
sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(1)),
),
addresscodec.NewBech32Codec("cosmos"),
fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation),
fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync),
fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()),
Expand Down Expand Up @@ -1615,7 +1622,7 @@ func (s *E2ETestSuite) TestSignWithMultiSignersAminoJSON() {
require.Equal(uint32(0), txRes.Code, txRes.RawLog)

// Make sure the addr1's balance got funded.
queryResJSON, err := clitestutil.QueryBalancesExec(val0.ClientCtx, addr1)
queryResJSON, err := clitestutil.QueryBalancesExec(val0.ClientCtx, addr1, addresscodec.NewBech32Codec("cosmos"))
require.NoError(err)
var queryRes banktypes.QueryAllBalancesResponse
err = val0.ClientCtx.Codec.UnmarshalJSON(queryResJSON.Bytes(), &queryRes)
Expand Down Expand Up @@ -1947,11 +1954,11 @@ func (s *E2ETestSuite) createBankMsg(val *network.Validator, toAddr sdk.AccAddre
}

flags = append(flags, extraFlags...)
return clitestutil.MsgSendExec(val.ClientCtx, val.Address, toAddr, amount, flags...)
return clitestutil.MsgSendExec(val.ClientCtx, val.Address, toAddr, amount, addresscodec.NewBech32Codec("cosmos"), flags...)
}

func (s *E2ETestSuite) getBalances(clientCtx client.Context, addr sdk.AccAddress, denom string) math.Int {
resp, err := clitestutil.QueryBalancesExec(clientCtx, addr)
resp, err := clitestutil.QueryBalancesExec(clientCtx, addr, addresscodec.NewBech32Codec("cosmos"))
s.Require().NoError(err)

var balRes banktypes.QueryAllBalancesResponse
Expand Down
6 changes: 5 additions & 1 deletion tests/e2e/authz/tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (

"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/testutil"
Expand Down Expand Up @@ -147,7 +148,7 @@ func (s *E2ETestSuite) msgSendExec(grantee sdk.AccAddress) {
val.ClientCtx,
val.Address,
grantee,
sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(200))), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation),
sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(200))), addresscodec.NewBech32Codec("cosmos"), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation),
fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync),
fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()),
)
Expand Down Expand Up @@ -859,6 +860,7 @@ func (s *E2ETestSuite) TestNewExecGrantAuthorized() {
val.Address,
grantee,
tokens,
addresscodec.NewBech32Codec("cosmos"),
fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation),
fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync),
fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()),
Expand Down Expand Up @@ -973,6 +975,7 @@ func (s *E2ETestSuite) TestExecSendAuthzWithAllowList() {
val.Address,
allowedAddr,
tokens,
addresscodec.NewBech32Codec("cosmos"),
fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation),
fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync),
fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()),
Expand All @@ -987,6 +990,7 @@ func (s *E2ETestSuite) TestExecSendAuthzWithAllowList() {
val.Address,
notAllowedAddr,
tokens,
addresscodec.NewBech32Codec("cosmos"),
fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation),
fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync),
fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()),
Expand Down
12 changes: 7 additions & 5 deletions tests/e2e/bank/suite.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (
"github.com/cosmos/cosmos-sdk/testutil"

"github.com/cosmos/cosmos-sdk/client/flags"
addresscodec "github.com/cosmos/cosmos-sdk/codec/address"
clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli"
"github.com/cosmos/cosmos-sdk/testutil/network"
sdk "github.com/cosmos/cosmos-sdk/types"
Expand Down Expand Up @@ -152,7 +153,8 @@ func (s *E2ETestSuite) TestGetBalancesCmd() {
tc := tc

s.Run(tc.name, func() {
cmd := cli.GetBalancesCmd()

cmd := cli.GetBalancesCmd(addresscodec.NewBech32Codec("cosmos"))
out, err := clitestutil.ExecTestCLICmd(val.ClientCtx, cmd, tc.args)

if tc.expectErr {
Expand Down Expand Up @@ -383,7 +385,7 @@ func (s *E2ETestSuite) TestNewSendTxCmdGenOnly() {
fmt.Sprintf("--%s=true", flags.FlagGenerateOnly),
}

bz, err := clitestutil.MsgSendExec(clientCtx, from, to, amount, args...)
bz, err := clitestutil.MsgSendExec(clientCtx, from, to, amount, addresscodec.NewBech32Codec("cosmos"), args...)
s.Require().NoError(err)
tx, err := s.cfg.TxConfig.TxJSONDecoder()(bz.Bytes())
s.Require().NoError(err)
Expand Down Expand Up @@ -412,7 +414,7 @@ func (s *E2ETestSuite) TestNewSendTxCmdDryRun() {
r, w, _ := os.Pipe()
os.Stderr = w

_, err := clitestutil.MsgSendExec(clientCtx, from, to, amount, args...)
_, err := clitestutil.MsgSendExec(clientCtx, from, to, amount, addresscodec.NewBech32Codec("cosmos"), args...)
s.Require().NoError(err)

w.Close()
Expand Down Expand Up @@ -510,7 +512,7 @@ func (s *E2ETestSuite) TestNewSendTxCmd() {
s.Run(tc.name, func() {
clientCtx := val.ClientCtx

bz, err := clitestutil.MsgSendExec(clientCtx, tc.from, tc.to, tc.amount, tc.args...)
bz, err := clitestutil.MsgSendExec(clientCtx, tc.from, tc.to, tc.amount, addresscodec.NewBech32Codec("cosmos"), tc.args...)
if tc.expectErr {
s.Require().Error(err)
} else {
Expand Down Expand Up @@ -673,5 +675,5 @@ func MsgMultiSendExec(clientCtx client.Context, from sdk.AccAddress, to []sdk.Ac
args = append(args, amount.String())
args = append(args, extraArgs...)

return clitestutil.ExecTestCLICmd(clientCtx, cli.NewMultiSendTxCmd(), args)
return clitestutil.ExecTestCLICmd(clientCtx, cli.NewMultiSendTxCmd(addresscodec.NewBech32Codec("cosmos")), args)
}
3 changes: 2 additions & 1 deletion tests/e2e/distribution/withdraw_all_suite.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"github.com/stretchr/testify/suite"

"github.com/cosmos/cosmos-sdk/client/flags"
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/testutil"
Expand Down Expand Up @@ -63,7 +64,7 @@ func (s *WithdrawAllTestSuite) TestNewWithdrawAllRewardsGenerateOnly() {
val.ClientCtx,
val.Address,
newAddr,
sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(2000))), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation),
sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(2000))), addresscodec.NewBech32Codec("cosmos"), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation),
fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync),
fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()),
)
Expand Down
5 changes: 3 additions & 2 deletions tests/e2e/gov/tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"github.com/stretchr/testify/suite"

"github.com/cosmos/cosmos-sdk/client/flags"
addresscodec "github.com/cosmos/cosmos-sdk/codec/address"
clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli"
"github.com/cosmos/cosmos-sdk/testutil/network"
sdk "github.com/cosmos/cosmos-sdk/types"
Expand Down Expand Up @@ -351,7 +352,7 @@ func (s *E2ETestSuite) TestNewCmdCancelProposal() {
var balRes banktypes.QueryAllBalancesResponse
var newBalance banktypes.QueryAllBalancesResponse
if !tc.expectErr && tc.expectedCode == 0 {
resp, err := clitestutil.QueryBalancesExec(clientCtx, val.Address)
resp, err := clitestutil.QueryBalancesExec(clientCtx, val.Address, addresscodec.NewBech32Codec("cosmos"))
s.Require().NoError(err)
err = val.ClientCtx.Codec.UnmarshalJSON(resp.Bytes(), &balRes)
s.Require().NoError(err)
Expand All @@ -367,7 +368,7 @@ func (s *E2ETestSuite) TestNewCmdCancelProposal() {
s.Require().NoError(clitestutil.CheckTxCode(s.network, clientCtx, resp.TxHash, tc.expectedCode))

if !tc.expectErr && tc.expectedCode == 0 {
resp, err := clitestutil.QueryBalancesExec(clientCtx, val.Address)
resp, err := clitestutil.QueryBalancesExec(clientCtx, val.Address, addresscodec.NewBech32Codec("cosmos"))
s.Require().NoError(err)
err = val.ClientCtx.Codec.UnmarshalJSON(resp.Bytes(), &newBalance)
s.Require().NoError(err)
Expand Down
6 changes: 4 additions & 2 deletions tests/e2e/group/tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
"github.com/stretchr/testify/suite"

"github.com/cosmos/cosmos-sdk/client/flags"
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/testutil"
Expand Down Expand Up @@ -75,7 +76,7 @@ func (s *E2ETestSuite) SetupSuite() {
val.ClientCtx,
val.Address,
account,
sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(2000))), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation),
sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(2000))), addresscodec.NewBech32Codec("cosmos"), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation),
fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync),
fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()),
)
Expand Down Expand Up @@ -2564,7 +2565,7 @@ func (s *E2ETestSuite) createAccounts(quantity int) []string {
val.ClientCtx,
val.Address,
account,
sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(2000))), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation),
sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(2000))), addresscodec.NewBech32Codec("cosmos"), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation),
fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync),
fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()),
)
Expand Down Expand Up @@ -2638,6 +2639,7 @@ func (s *E2ETestSuite) createGroupThresholdPolicyWithBalance(adminAddress, group
s.Require().NoError(err)
_, err = clitestutil.MsgSendExec(clientCtx, val.Address, addr,
sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(tokens))),
addresscodec.NewBech32Codec("cosmos"),
s.commonFlags...,
)
s.Require().NoError(err)
Expand Down
3 changes: 2 additions & 1 deletion tests/e2e/nft/tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (

"cosmossdk.io/x/nft"
"github.com/cosmos/cosmos-sdk/client/flags"
addresscodec "github.com/cosmos/cosmos-sdk/codec/address"
clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli"
"github.com/cosmos/cosmos-sdk/testutil/network"
sdk "github.com/cosmos/cosmos-sdk/types"
Expand Down Expand Up @@ -157,6 +158,6 @@ func (s *E2ETestSuite) initAccount() {
s.Require().NoError(err)

amount := sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(200)))
_, err = clitestutil.MsgSendExec(ctx, val.Address, s.owner, amount, args...)
_, err = clitestutil.MsgSendExec(ctx, val.Address, s.owner, amount, addresscodec.NewBech32Codec("cosmos"), args...)
s.Require().NoError(err)
}
Loading