make private methods that does not need to be exported
This commit is contained in:
parent
e01c99d019
commit
29abc244eb
|
@ -6,7 +6,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
// BeginBlocker mints new tokens for the previous block.
|
// 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
|
// fetch stored minter & params
|
||||||
minter := k.GetMinter(ctx)
|
minter := k.GetMinter(ctx)
|
||||||
params := k.GetParams(ctx)
|
params := k.GetParams(ctx)
|
||||||
|
|
|
@ -5,16 +5,16 @@ import (
|
||||||
"github.com/cosmos/cosmos-sdk/x/mint/types"
|
"github.com/cosmos/cosmos-sdk/x/mint/types"
|
||||||
)
|
)
|
||||||
|
|
||||||
// InitGenesis new mint genesis
|
// initGenesis new mint genesis
|
||||||
func InitGenesis(ctx sdk.Context, keeper Keeper, supplyKeeper types.SupplyKeeper, data GenesisState) {
|
func initGenesis(ctx sdk.Context, keeper Keeper, supplyKeeper types.SupplyKeeper, data GenesisState) {
|
||||||
keeper.SetMinter(ctx, data.Minter)
|
keeper.SetMinter(ctx, data.Minter)
|
||||||
keeper.SetParams(ctx, data.Params)
|
keeper.SetParams(ctx, data.Params)
|
||||||
|
|
||||||
supplyKeeper.GetModuleAccount(ctx, ModuleName)
|
supplyKeeper.GetModuleAccount(ctx, ModuleName)
|
||||||
}
|
}
|
||||||
|
|
||||||
// ExportGenesis returns a GenesisState for a given context and keeper.
|
// exportGenesis returns a GenesisState for a given context and keeper.
|
||||||
func ExportGenesis(ctx sdk.Context, keeper Keeper) GenesisState {
|
func exportGenesis(ctx sdk.Context, keeper Keeper) GenesisState {
|
||||||
minter := keeper.GetMinter(ctx)
|
minter := keeper.GetMinter(ctx)
|
||||||
params := keeper.GetParams(ctx)
|
params := keeper.GetParams(ctx)
|
||||||
return NewGenesisState(minter, params)
|
return NewGenesisState(minter, params)
|
||||||
|
|
|
@ -119,7 +119,7 @@ func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONMarshaler, data j
|
||||||
var genesisState GenesisState
|
var genesisState GenesisState
|
||||||
cdc.MustUnmarshalJSON(data, &genesisState)
|
cdc.MustUnmarshalJSON(data, &genesisState)
|
||||||
|
|
||||||
InitGenesis(ctx, am.keeper, am.supplyKeeper, genesisState)
|
initGenesis(ctx, am.keeper, am.supplyKeeper, genesisState)
|
||||||
|
|
||||||
return []abci.ValidatorUpdate{}
|
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
|
// ExportGenesis returns the exported genesis state as raw bytes for the mint
|
||||||
// module.
|
// module.
|
||||||
func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONMarshaler) json.RawMessage {
|
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)
|
return cdc.MustMarshalJSON(gs)
|
||||||
}
|
}
|
||||||
|
|
||||||
// BeginBlock returns the begin blocker for the mint module.
|
// BeginBlock returns the begin blocker for the mint module.
|
||||||
func (am AppModule) BeginBlock(ctx sdk.Context, _ abci.RequestBeginBlock) {
|
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
|
// EndBlock returns the end blocker for the mint module. It returns no validator
|
||||||
|
|
Loading…
Reference in New Issue