Skip to content

Commit

Permalink
chore: fix codeql issue (cosmos#20113)
Browse files Browse the repository at this point in the history
  • Loading branch information
tac0turtle authored Apr 22, 2024
1 parent 4a7a641 commit 600c246
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 13 deletions.
2 changes: 1 addition & 1 deletion crypto/keys/bcrypt/bcrypt.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func (ih InvalidHashPrefixError) Error() string {
return fmt.Sprintf("crypto/bcrypt: bcrypt hashes must start with '$', but hashedSecret started with '%c'", byte(ih))
}

type InvalidCostError int
type InvalidCostError uint32

func (ic InvalidCostError) Error() string {
return fmt.Sprintf("crypto/bcrypt: cost %d is outside allowed range (%d,%d)", int(ic), MinCost, MaxCost)
Expand Down
1 change: 0 additions & 1 deletion simapp/app_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ import (
vestingmodulev1 "cosmossdk.io/api/cosmos/vesting/module/v1"
"cosmossdk.io/depinject/appconfig"
"cosmossdk.io/x/accounts"
_ "cosmossdk.io/x/accounts" // import for side-effects
_ "cosmossdk.io/x/auth/tx/config" // import for side-effects
authtypes "cosmossdk.io/x/auth/types"
_ "cosmossdk.io/x/auth/vesting" // import for side-effects
Expand Down
20 changes: 9 additions & 11 deletions tests/integration/auth/keeper/msg_server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,8 @@ import (
"cosmossdk.io/x/auth"
authkeeper "cosmossdk.io/x/auth/keeper"
authsims "cosmossdk.io/x/auth/simulation"
"cosmossdk.io/x/auth/types"
authtypes "cosmossdk.io/x/auth/types"
"cosmossdk.io/x/bank"
"cosmossdk.io/x/bank/keeper"
bankkeeper "cosmossdk.io/x/bank/keeper"
"cosmossdk.io/x/bank/testutil"
banktypes "cosmossdk.io/x/bank/types"
Expand Down Expand Up @@ -108,7 +106,7 @@ func initFixture(t *testing.T) *fixture {
blockedAddresses := map[string]bool{
authKeeper.GetAuthority(): false,
}
bankKeeper := keeper.NewBaseKeeper(
bankKeeper := bankkeeper.NewBaseKeeper(
runtime.NewEnvironment(runtime.NewKVStoreService(keys[banktypes.StoreKey]), log.NewNopLogger()),
cdc,
authKeeper,
Expand Down Expand Up @@ -186,13 +184,13 @@ func TestAsyncExec(t *testing.T) {

testCases := []struct {
name string
req *types.MsgNonAtomicExec
req *authtypes.MsgNonAtomicExec
expectErr bool
expErrMsg string
}{
{
name: "empty signer address",
req: &types.MsgNonAtomicExec{
req: &authtypes.MsgNonAtomicExec{
Signer: "",
Msgs: []*codectypes.Any{},
},
Expand All @@ -201,7 +199,7 @@ func TestAsyncExec(t *testing.T) {
},
{
name: "invalid signer address",
req: &types.MsgNonAtomicExec{
req: &authtypes.MsgNonAtomicExec{
Signer: "invalid",
Msgs: []*codectypes.Any{},
},
Expand All @@ -210,7 +208,7 @@ func TestAsyncExec(t *testing.T) {
},
{
name: "empty msgs",
req: &types.MsgNonAtomicExec{
req: &authtypes.MsgNonAtomicExec{
Signer: addrs[0].String(),
Msgs: []*codectypes.Any{},
},
Expand All @@ -219,23 +217,23 @@ func TestAsyncExec(t *testing.T) {
},
{
name: "valid msg",
req: &types.MsgNonAtomicExec{
req: &authtypes.MsgNonAtomicExec{
Signer: addrs[0].String(),
Msgs: []*codectypes.Any{msgAny},
},
expectErr: false,
},
{
name: "multiple messages being executed",
req: &types.MsgNonAtomicExec{
req: &authtypes.MsgNonAtomicExec{
Signer: addrs[0].String(),
Msgs: []*codectypes.Any{msgAny, msgAny},
},
expectErr: false,
},
{
name: "multiple messages with different signers",
req: &types.MsgNonAtomicExec{
req: &authtypes.MsgNonAtomicExec{
Signer: addrs[0].String(),
Msgs: []*codectypes.Any{msgAny, msgAny2},
},
Expand All @@ -244,7 +242,7 @@ func TestAsyncExec(t *testing.T) {
},
{
name: "multi msg with one failing being executed",
req: &types.MsgNonAtomicExec{
req: &authtypes.MsgNonAtomicExec{
Signer: addrs[0].String(),
Msgs: []*codectypes.Any{msgAny, failingMsgAny},
},
Expand Down

0 comments on commit 600c246

Please sign in to comment.