Skip to content

Commit

Permalink
fix: lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
zemyblue committed Jan 3, 2023
1 parent 130ceb7 commit 485fef4
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 20 deletions.
26 changes: 13 additions & 13 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ var (
vesting.AppModuleBasic{},
wasm.AppModuleBasic{},
ica.AppModuleBasic{},
//intertx.AppModuleBasic{}, // TODO support later
// intertx.AppModuleBasic{}, // TODO support later
)

// module account permissions
Expand Down Expand Up @@ -261,7 +261,7 @@ type WasmApp struct {
ibcKeeper *ibckeeper.Keeper // IBC Keeper must be a pointer in the app, so we can SetRouter on it correctly
icaControllerKeeper icacontrollerkeeper.Keeper
icaHostKeeper icahostkeeper.Keeper
//interTxKeeper intertxkeeper.Keeper // TODO support later
// interTxKeeper intertxkeeper.Keeper // TODO support later
transferKeeper ibctransferkeeper.Keeper
feeGrantKeeper feegrantkeeper.Keeper
authzKeeper authzkeeper.Keeper
Expand Down Expand Up @@ -503,13 +503,13 @@ func NewWasmApp(

// TODO support later
//// For wasmd we use the demo controller from https://github.com/cosmos/interchain-accounts but see notes below
//app.interTxKeeper = intertxkeeper.NewKeeper(appCodec, keys[intertxtypes.StoreKey], app.icaControllerKeeper, scopedInterTxKeeper)
// app.interTxKeeper = intertxkeeper.NewKeeper(appCodec, keys[intertxtypes.StoreKey], app.icaControllerKeeper, scopedInterTxKeeper)
// Note: please do your research before using this in production app, this is a demo and not an officially
// supported IBC team implementation. Do your own research before using it.
//interTxModule := intertx.NewAppModule(appCodec, app.interTxKeeper)
//interTxIBCModule := intertx.NewIBCModule(app.interTxKeeper)
// interTxModule := intertx.NewAppModule(appCodec, app.interTxKeeper)
// interTxIBCModule := intertx.NewIBCModule(app.interTxKeeper)
// You will likely want to swap out the second argument with your own reviewed and maintained ica auth module
//icaControllerIBCModule := icacontroller.NewIBCModule(app.icaControllerKeeper, interTxIBCModule)
// icaControllerIBCModule := icacontroller.NewIBCModule(app.icaControllerKeeper, interTxIBCModule)

icaControllerIBCModule := icacontroller.NewIBCModule(app.icaControllerKeeper, icaAuthModule)

Expand Down Expand Up @@ -565,7 +565,7 @@ func NewWasmApp(
AddRoute(ibctransfertypes.ModuleName, transferIBCModule).
AddRoute(icacontrollertypes.SubModuleName, icaControllerIBCModule).
AddRoute(icahosttypes.SubModuleName, icaHostIBCModule).
//AddRoute(intertxtypes.ModuleName, icaControllerIBCModule).
// AddRoute(intertxtypes.ModuleName, icaControllerIBCModule).
AddRoute(ibcmock.ModuleName, mockIBCModule)
app.ibcKeeper.SetRouter(ibcRouter)

Expand Down Expand Up @@ -639,7 +639,7 @@ func NewWasmApp(
ibctransfertypes.ModuleName,
ibchost.ModuleName,
icatypes.ModuleName,
//intertxtypes.ModuleName,
// intertxtypes.ModuleName,
wasm.ModuleName,
)

Expand All @@ -664,7 +664,7 @@ func NewWasmApp(
ibctransfertypes.ModuleName,
ibchost.ModuleName,
icatypes.ModuleName,
//intertxtypes.ModuleName,
// intertxtypes.ModuleName,
wasm.ModuleName,
)

Expand Down Expand Up @@ -696,7 +696,7 @@ func NewWasmApp(
ibctransfertypes.ModuleName,
ibchost.ModuleName,
icatypes.ModuleName,
//intertxtypes.ModuleName,
// intertxtypes.ModuleName,
// wasm after ibc transfer
wasm.ModuleName,
)
Expand Down Expand Up @@ -872,9 +872,9 @@ func (app *WasmApp) SimulationManager() *module.SimulationManager {
// API server.
func (app *WasmApp) RegisterAPIRoutes(apiSvr *api.Server, apiConfig config.APIConfig) {
clientCtx := apiSvr.ClientCtx
//rpc.RegisterRoutes(clientCtx, apiSvr.Router)
// rpc.RegisterRoutes(clientCtx, apiSvr.Router)
// Register legacy tx routes.
//authrest.RegisterTxRoutes(clientCtx, apiSvr.Router)
// authrest.RegisterTxRoutes(clientCtx, apiSvr.Router)
// Register new tx routes from grpc-gateway.
authtx.RegisterGRPCGatewayRoutes(clientCtx, apiSvr.GRPCGatewayRouter)
// Register new tendermint queries routes from grpc-gateway.
Expand All @@ -884,7 +884,7 @@ func (app *WasmApp) RegisterAPIRoutes(apiSvr *api.Server, apiConfig config.APICo
nodeservice.RegisterGRPCGatewayRoutes(clientCtx, apiSvr.GRPCGatewayRouter)

// Register legacy and grpc-gateway routes for all modules.
//ModuleBasics.RegisterRESTRoutes(clientCtx, apiSvr.Router)
// ModuleBasics.RegisterRESTRoutes(clientCtx, apiSvr.Router)
ModuleBasics.RegisterGRPCGatewayRoutes(clientCtx, apiSvr.GRPCGatewayRouter)

// register swagger API from root so that other applications can override easily
Expand Down
2 changes: 1 addition & 1 deletion app/export.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ func (app *WasmApp) ExportAppStateAndValidators(

// prepare for fresh start at zero height
// NOTE zero height genesis is a temporary feature which will be deprecated
// in favour of export at a block height
// in favour of export at a block height
func (app *WasmApp) prepForZeroHeightGenesis(ctx sdk.Context, jailAllowedAddrs []string) {
applyAllowedAddrs := false

Expand Down
2 changes: 1 addition & 1 deletion cmd/wasmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ package main

import (
"errors"
"github.com/spf13/viper"
"io"
"os"
"path/filepath"

"github.com/prometheus/client_golang/prometheus"
"github.com/spf13/cast"
"github.com/spf13/cobra"
"github.com/spf13/viper"
dbm "github.com/tendermint/tm-db"

"github.com/line/lbm-sdk/baseapp"
Expand Down
1 change: 1 addition & 0 deletions x/wasm/client/cli/new_tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ func MigrateContractCmd() *cobra.Command {
Aliases: []string{"update", "mig", "m"},
Args: cobra.ExactArgs(3),
RunE: func(cmd *cobra.Command, args []string) error {
//nolint:errcheck
clientCtx, _ := client.GetClientTxContext(cmd)

msg, err := parseMigrateContractArgs(args, clientCtx)
Expand Down
3 changes: 2 additions & 1 deletion x/wasm/client/cli/os/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ func ReadFileWithSizeLimit(name string, sizeLimit int64) ([]byte, error) {
data := make([]byte, 0, size)
for {
if len(data) >= cap(data) {
d := append(data[:cap(data)], 0)
d := data[:cap(data)]
d = append(d, 0)
data = d[:len(data)]
}
n, err := f.Read(data[len(data):cap(data)])
Expand Down
1 change: 1 addition & 0 deletions x/wasm/keeper/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ func PrometheusMetricsProvider(namespace string, labelsAndValues ...string) func

// NopMetricsProvider returns NopMetrics for each store
func NopMetricsProvider() func() *Metrics {
//nolint:gocritic
return func() *Metrics {
return NopMetrics()
}
Expand Down
2 changes: 2 additions & 0 deletions x/wasm/keeper/proposal_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,7 @@ func handleDeactivateContractProposal(ctx sdk.Context, k types.ContractOpsKeeper
}

// The error is already checked in ValidateBasic.
//nolint:errcheck
contractAddr, _ := sdk.AccAddressFromBech32(p.Contract)

err := k.DeactivateContract(ctx, contractAddr)
Expand All @@ -269,6 +270,7 @@ func handleActivateContractProposal(ctx sdk.Context, k types.ContractOpsKeeper,
}

// The error is already checked in ValidateBasic.
//nolint:errcheck
contractAddr, _ := sdk.AccAddressFromBech32(p.Contract)

err := k.ActivateContract(ctx, contractAddr)
Expand Down
7 changes: 3 additions & 4 deletions x/wasm/simulation/operations.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,10 @@ import (
)

// Simulation operation weights constants
//nolint:gosec
const (
OpWeightMsgStoreCode = "op_weight_msg_store_code"
OpWeightMsgInstantiateContract = "op_weight_msg_instantiate_contract"
OpReflectContractPath = "op_reflect_contract_path"
OpWeightMsgStoreCode = "op_weight_msg_store_code" //nolint:gosec
OpWeightMsgInstantiateContract = "op_weight_msg_instantiate_contract" //nolint:gosec
OpReflectContractPath = "op_reflect_contract_path" //nolint:gosec
)

// WasmKeeper is a subset of the wasm keeper used by simulations
Expand Down

0 comments on commit 485fef4

Please sign in to comment.