Skip to content

Commit

Permalink
style: make go linter happy again
Browse files Browse the repository at this point in the history
  • Loading branch information
ccamel committed Feb 2, 2022
1 parent 854a98d commit 4c07c87
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 16 deletions.
25 changes: 13 additions & 12 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ func getGovProposalHandlers() []govclient.ProposalHandler {
}

var (
// DefaultNodeHome default home directories for the application daemon
// DefaultNodeHome default home directories for the application daemon.
DefaultNodeHome string

// ModuleBasics defines the module BasicManager is in charge of setting up basic,
Expand All @@ -146,7 +146,7 @@ var (
// this line is used by starport scaffolding # stargate/app/moduleBasic
)

// module account permissions
// module account permissions.
maccPerms = map[string][]string{
authtypes.FeeCollectorName: nil,
distrtypes.ModuleName: nil,
Expand Down Expand Up @@ -222,6 +222,7 @@ type App struct {
}

// New returns a reference to an initialized blockchain app
// nolint:funlen // This function is generated by starport
func New(
logger log.Logger,
db dbm.DB,
Expand Down Expand Up @@ -482,23 +483,23 @@ func New(
return app
}

// Name returns the name of the App
// Name returns the name of the App.
func (app *App) Name() string { return app.BaseApp.Name() }

// GetBaseApp returns the base app of the application
// GetBaseApp returns the base app of the application.
func (app App) GetBaseApp() *baseapp.BaseApp { return app.BaseApp }

// BeginBlocker application updates every begin block
// BeginBlocker application updates every begin block.
func (app *App) BeginBlocker(ctx sdk.Context, req abci.RequestBeginBlock) abci.ResponseBeginBlock {
return app.mm.BeginBlock(ctx, req)
}

// EndBlocker application updates every end block
// EndBlocker application updates every end block.
func (app *App) EndBlocker(ctx sdk.Context, req abci.RequestEndBlock) abci.ResponseEndBlock {
return app.mm.EndBlock(ctx, req)
}

// InitChainer application update at chain initialization
// InitChainer application update at chain initialization.
func (app *App) InitChainer(ctx sdk.Context, req abci.RequestInitChain) abci.ResponseInitChain {
var genesisState GenesisState
if err := tmjson.Unmarshal(req.AppStateBytes, &genesisState); err != nil {
Expand All @@ -508,7 +509,7 @@ func (app *App) InitChainer(ctx sdk.Context, req abci.RequestInitChain) abci.Res
return app.mm.InitGenesis(ctx, app.appCodec, genesisState)
}

// LoadHeight loads a particular height
// LoadHeight loads a particular height.
func (app *App) LoadHeight(height int64) error {
return app.LoadVersion(height)
}
Expand Down Expand Up @@ -539,7 +540,7 @@ func (app *App) AppCodec() codec.Codec {
return app.appCodec
}

// InterfaceRegistry returns an InterfaceRegistry
// InterfaceRegistry returns an InterfaceRegistry.
func (app *App) InterfaceRegistry() types.InterfaceRegistry {
return app.interfaceRegistry
}
Expand Down Expand Up @@ -604,7 +605,7 @@ func (app *App) RegisterTendermintService(clientCtx client.Context) {
tmservice.RegisterTendermintService(app.BaseApp.GRPCQueryRouter(), clientCtx, app.interfaceRegistry)
}

// GetMaccPerms returns a copy of the module account permissions
// GetMaccPerms returns a copy of the module account permissions.
func GetMaccPerms() map[string][]string {
dupMaccPerms := make(map[string][]string)
for k, v := range maccPerms {
Expand All @@ -613,7 +614,7 @@ func GetMaccPerms() map[string][]string {
return dupMaccPerms
}

// initParamsKeeper init params keeper and its subspaces
// initParamsKeeper init params keeper and its subspaces.
func initParamsKeeper(appCodec codec.BinaryCodec, legacyAmino *codec.LegacyAmino, key, tkey sdk.StoreKey) paramskeeper.Keeper {
paramsKeeper := paramskeeper.NewKeeper(appCodec, legacyAmino, key, tkey)

Expand All @@ -632,7 +633,7 @@ func initParamsKeeper(appCodec codec.BinaryCodec, legacyAmino *codec.LegacyAmino
return paramsKeeper
}

// SimulationManager implements the SimulationApp interface
// SimulationManager implements the SimulationApp interface.
func (app *App) SimulationManager() *module.SimulationManager {
return app.sm
}
2 changes: 1 addition & 1 deletion app/export.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import (
func (app *App) ExportAppStateAndValidators(
forZeroHeight bool, jailAllowedAddrs []string,
) (servertypes.ExportedApp, error) {

// as if they could withdraw from the start of the next block
ctx := app.NewContext(true, tmproto.Header{Height: app.LastBlockHeight()})

Expand Down Expand Up @@ -51,6 +50,7 @@ func (app *App) 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
// nolint:funlen // This is an auto generated function by starport.
func (app *App) prepForZeroHeightGenesis(ctx sdk.Context, jailAllowedAddrs []string) {
applyAllowedAddrs := false

Expand Down
2 changes: 1 addition & 1 deletion app/simulation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ var defaultConsensusParams = &abci.ConsensusParams{
// Running using starport command:
// `starport chain simulate -v --numBlocks 200 --blockSize 50`
// Running as go benchmark test:
// `go test -benchmem -run=^$ -bench ^BenchmarkSimulation ./app -NumBlocks=200 -BlockSize 50 -Commit=true -Verbose=true -Enabled=true`
// `go test -benchmem -run=^$ -bench ^BenchmarkSimulation ./app -NumBlocks=200 -BlockSize 50 -Commit=true -Verbose=true -Enabled=true`.
func BenchmarkSimulation(b *testing.B) {
simapp.FlagEnabledValue = true
simapp.FlagCommitValue = true
Expand Down
2 changes: 1 addition & 1 deletion testutil/network/network.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ func New(t *testing.T, configs ...network.Config) *network.Network {
}

// DefaultConfig will initialize config for the network with custom application,
// genesis and single validator. All other parameters are inherited from cosmos-sdk/testutil/network.DefaultConfig
// genesis and single validator. All other parameters are inherited from cosmos-sdk/testutil/network.DefaultConfig.
func DefaultConfig() network.Config {
encoding := cosmoscmd.MakeEncodingConfig(app.ModuleBasics)
return network.Config{
Expand Down
1 change: 1 addition & 0 deletions testutil/nullify/nullify.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ var (
// Fill analyze all struct fields and slices with
// reflection and initialize the nil and empty slices,
// structs, and pointers.
// nolint: exhaustive
func Fill(x interface{}) interface{} {
v := reflect.Indirect(reflect.ValueOf(x))
switch v.Kind() {
Expand Down
2 changes: 1 addition & 1 deletion testutil/sample/sample.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
sdk "github.com/cosmos/cosmos-sdk/types"
)

// AccAddress returns a sample account address
// AccAddress returns a sample account address.
func AccAddress() string {
pk := ed25519.GenPrivKey().PubKey()
addr := pk.Address()
Expand Down

0 comments on commit 4c07c87

Please sign in to comment.