-
Notifications
You must be signed in to change notification settings - Fork 0
/
epochs.go
38 lines (34 loc) · 1.22 KB
/
epochs.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 constants
import (
"time"
"github.com/furyanprotocol/v4-chain/protocol/x/epochs/types"
)
var (
Duration_OneYear = time.Hour * 24 * 365
)
// GenerateEpochGenesisStateWithoutFunding is a testutil function to generate
// genesis state for the epochs module where no new epochs will trigger for
// `funding-tick` and `funding-sample` within the next 365 days, meaning that
// there will be no funding payment for unit and end-to-end tests that use this
// genesis state.
func GenerateEpochGenesisStateWithoutFunding() types.GenesisState {
now := time.Now()
return *types.DefaultGenesisWithEpochs(
types.EpochInfo{
Name: string(types.FundingSampleEpochInfoName),
NextTick: uint32(now.Add(Duration_OneYear).Unix()),
Duration: uint32(Duration_OneYear.Seconds()),
CurrentEpoch: 0,
CurrentEpochStartBlock: 0,
FastForwardNextTick: false,
},
types.EpochInfo{
Name: string(types.FundingTickEpochInfoName),
NextTick: uint32(now.Add(Duration_OneYear).Unix()),
Duration: uint32(Duration_OneYear.Seconds()),
CurrentEpoch: 0,
CurrentEpochStartBlock: 0,
FastForwardNextTick: false,
},
)
}