re-public methods

This commit is contained in:
Jonathan Gimeno 2020-03-05 16:19:36 +01:00
parent 643b109826
commit 60031bbc9b
3 changed files with 9 additions and 9 deletions

View File

@ -5,8 +5,8 @@ import (
"github.com/cosmos/cosmos-sdk/x/mint/types" "github.com/cosmos/cosmos-sdk/x/mint/types"
) )
// 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)

View File

@ -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)

View File

@ -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