Skip to content

Commit

Permalink
Fix comments and cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
pinosu committed Aug 30, 2024
1 parent d611741 commit 33aee72
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 12 deletions.
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -158,12 +158,12 @@ format-tools:

lint: format-tools
golangci-lint run --tests=false
find . -name '*.go' -type f -not -path "./vendor*" -not -path "./x/vendor*" -not -path "./tests/system/vendor*" -not -path "*.git*" -not -path "*_test.go" | xargs gofumpt -d
find . -name '*.go' -type f -not -path "./vendor*" -not -path "./tests/system/vendor*" -not -path "*.git*" -not -path "*_test.go" | xargs gofumpt -d

format: format-tools
find . -name '*.go' -type f -not -path "./vendor*" -not -path "./x/vendor*" -not -path "./tests/system/vendor*" -not -path "*.git*" -not -path "./client/lcd/statik/statik.go" | xargs gofumpt -w
find . -name '*.go' -type f -not -path "./vendor*" -not -path "./x/vendor*" -not -path "./tests/system/vendor*" -not -path "*.git*" -not -path "./client/lcd/statik/statik.go" | xargs misspell -w
find . -name '*.go' -type f -not -path "./vendor*" -not -path "./x/vendor*" -not -path "./tests/system/vendor*" -not -path "*.git*" -not -path "./client/lcd/statik/statik.go" | xargs gci write --skip-generated -s standard -s default -s "prefix(cosmossdk.io)" -s "prefix(github.com/cosmos/cosmos-sdk)" -s "prefix(github.com/CosmWasm/wasmd)" --custom-order
find . -name '*.go' -type f -not -path "./vendor*" -not -path "./tests/system/vendor*" -not -path "*.git*" -not -path "./client/lcd/statik/statik.go" | xargs gofumpt -w
find . -name '*.go' -type f -not -path "./vendor*" -not -path "./tests/system/vendor*" -not -path "*.git*" -not -path "./client/lcd/statik/statik.go" | xargs misspell -w
find . -name '*.go' -type f -not -path "./vendor*" -not -path "./tests/system/vendor*" -not -path "*.git*" -not -path "./client/lcd/statik/statik.go" | xargs gci write --skip-generated -s standard -s default -s "prefix(cosmossdk.io)" -s "prefix(github.com/cosmos/cosmos-sdk)" -s "prefix(github.com/CosmWasm/wasmd)" --custom-order


###############################################################################
Expand Down
5 changes: 2 additions & 3 deletions benchmarks/app_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,10 @@ import (
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"

"github.com/CosmWasm/wasmd/app"
wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper"
wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types"
)

func setup(db dbm.DB, withGenesis bool, invCheckPeriod uint, opts ...wasmkeeper.Option) (*app.WasmApp, app.GenesisState) { //nolint:unparam
func setup(db dbm.DB, withGenesis bool) (*app.WasmApp, app.GenesisState) {

logLevel := log.LevelOption(zerolog.InfoLevel)

Expand All @@ -48,7 +47,7 @@ func setup(db dbm.DB, withGenesis bool, invCheckPeriod uint, opts ...wasmkeeper.
// SetupWithGenesisAccountsAndValSet initializes a new WasmApp with the provided genesis
// accounts and possible balances.
func SetupWithGenesisAccountsAndValSet(b testing.TB, db dbm.DB, genAccs []authtypes.GenesisAccount, balances ...banktypes.Balance) *app.WasmApp {
wasmApp, genesisState := setup(db, true, 0)
wasmApp, genesisState := setup(db, true)
authGenesis := authtypes.NewGenesisState(authtypes.DefaultParams(), genAccs)
appCodec := wasmApp.AppCodec()

Expand Down
4 changes: 2 additions & 2 deletions tests/integration/migrations_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ func TestModuleMigrations(t *testing.T) {
wasmApp := app.Setup(t)
myAddress := sdk.AccAddress(rand.Bytes(address.Len))

upgradeHandler := func(ctx sdk.Context, _ upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { //nolint:unparam
upgradeHandler := func(ctx sdk.Context, _ upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) {
return wasmApp.ModuleManager.RunMigrations(ctx, wasmApp.Configurator(), fromVM)
}

Expand Down Expand Up @@ -114,7 +114,7 @@ func TestAccessConfigMigrations(t *testing.T) {

wasmApp := app.Setup(t)

upgradeHandler := func(ctx sdk.Context, plan upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { //nolint:unparam
upgradeHandler := func(ctx sdk.Context, _ upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) {
return wasmApp.ModuleManager.RunMigrations(ctx, wasmApp.Configurator(), fromVM)
}

Expand Down
6 changes: 3 additions & 3 deletions tests/integration/module_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -581,7 +581,7 @@ func assertCodeList(t *testing.T, q *baseapp.GRPCQueryRouter, ctx sdk.Context, e
assert.Equal(t, expectedNum, len(res.CodeInfos))
}

func assertCodeBytes(t *testing.T, q *baseapp.GRPCQueryRouter, ctx sdk.Context, codeID uint64, expectedBytes []byte, marshaler codec.Codec) { //nolint:unparam
func assertCodeBytes(t *testing.T, q *baseapp.GRPCQueryRouter, ctx sdk.Context, codeID uint64, expectedBytes []byte, marshaler codec.Codec) {
t.Helper()
bz, err := marshaler.Marshal(&types.QueryCodeRequest{CodeId: codeID})
require.NoError(t, err)
Expand All @@ -601,7 +601,7 @@ func assertCodeBytes(t *testing.T, q *baseapp.GRPCQueryRouter, ctx sdk.Context,
assert.Equal(t, expectedBytes, rsp.Data)
}

func assertContractList(t *testing.T, q *baseapp.GRPCQueryRouter, ctx sdk.Context, codeID uint64, expContractAddrs []string, marshaler codec.Codec) { //nolint:unparam
func assertContractList(t *testing.T, q *baseapp.GRPCQueryRouter, ctx sdk.Context, codeID uint64, expContractAddrs []string, marshaler codec.Codec) {
t.Helper()
bz, err := marshaler.Marshal(&types.QueryContractsByCodeRequest{CodeId: codeID})
require.NoError(t, err)
Expand Down Expand Up @@ -644,7 +644,7 @@ func assertContractState(t *testing.T, q *baseapp.GRPCQueryRouter, ctx sdk.Conte
assert.Equal(t, expectedBz, rsp.Data)
}

func assertContractInfo(t *testing.T, q *baseapp.GRPCQueryRouter, ctx sdk.Context, contractBech32Addr string, codeID uint64, creator sdk.AccAddress, marshaler codec.Codec) { //nolint:unparam
func assertContractInfo(t *testing.T, q *baseapp.GRPCQueryRouter, ctx sdk.Context, contractBech32Addr string, codeID uint64, creator sdk.AccAddress, marshaler codec.Codec) {
t.Helper()
bz, err := marshaler.Marshal(&types.QueryContractInfoRequest{Address: contractBech32Addr})
require.NoError(t, err)
Expand Down

0 comments on commit 33aee72

Please sign in to comment.