Skip to content

Commit 600c246

Browse files
authored
chore: fix codeql issue (#20113)
1 parent 4a7a641 commit 600c246

3 files changed

Lines changed: 10 additions & 13 deletions

File tree

crypto/keys/bcrypt/bcrypt.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ func (ih InvalidHashPrefixError) Error() string {
4747
return fmt.Sprintf("crypto/bcrypt: bcrypt hashes must start with '$', but hashedSecret started with '%c'", byte(ih))
4848
}
4949

50-
type InvalidCostError int
50+
type InvalidCostError uint32
5151

5252
func (ic InvalidCostError) Error() string {
5353
return fmt.Sprintf("crypto/bcrypt: cost %d is outside allowed range (%d,%d)", int(ic), MinCost, MaxCost)

simapp/app_config.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ import (
3131
vestingmodulev1 "cosmossdk.io/api/cosmos/vesting/module/v1"
3232
"cosmossdk.io/depinject/appconfig"
3333
"cosmossdk.io/x/accounts"
34-
_ "cosmossdk.io/x/accounts" // import for side-effects
3534
_ "cosmossdk.io/x/auth/tx/config" // import for side-effects
3635
authtypes "cosmossdk.io/x/auth/types"
3736
_ "cosmossdk.io/x/auth/vesting" // import for side-effects

tests/integration/auth/keeper/msg_server_test.go

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,8 @@ import (
1818
"cosmossdk.io/x/auth"
1919
authkeeper "cosmossdk.io/x/auth/keeper"
2020
authsims "cosmossdk.io/x/auth/simulation"
21-
"cosmossdk.io/x/auth/types"
2221
authtypes "cosmossdk.io/x/auth/types"
2322
"cosmossdk.io/x/bank"
24-
"cosmossdk.io/x/bank/keeper"
2523
bankkeeper "cosmossdk.io/x/bank/keeper"
2624
"cosmossdk.io/x/bank/testutil"
2725
banktypes "cosmossdk.io/x/bank/types"
@@ -108,7 +106,7 @@ func initFixture(t *testing.T) *fixture {
108106
blockedAddresses := map[string]bool{
109107
authKeeper.GetAuthority(): false,
110108
}
111-
bankKeeper := keeper.NewBaseKeeper(
109+
bankKeeper := bankkeeper.NewBaseKeeper(
112110
runtime.NewEnvironment(runtime.NewKVStoreService(keys[banktypes.StoreKey]), log.NewNopLogger()),
113111
cdc,
114112
authKeeper,
@@ -186,13 +184,13 @@ func TestAsyncExec(t *testing.T) {
186184

187185
testCases := []struct {
188186
name string
189-
req *types.MsgNonAtomicExec
187+
req *authtypes.MsgNonAtomicExec
190188
expectErr bool
191189
expErrMsg string
192190
}{
193191
{
194192
name: "empty signer address",
195-
req: &types.MsgNonAtomicExec{
193+
req: &authtypes.MsgNonAtomicExec{
196194
Signer: "",
197195
Msgs: []*codectypes.Any{},
198196
},
@@ -201,7 +199,7 @@ func TestAsyncExec(t *testing.T) {
201199
},
202200
{
203201
name: "invalid signer address",
204-
req: &types.MsgNonAtomicExec{
202+
req: &authtypes.MsgNonAtomicExec{
205203
Signer: "invalid",
206204
Msgs: []*codectypes.Any{},
207205
},
@@ -210,7 +208,7 @@ func TestAsyncExec(t *testing.T) {
210208
},
211209
{
212210
name: "empty msgs",
213-
req: &types.MsgNonAtomicExec{
211+
req: &authtypes.MsgNonAtomicExec{
214212
Signer: addrs[0].String(),
215213
Msgs: []*codectypes.Any{},
216214
},
@@ -219,23 +217,23 @@ func TestAsyncExec(t *testing.T) {
219217
},
220218
{
221219
name: "valid msg",
222-
req: &types.MsgNonAtomicExec{
220+
req: &authtypes.MsgNonAtomicExec{
223221
Signer: addrs[0].String(),
224222
Msgs: []*codectypes.Any{msgAny},
225223
},
226224
expectErr: false,
227225
},
228226
{
229227
name: "multiple messages being executed",
230-
req: &types.MsgNonAtomicExec{
228+
req: &authtypes.MsgNonAtomicExec{
231229
Signer: addrs[0].String(),
232230
Msgs: []*codectypes.Any{msgAny, msgAny},
233231
},
234232
expectErr: false,
235233
},
236234
{
237235
name: "multiple messages with different signers",
238-
req: &types.MsgNonAtomicExec{
236+
req: &authtypes.MsgNonAtomicExec{
239237
Signer: addrs[0].String(),
240238
Msgs: []*codectypes.Any{msgAny, msgAny2},
241239
},
@@ -244,7 +242,7 @@ func TestAsyncExec(t *testing.T) {
244242
},
245243
{
246244
name: "multi msg with one failing being executed",
247-
req: &types.MsgNonAtomicExec{
245+
req: &authtypes.MsgNonAtomicExec{
248246
Signer: addrs[0].String(),
249247
Msgs: []*codectypes.Any{msgAny, failingMsgAny},
250248
},

0 commit comments

Comments
 (0)