Skip to content

Commit

Permalink
fix: lint error
Browse files Browse the repository at this point in the history
  • Loading branch information
j75689 committed Jan 3, 2023
1 parent a7617fe commit db38442
Show file tree
Hide file tree
Showing 6 changed files with 4 additions and 37 deletions.
3 changes: 1 addition & 2 deletions server/types/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import (
"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/server/api"
"github.com/cosmos/cosmos-sdk/server/config"
serverconfig "github.com/cosmos/cosmos-sdk/server/config"
sdk "github.com/cosmos/cosmos-sdk/types"
)

Expand Down Expand Up @@ -70,7 +69,7 @@ type (

// AppCreator is a function that allows us to lazily initialize an
// application using various configurations.
AppCreator func(log.Logger, dbm.DB, io.Writer, serverconfig.Config, string, AppOptions) Application
AppCreator func(log.Logger, dbm.DB, io.Writer, config.Config, string, AppOptions) Application

// ModuleInitFlags takes a start command and adds modules specific init flags.
ModuleInitFlags func(startCmd *cobra.Command)
Expand Down
1 change: 0 additions & 1 deletion x/upgrade/abci.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ func BeginBlocker(k keeper.Keeper, ctx sdk.Context, _ abci.RequestBeginBlock) {
return
}
}

}

// BuildUpgradeNeededMsg prints the message that notifies that an upgrade is needed.
Expand Down
22 changes: 0 additions & 22 deletions x/upgrade/keeper/keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,28 +60,6 @@ func (k Keeper) SetUpgradeHandler(name string, upgradeHandler types.UpgradeHandl
k.upgradeHandlers[name] = upgradeHandler
}

// setProtocolVersion sets the protocol version to state
func (k Keeper) setProtocolVersion(ctx sdk.Context, v uint64) {
store := ctx.KVStore(k.storeKey)
versionBytes := make([]byte, 8)
binary.BigEndian.PutUint64(versionBytes, v)
store.Set([]byte{types.ProtocolVersionByte}, versionBytes)
}

// getProtocolVersion gets the protocol version from state
func (k Keeper) getProtocolVersion(ctx sdk.Context) uint64 {
store := ctx.KVStore(k.storeKey)
ok := store.Has([]byte{types.ProtocolVersionByte})
if ok {
pvBytes := store.Get([]byte{types.ProtocolVersionByte})
protocolVersion := binary.BigEndian.Uint64(pvBytes)

return protocolVersion
}
// default value
return 0
}

// SetModuleVersionMap saves a given version map to state
func (k Keeper) SetModuleVersionMap(ctx sdk.Context, vm module.VersionMap) {
if len(vm) > 0 {
Expand Down
8 changes: 2 additions & 6 deletions x/upgrade/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,7 @@ func (AppModuleBasic) Name() string {
}

// RegisterLegacyAminoCodec registers the upgrade types on the LegacyAmino codec
func (AppModuleBasic) RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) {

}
func (AppModuleBasic) RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) {}

// RegisterGRPCGatewayRoutes registers the gRPC Gateway routes for the upgrade module.
func (AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *runtime.ServeMux) {
Expand All @@ -57,9 +55,7 @@ func (AppModuleBasic) GetTxCmd() *cobra.Command {
return nil
}

func (b AppModuleBasic) RegisterInterfaces(registry codectypes.InterfaceRegistry) {

}
func (b AppModuleBasic) RegisterInterfaces(registry codectypes.InterfaceRegistry) {}

// AppModule implements the sdk.AppModule interface
type AppModule struct {
Expand Down
3 changes: 0 additions & 3 deletions x/upgrade/types/keys.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@ const (
// VersionMapByte is a prefix to look up module names (key) and versions (value)
VersionMapByte = 0x2

// ProtocolVersionByte is a prefix to look up Protocol Version
ProtocolVersionByte = 0x3

// KeyUpgradedIBCState is the key under which upgraded ibc state is stored in the upgrade store
KeyUpgradedIBCState = "upgradedIBCState"

Expand Down
4 changes: 1 addition & 3 deletions x/upgrade/types/upgrade_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,7 @@ func (c UpgradeConfig) GetPlan(height int64) []*Plan {
}

// get recent upgrade plan
var (
recentHeight = int64(math.MaxInt64)
)
recentHeight := int64(math.MaxInt64)
for vHeight, vPlans := range c {
if vHeight > height {
if vHeight < recentHeight {
Expand Down

0 comments on commit db38442

Please sign in to comment.