-
Notifications
You must be signed in to change notification settings - Fork 2
/
types.go
81 lines (67 loc) · 1.53 KB
/
types.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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
package types
import (
"github.com/insolar/insolar/ledger/heavy/exporter"
"go.opencensus.io/stats/view"
)
func init() {
// todo fix problem with importing two loggers PENV-344
view.Unregister(&view.View{Name: "log_write_delays"})
}
// PlatformPulseData represents on the missing struct in the Platform
type PlatformPulseData struct {
Pulse *exporter.FullPulse
Records []*exporter.Record
}
type JetDrop struct {
MainSection *MainSection
Sections []Section
RawData []byte
Hash []byte
}
type Section interface {
IsSection() bool
}
func (m MainSection) IsSection() bool { return true }
type MainSection struct {
Start DropStart
DropContinue DropContinue
Records []Record
}
type AdditionalSection struct {
RecordExtensions []Record
}
type DropStart struct {
PulseData Pulse
JetDropPrefix string
JetDropPrefixLength uint
}
type DropContinue struct {
PrevDropHash [][]byte
}
type Pulse struct {
PulseNo int64
EpochPulseNo int64
PulseTimestamp int64
NextPulseNumber int64
PrevPulseNumber int64
}
type RecordType int
const (
// state type means activate, amend, deactivate records
STATE RecordType = iota
REQUEST
RESULT
)
// Reference based on Insolar.Reference
type Reference []byte
type Record struct {
Type RecordType
Ref Reference
ObjectReference Reference
PrototypeReference Reference
PrevRecordReference Reference
RecordPayload []byte
Hash []byte
RawData []byte
Order uint32
}