-
Notifications
You must be signed in to change notification settings - Fork 670
/
config.go
50 lines (36 loc) · 1.18 KB
/
config.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
48
49
50
// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved.
// See the file LICENSE for licensing terms.
package upgrade
import "time"
type Config struct {
// Time of the AP3 network upgrade
ApricotPhase3Time time.Time
// Time of the AP5 network upgrade
ApricotPhase5Time time.Time
// Time of the Banff network upgrade
BanffTime time.Time
// Time of the Cortina network upgrade
CortinaTime time.Time
// Time of the Durango network upgrade
DurangoTime time.Time
// Time of the E network upgrade
EUpgradeTime time.Time
}
func (c *Config) IsApricotPhase3Activated(timestamp time.Time) bool {
return !timestamp.Before(c.ApricotPhase3Time)
}
func (c *Config) IsApricotPhase5Activated(timestamp time.Time) bool {
return !timestamp.Before(c.ApricotPhase5Time)
}
func (c *Config) IsBanffActivated(timestamp time.Time) bool {
return !timestamp.Before(c.BanffTime)
}
func (c *Config) IsCortinaActivated(timestamp time.Time) bool {
return !timestamp.Before(c.CortinaTime)
}
func (c *Config) IsDurangoActivated(timestamp time.Time) bool {
return !timestamp.Before(c.DurangoTime)
}
func (c *Config) IsEActivated(timestamp time.Time) bool {
return !timestamp.Before(c.EUpgradeTime)
}