GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — CovenantSQL/types/block_gen.go at develop · CovenantSQL/CovenantSQL

Expand file tree

/

block_gen.go

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
232 lines (220 loc) · 5.46 KB
/

block_gen.go

Copy path

File metadata and controls

232 lines (220 loc) · 5.46 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
package types
// Code generated by github.com/CovenantSQL/HashStablePack DO NOT EDIT.
import (
hsp "github.com/CovenantSQL/HashStablePack/v2/marshalhash"
)
// MarshalHash marshals for hash
func (z *Block) MarshalHash() (o []byte, err error) {
var b []byte
o = hsp.Require(b, z.Msgsize())
// map header, size 4
o = append(o, 0x84)
o = hsp.AppendArrayHeader(o, uint32(len(z.Acks)))
for za0003 := range z.Acks {
if z.Acks[za0003] == nil {
o = hsp.AppendNil(o)
} else {
if oTemp, err := z.Acks[za0003].MarshalHash(); err != nil {
return nil, err
} else {
o = hsp.AppendBytes(o, oTemp)
}
}
}
o = hsp.AppendArrayHeader(o, uint32(len(z.FailedReqs)))
for za0001 := range z.FailedReqs {
if z.FailedReqs[za0001] == nil {
o = hsp.AppendNil(o)
} else {
if oTemp, err := z.FailedReqs[za0001].MarshalHash(); err != nil {
return nil, err
} else {
o = hsp.AppendBytes(o, oTemp)
}
}
}
o = hsp.AppendArrayHeader(o, uint32(len(z.QueryTxs)))
for za0002 := range z.QueryTxs {
if z.QueryTxs[za0002] == nil {
o = hsp.AppendNil(o)
} else {
if oTemp, err := z.QueryTxs[za0002].MarshalHash(); err != nil {
return nil, err
} else {
o = hsp.AppendBytes(o, oTemp)
}
}
}
// map header, size 2
o = append(o, 0x82)
if oTemp, err := z.SignedHeader.Header.MarshalHash(); err != nil {
return nil, err
} else {
o = hsp.AppendBytes(o, oTemp)
}
if oTemp, err := z.SignedHeader.HSV.MarshalHash(); err != nil {
return nil, err
} else {
o = hsp.AppendBytes(o, oTemp)
}
return
}
// Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (z *Block) Msgsize() (s int) {
s = 1 + 5 + hsp.ArrayHeaderSize
for za0003 := range z.Acks {
if z.Acks[za0003] == nil {
s += hsp.NilSize
} else {
s += z.Acks[za0003].Msgsize()
}
}
s += 11 + hsp.ArrayHeaderSize
for za0001 := range z.FailedReqs {
if z.FailedReqs[za0001] == nil {
s += hsp.NilSize
} else {
s += z.FailedReqs[za0001].Msgsize()
}
}
s += 9 + hsp.ArrayHeaderSize
for za0002 := range z.QueryTxs {
if z.QueryTxs[za0002] == nil {
s += hsp.NilSize
} else {
s += z.QueryTxs[za0002].Msgsize()
}
}
s += 13 + 1 + 7 + z.SignedHeader.Header.Msgsize() + 4 + z.SignedHeader.HSV.Msgsize()
return
}
// MarshalHash marshals for hash
func (z Blocks) MarshalHash() (o []byte, err error) {
var b []byte
o = hsp.Require(b, z.Msgsize())
o = hsp.AppendArrayHeader(o, uint32(len(z)))
for za0001 := range z {
if z[za0001] == nil {
o = hsp.AppendNil(o)
} else {
if oTemp, err := z[za0001].MarshalHash(); err != nil {
return nil, err
} else {
o = hsp.AppendBytes(o, oTemp)
}
}
}
return
}
// Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (z Blocks) Msgsize() (s int) {
s = hsp.ArrayHeaderSize
for za0001 := range z {
if z[za0001] == nil {
s += hsp.NilSize
} else {
s += z[za0001].Msgsize()
}
}
return
}
// MarshalHash marshals for hash
func (z *Header) MarshalHash() (o []byte, err error) {
var b []byte
o = hsp.Require(b, z.Msgsize())
// map header, size 6
o = append(o, 0x86)
if oTemp, err := z.GenesisHash.MarshalHash(); err != nil {
return nil, err
} else {
o = hsp.AppendBytes(o, oTemp)
}
if oTemp, err := z.MerkleRoot.MarshalHash(); err != nil {
return nil, err
} else {
o = hsp.AppendBytes(o, oTemp)
}
if oTemp, err := z.ParentHash.MarshalHash(); err != nil {
return nil, err
} else {
o = hsp.AppendBytes(o, oTemp)
}
if oTemp, err := z.Producer.MarshalHash(); err != nil {
return nil, err
} else {
o = hsp.AppendBytes(o, oTemp)
}
o = hsp.AppendTime(o, z.Timestamp)
o = hsp.AppendInt32(o, z.Version)
return
}
// Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (z *Header) Msgsize() (s int) {
s = 1 + 12 + z.GenesisHash.Msgsize() + 11 + z.MerkleRoot.Msgsize() + 11 + z.ParentHash.Msgsize() + 9 + z.Producer.Msgsize() + 10 + hsp.TimeSize + 8 + hsp.Int32Size
return
}
// MarshalHash marshals for hash
func (z *QueryAsTx) MarshalHash() (o []byte, err error) {
var b []byte
o = hsp.Require(b, z.Msgsize())
// map header, size 2
o = append(o, 0x82)
if z.Request == nil {
o = hsp.AppendNil(o)
} else {
if oTemp, err := z.Request.MarshalHash(); err != nil {
return nil, err
} else {
o = hsp.AppendBytes(o, oTemp)
}
}
if z.Response == nil {
o = hsp.AppendNil(o)
} else {
if oTemp, err := z.Response.MarshalHash(); err != nil {
return nil, err
} else {
o = hsp.AppendBytes(o, oTemp)
}
}
return
}
// Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (z *QueryAsTx) Msgsize() (s int) {
s = 1 + 8
if z.Request == nil {
s += hsp.NilSize
} else {
s += z.Request.Msgsize()
}
s += 9
if z.Response == nil {
s += hsp.NilSize
} else {
s += z.Response.Msgsize()
}
return
}
// MarshalHash marshals for hash
func (z *SignedHeader) MarshalHash() (o []byte, err error) {
var b []byte
o = hsp.Require(b, z.Msgsize())
// map header, size 2
o = append(o, 0x82)
if oTemp, err := z.HSV.MarshalHash(); err != nil {
return nil, err
} else {
o = hsp.AppendBytes(o, oTemp)
}
if oTemp, err := z.Header.MarshalHash(); err != nil {
return nil, err
} else {
o = hsp.AppendBytes(o, oTemp)
}
return
}
// Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (z *SignedHeader) Msgsize() (s int) {
s = 1 + 4 + z.HSV.Msgsize() + 7 + z.Header.Msgsize()
return
}
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.