-
Notifications
You must be signed in to change notification settings - Fork 38
/
genesis.go
42 lines (38 loc) · 1.42 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
39
40
41
42
package types
import (
"github.com/sentinel-official/hub/x/deposit"
"github.com/sentinel-official/hub/x/node"
"github.com/sentinel-official/hub/x/plan"
"github.com/sentinel-official/hub/x/provider"
"github.com/sentinel-official/hub/x/session"
"github.com/sentinel-official/hub/x/subscription"
)
type GenesisState struct {
Deposits deposit.GenesisState `json:"deposits"`
Providers provider.GenesisState `json:"providers"`
Nodes node.GenesisState `json:"nodes"`
Plans plan.GenesisState `json:"plans"`
Subscriptions subscription.GenesisState `json:"subscriptions"`
Sessions session.GenesisState `json:"sessions"`
}
func NewGenesisState(deposits deposit.GenesisState, providers provider.GenesisState, nodes node.GenesisState,
plans plan.GenesisState, subscriptions subscription.GenesisState, sessions session.GenesisState) GenesisState {
return GenesisState{
Deposits: deposits,
Providers: providers,
Nodes: nodes,
Plans: plans,
Subscriptions: subscriptions,
Sessions: sessions,
}
}
func DefaultGenesisState() GenesisState {
return GenesisState{
Deposits: deposit.DefaultGenesisState(),
Providers: provider.DefaultGenesisState(),
Nodes: node.DefaultGenesisState(),
Plans: plan.DefaultGenesisState(),
Subscriptions: subscription.DefaultGenesisState(),
Sessions: session.DefaultGenesisState(),
}
}