-
Notifications
You must be signed in to change notification settings - Fork 210
/
genesis.go
38 lines (30 loc) · 1.08 KB
/
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
32
33
34
35
36
37
38
package take
import (
sdk "github.com/cosmos/cosmos-sdk/types"
abci "github.com/tendermint/tendermint/abci/types"
types "github.com/akash-network/akash-api/go/node/take/v1beta3"
"github.com/akash-network/node/x/take/keeper"
)
// ValidateGenesis does validation check of the Genesis and return error incase of failure
func ValidateGenesis(data *types.GenesisState) error {
return data.Params.Validate()
}
// DefaultGenesisState returns default genesis state as raw bytes for the deployment
// module.
func DefaultGenesisState() *types.GenesisState {
return &types.GenesisState{
Params: types.DefaultParams(),
}
}
// InitGenesis initiate genesis state and return updated validator details
func InitGenesis(ctx sdk.Context, keeper keeper.IKeeper, data *types.GenesisState) []abci.ValidatorUpdate {
keeper.SetParams(ctx, data.Params)
return []abci.ValidatorUpdate{}
}
// ExportGenesis returns genesis state for the deployment module
func ExportGenesis(ctx sdk.Context, k keeper.IKeeper) *types.GenesisState {
params := k.GetParams(ctx)
return &types.GenesisState{
Params: params,
}
}