-
Notifications
You must be signed in to change notification settings - Fork 2
/
genesis.go
31 lines (25 loc) · 867 Bytes
/
genesis.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package pbb
import (
"github.com/csmuller/up-voting-system/pbb/internal/keeper"
"github.com/csmuller/up-voting-system/pbb/internal/types"
sdk "github.com/cosmos/cosmos-sdk/types"
)
func ValidateGenesis(genesisState types.GenesisState) error {
// TODO: Validate parameters.
//params := genesisState.Params
return nil
}
func DefaultGenesisState() types.GenesisState {
return types.GenesisState{
Params: types.DefaultParams(),
}
}
// InitGenesis - Init parameter store from genesis data
func InitGenesis(ctx sdk.Context, bk keeper.BulletinBoardKeeper, data types.GenesisState) {
bk.SetParams(ctx, data.Params)
}
// ExportGenesis returns a GenesisState for a given context and bulletinBoardKeeper
func ExportGenesis(ctx sdk.Context, bk keeper.BulletinBoardKeeper) types.GenesisState {
params := bk.GetParams(ctx)
return types.NewGenesisState(params)
}