re-public methods
This commit is contained in:
parent
643b109826
commit
60031bbc9b
|
@ -5,8 +5,8 @@ import (
|
|||
"github.com/cosmos/cosmos-sdk/x/mint/types"
|
||||
)
|
||||
|
||||
// beginBlocker mints new tokens for the previous block.
|
||||
func beginBlocker(ctx sdk.Context, k Keeper) {
|
||||
// BeginBlocker mints new tokens for the previous block.
|
||||
func BeginBlocker(ctx sdk.Context, k Keeper) {
|
||||
// fetch stored minter & params
|
||||
minter := k.GetMinter(ctx)
|
||||
params := k.GetParams(ctx)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue