This repository has been archived by the owner on Feb 6, 2023. It is now read-only.
/
timelord.go
65 lines (51 loc) · 2.1 KB
/
timelord.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
package types
// SkippingPeakEvent data that is sent when a timelord skips a peak because it was fastest/already had the peak
type SkippingPeakEvent struct {
Success bool `json:"success"`
Height uint32 `json:"height"`
}
// NewPeakEvent data that is sent when a timelord skips a peak because it was fastest/already had the peak
type NewPeakEvent struct {
Success bool `json:"success"`
Height uint32 `json:"height"`
}
// TimelordChain references a particular chain within timelord code
type TimelordChain uint8
const (
// TimelordChainChallenge Challenge Chain
TimelordChainChallenge TimelordChain = 1
// TimelordChainReward Reward Chain
TimelordChainReward TimelordChain = 2
// TimelordChainInfusedChallenge Infused Challenge Chain
TimelordChainInfusedChallenge TimelordChain = 3
// TimelordChainBluebox Bluebox Chain
TimelordChainBluebox TimelordChain = 4
)
// FinishedPoTEvent data every time a PoT Challenge is completed
type FinishedPoTEvent struct {
Success bool `json:"success"`
Chain TimelordChain `json:"chain"`
EstimatedIPS float64 `json:"estimated_ips"`
IterationsNeeded uint64 `json:"iterations_needed"`
VDFInfo VDFInfo `json:"vdf_info"`
VDFProof VDFProof `json:"vdf_proof"`
}
// CompressibleVDFField Stores, for a given VDF, the field that uses it.
type CompressibleVDFField uint8
const (
// CompressibleVDFFieldCCEOSVDF CC_EOS_VDF
CompressibleVDFFieldCCEOSVDF CompressibleVDFField = 1
// CompressibleVDFFieldICCEOSVDF ICC_EOS_VDF
CompressibleVDFFieldICCEOSVDF CompressibleVDFField = 2
// CompressibleVDFFieldCCSPVDF CC_SP_VDF
CompressibleVDFFieldCCSPVDF CompressibleVDFField = 3
// CompressibleVDFFieldCCIPVDF CC_IP_VDF
CompressibleVDFFieldCCIPVDF CompressibleVDFField = 4
)
// NewCompactProofEvent is an event from the timelord every time a new compact proof is generated
type NewCompactProofEvent struct {
Success bool `json:"success"`
HeaderHash string `json:"header_hash"`
Height uint32 `json:"height"`
FieldVdf CompressibleVDFField `json:"field_vdf"`
}