-
Notifications
You must be signed in to change notification settings - Fork 85
/
genesis.go
47 lines (42 loc) · 1.3 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
43
44
45
46
47
package types
import (
time "time"
"github.com/dydxprotocol/v4-chain/protocol/lib"
rewardstypes "github.com/dydxprotocol/v4-chain/protocol/x/rewards/types"
)
var (
DefaultVestingStartTime = time.Date(2023, 1, 1, 0, 0, 0, 0, time.UTC).In(time.UTC)
DefaultVestingEndTime = time.Date(2025, 1, 1, 0, 0, 0, 0, time.UTC).In(time.UTC)
)
// DefaultGenesis returns the default genesis state
func DefaultGenesis() *GenesisState {
return &GenesisState{
// TODO(CORE-530): in genesis.sh, overwrite start and end times dynamically for testnets.
VestEntries: []VestEntry{
{
VesterAccount: CommunityVesterAccountName,
TreasuryAccount: CommunityTreasuryAccountName,
Denom: lib.DefaultBaseDenom,
StartTime: DefaultVestingStartTime,
EndTime: DefaultVestingEndTime,
},
{
VesterAccount: rewardstypes.VesterAccountName,
TreasuryAccount: rewardstypes.TreasuryAccountName,
Denom: lib.DefaultBaseDenom,
StartTime: DefaultVestingStartTime,
EndTime: DefaultVestingEndTime,
},
},
}
}
// Validate performs basic genesis state validation returning an error upon any
// failure.
func (gs GenesisState) Validate() error {
for _, vs := range gs.VestEntries {
if err := vs.Validate(); err != nil {
return err
}
}
return nil
}