mirror of https://github.com/certusone/wasmd.git
Add linter name and minor golint related updates (#663)
This commit is contained in:
parent
dfba1395d9
commit
c18bc4b00e
|
@ -195,7 +195,7 @@ var (
|
|||
// WasmApp extended ABCI application
|
||||
type WasmApp struct {
|
||||
*baseapp.BaseApp
|
||||
legacyAmino *codec.LegacyAmino //nolint
|
||||
legacyAmino *codec.LegacyAmino //nolint:staticcheck
|
||||
appCodec codec.Marshaler
|
||||
interfaceRegistry types.InterfaceRegistry
|
||||
|
||||
|
@ -557,7 +557,7 @@ func (app *WasmApp) ModuleAccountAddrs() map[string]bool {
|
|||
//
|
||||
// NOTE: This is solely to be used for testing purposes as it may be desirable
|
||||
// for modules to register their own custom testing types.
|
||||
func (app *WasmApp) LegacyAmino() *codec.LegacyAmino { //nolint
|
||||
func (app *WasmApp) LegacyAmino() *codec.LegacyAmino { //nolint:staticcheck
|
||||
return app.legacyAmino
|
||||
}
|
||||
|
||||
|
@ -631,7 +631,7 @@ func GetMaccPerms() map[string][]string {
|
|||
}
|
||||
|
||||
// initParamsKeeper init params keeper and its subspaces
|
||||
func initParamsKeeper(appCodec codec.BinaryMarshaler, legacyAmino *codec.LegacyAmino, key, tkey sdk.StoreKey) paramskeeper.Keeper { //nolint
|
||||
func initParamsKeeper(appCodec codec.BinaryMarshaler, legacyAmino *codec.LegacyAmino, key, tkey sdk.StoreKey) paramskeeper.Keeper { //nolint:staticcheck
|
||||
paramsKeeper := paramskeeper.NewKeeper(appCodec, legacyAmino, key, tkey)
|
||||
|
||||
paramsKeeper.Subspace(authtypes.ModuleName)
|
||||
|
|
|
@ -14,7 +14,7 @@ type EncodingConfig struct {
|
|||
InterfaceRegistry types.InterfaceRegistry
|
||||
Marshaler codec.Marshaler
|
||||
TxConfig client.TxConfig
|
||||
Amino *codec.LegacyAmino //nolint
|
||||
Amino *codec.LegacyAmino //nolint:staticcheck
|
||||
}
|
||||
|
||||
func MakeEncodingConfig() EncodingConfig {
|
||||
|
|
|
@ -151,7 +151,7 @@ func GetCmdQueryCode() *cobra.Command {
|
|||
}
|
||||
|
||||
fmt.Printf("Downloading wasm code to %s\n", args[1])
|
||||
return ioutil.WriteFile(args[1], res.Data, 0644) //nolint
|
||||
return ioutil.WriteFile(args[1], res.Data, 0600)
|
||||
},
|
||||
}
|
||||
flags.AddQueryFlagsToCmd(cmd)
|
||||
|
|
|
@ -25,7 +25,7 @@ func NewHandler(k types.ContractOpsKeeper) sdk.Handler {
|
|||
err error
|
||||
)
|
||||
switch msg := msg.(type) {
|
||||
case *MsgStoreCode: //nolint
|
||||
case *MsgStoreCode:
|
||||
res, err = msgServer.StoreCode(sdk.WrapSDKContext(ctx), msg)
|
||||
case *MsgInstantiateContract:
|
||||
res, err = msgServer.InstantiateContract(sdk.WrapSDKContext(ctx), msg)
|
||||
|
|
|
@ -556,7 +556,7 @@ func (k Keeper) appendToContractHistory(ctx sdk.Context, contractAddr sdk.AccAdd
|
|||
for _, e := range newEntries {
|
||||
pos++
|
||||
key := types.GetContractCodeHistoryElementKey(contractAddr, pos)
|
||||
store.Set(key, k.cdc.MustMarshalBinaryBare(&e)) //nolint
|
||||
store.Set(key, k.cdc.MustMarshalBinaryBare(&e)) //nolint:gosec
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@ type grpcQuerier struct {
|
|||
}
|
||||
|
||||
// NewGrpcQuerier constructor
|
||||
func NewGrpcQuerier(cdc codec.Marshaler, storeKey sdk.StoreKey, keeper types.ViewKeeper, queryGasLimit sdk.Gas) *grpcQuerier { //nolint
|
||||
func NewGrpcQuerier(cdc codec.Marshaler, storeKey sdk.StoreKey, keeper types.ViewKeeper, queryGasLimit sdk.Gas) *grpcQuerier { //nolint:revive
|
||||
return &grpcQuerier{cdc: cdc, storeKey: storeKey, keeper: keeper, queryGasLimit: queryGasLimit}
|
||||
}
|
||||
|
||||
|
|
|
@ -498,7 +498,7 @@ func StoreRandomContract(t TestingT, ctx sdk.Context, keepers TestKeepers, mock
|
|||
creator, _, creatorAddr := keyPubAddr()
|
||||
fundAccounts(t, ctx, keepers.AccountKeeper, keepers.BankKeeper, creatorAddr, anyAmount)
|
||||
keepers.WasmKeeper.wasmVM = mock
|
||||
wasmCode := append(wasmIdent, rand.Bytes(10)...) //nolint
|
||||
wasmCode := append(wasmIdent, rand.Bytes(10)...) //nolint:gocritic
|
||||
codeID, err := keepers.ContractKeeper.Create(ctx, creatorAddr, wasmCode, nil)
|
||||
require.NoError(t, err)
|
||||
exampleContract := ExampleContract{InitialAmount: anyAmount, Creator: creator, CreatorAddr: creatorAddr, CodeID: codeID}
|
||||
|
@ -599,7 +599,7 @@ func (m BurnerExampleInitMsg) GetBytes(t TestingT) []byte {
|
|||
return initMsgBz
|
||||
}
|
||||
|
||||
func createFakeFundedAccount(t TestingT, ctx sdk.Context, am authkeeper.AccountKeeper, bank bankkeeper.Keeper, coins sdk.Coins) sdk.AccAddress { //nolint
|
||||
func createFakeFundedAccount(t TestingT, ctx sdk.Context, am authkeeper.AccountKeeper, bank bankkeeper.Keeper, coins sdk.Coins) sdk.AccAddress { //nolint:deadcode,unused
|
||||
_, _, addr := keyPubAddr()
|
||||
fundAccounts(t, ctx, am, bank, addr, coins)
|
||||
return addr
|
||||
|
|
|
@ -40,12 +40,15 @@ const (
|
|||
// AppModuleBasic defines the basic application module used by the wasm module.
|
||||
type AppModuleBasic struct{}
|
||||
|
||||
func (b AppModuleBasic) RegisterLegacyAminoCodec(amino *codec.LegacyAmino) { //nolint
|
||||
func (b AppModuleBasic) RegisterLegacyAminoCodec(amino *codec.LegacyAmino) { //nolint:staticcheck
|
||||
RegisterCodec(amino)
|
||||
}
|
||||
|
||||
func (b AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, serveMux *runtime.ServeMux) {
|
||||
types.RegisterQueryHandlerClient(context.Background(), serveMux, types.NewQueryClient(clientCtx)) //nolint
|
||||
err := types.RegisterQueryHandlerClient(context.Background(), serveMux, types.NewQueryClient(clientCtx))
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
}
|
||||
|
||||
// Name returns the wasm module's name.
|
||||
|
@ -116,7 +119,7 @@ func (am AppModule) RegisterServices(cfg module.Configurator) {
|
|||
types.RegisterQueryServer(cfg.QueryServer(), NewQuerier(am.keeper))
|
||||
}
|
||||
|
||||
func (am AppModule) LegacyQuerierHandler(amino *codec.LegacyAmino) sdk.Querier { //nolint
|
||||
func (am AppModule) LegacyQuerierHandler(amino *codec.LegacyAmino) sdk.Querier { //nolint:staticcheck
|
||||
return keeper.NewLegacyQuerier(am.keeper, am.keeper.QueryGasLimit())
|
||||
}
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@ import (
|
|||
)
|
||||
|
||||
// RegisterLegacyAminoCodec registers the account types and interface
|
||||
func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { //nolint
|
||||
func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { //nolint:staticcheck
|
||||
cdc.RegisterConcrete(&MsgStoreCode{}, "wasm/MsgStoreCode", nil)
|
||||
cdc.RegisterConcrete(&MsgInstantiateContract{}, "wasm/MsgInstantiateContract", nil)
|
||||
cdc.RegisterConcrete(&MsgExecuteContract{}, "wasm/MsgExecuteContract", nil)
|
||||
|
|
Loading…
Reference in New Issue