forked from CovenantSQL/CovenantSQL
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathupdatepermission_gen.go
More file actions
82 lines (76 loc) · 2.12 KB
/
Copy pathupdatepermission_gen.go
File metadata and controls
82 lines (76 loc) · 2.12 KB
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
package types
// Code generated by github.com/CovenantSQL/HashStablePack DO NOT EDIT.
import (
hsp "github.com/CovenantSQL/HashStablePack/marshalhash"
)
// MarshalHash marshals for hash
func (z *UpdatePermission) MarshalHash() (o []byte, err error) {
var b []byte
o = hsp.Require(b, z.Msgsize())
// map header, size 3
o = append(o, 0x83)
if oTemp, err := z.DefaultHashSignVerifierImpl.MarshalHash(); err != nil {
return nil, err
} else {
o = hsp.AppendBytes(o, oTemp)
}
if oTemp, err := z.TransactionTypeMixin.MarshalHash(); err != nil {
return nil, err
} else {
o = hsp.AppendBytes(o, oTemp)
}
if oTemp, err := z.UpdatePermissionHeader.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 *UpdatePermission) Msgsize() (s int) {
s = 1 + 28 + z.DefaultHashSignVerifierImpl.Msgsize() + 21 + z.TransactionTypeMixin.Msgsize() + 23 + z.UpdatePermissionHeader.Msgsize()
return
}
// MarshalHash marshals for hash
func (z *UpdatePermissionHeader) MarshalHash() (o []byte, err error) {
var b []byte
o = hsp.Require(b, z.Msgsize())
// map header, size 4
o = append(o, 0x84)
if oTemp, err := z.Nonce.MarshalHash(); err != nil {
return nil, err
} else {
o = hsp.AppendBytes(o, oTemp)
}
if z.Permission == nil {
o = hsp.AppendNil(o)
} else {
if oTemp, err := z.Permission.MarshalHash(); err != nil {
return nil, err
} else {
o = hsp.AppendBytes(o, oTemp)
}
}
if oTemp, err := z.TargetSQLChain.MarshalHash(); err != nil {
return nil, err
} else {
o = hsp.AppendBytes(o, oTemp)
}
if oTemp, err := z.TargetUser.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 *UpdatePermissionHeader) Msgsize() (s int) {
s = 1 + 6 + z.Nonce.Msgsize() + 11
if z.Permission == nil {
s += hsp.NilSize
} else {
s += z.Permission.Msgsize()
}
s += 15 + z.TargetSQLChain.Msgsize() + 11 + z.TargetUser.Msgsize()
return
}