make private methods that does not need to be exported

This commit is contained in:
Jonathan Gimeno 2020-03-05 11:56:39 +01:00
parent e01c99d019
commit 29abc244eb
3 changed files with 8 additions and 8 deletions

View File

@ -6,7 +6,7 @@ import (
)
// BeginBlocker mints new tokens for the previous block.
func BeginBlocker(ctx sdk.Context, k Keeper) {
func beginBlocker(ctx sdk.Context, k Keeper) {
// fetch stored minter & params
minter := k.GetMinter(ctx)
params := k.GetParams(ctx)

View File

@ -5,16 +5,16 @@ import (
"github.com/cosmos/cosmos-sdk/x/mint/types"
)
// InitGenesis new mint genesis
func InitGenesis(ctx sdk.Context, keeper Keeper, supplyKeeper types.SupplyKeeper, data GenesisState) {
// initGenesis new mint genesis
func initGenesis(ctx sdk.Context, keeper Keeper, supplyKeeper types.SupplyKeeper, data GenesisState) {
keeper.SetMinter(ctx, data.Minter)
keeper.SetParams(ctx, data.Params)
supplyKeeper.GetModuleAccount(ctx, ModuleName)
}
// ExportGenesis returns a GenesisState for a given context and keeper.
func ExportGenesis(ctx sdk.Context, keeper Keeper) GenesisState {
// exportGenesis returns a GenesisState for a given context and keeper.
func exportGenesis(ctx sdk.Context, keeper Keeper) GenesisState {
minter := keeper.GetMinter(ctx)
params := keeper.GetParams(ctx)
return NewGenesisState(minter, params)

View File

@ -119,7 +119,7 @@ func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONMarshaler, data j
var genesisState GenesisState
cdc.MustUnmarshalJSON(data, &genesisState)
InitGenesis(ctx, am.keeper, am.supplyKeeper, genesisState)
initGenesis(ctx, am.keeper, am.supplyKeeper, genesisState)
return []abci.ValidatorUpdate{}
}
@ -127,13 +127,13 @@ func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONMarshaler, data j
// ExportGenesis returns the exported genesis state as raw bytes for the mint
// module.
func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONMarshaler) json.RawMessage {
gs := ExportGenesis(ctx, am.keeper)
gs := exportGenesis(ctx, am.keeper)
return cdc.MustMarshalJSON(gs)
}
// BeginBlock returns the begin blocker for the mint module.
func (am AppModule) BeginBlock(ctx sdk.Context, _ abci.RequestBeginBlock) {
BeginBlocker(ctx, am.keeper)
beginBlocker(ctx, am.keeper)
}
// EndBlock returns the end blocker for the mint module. It returns no validator