MCPcopy Index your code
hub / github.com/CovenantSQL/CovenantSQL / MarshalHash

Method MarshalHash

types/account_gen.go:10–31  ·  view source on GitHub ↗

MarshalHash marshals for hash

()

Source from the content-addressed store, hash-verified

8
9// MarshalHash marshals for hash
10func (z *Account) MarshalHash() (o []byte, err error) {
11 var b []byte
12 o = hsp.Require(b, z.Msgsize())
13 // map header, size 4
14 o = append(o, 0x84)
15 if oTemp, err := z.Address.MarshalHash(); err != nil {
16 return nil, err
17 } else {
18 o = hsp.AppendBytes(o, oTemp)
19 }
20 if oTemp, err := z.NextNonce.MarshalHash(); err != nil {
21 return nil, err
22 } else {
23 o = hsp.AppendBytes(o, oTemp)
24 }
25 o = hsp.AppendFloat64(o, z.Rating)
26 o = hsp.AppendArrayHeader(o, uint32(SupportTokenNumber))
27 for za0001 := range z.TokenBalance {
28 o = hsp.AppendUint64(o, z.TokenBalance[za0001])
29 }
30 return
31}
32
33// Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
34func (z *Account) Msgsize() (s int) {

Callers 5

TestMarshalHashAccountFunction · 0.95

Calls 2

MsgsizeMethod · 0.95
MarshalHashMethod · 0.65

Tested by 5

TestMarshalHashAccountFunction · 0.76