forked from ferranbt/fastssz
-
Notifications
You must be signed in to change notification settings - Fork 0
/
case6_encoding.go
64 lines (50 loc) · 1.34 KB
/
case6_encoding.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
// Code generated by fastssz. DO NOT EDIT.
// Hash: 2c62e4f3a52cd6b3a37d9953ebbc566ecb0f1f591f68f1f60aa6f5ca0f2bb4a6
// Version: 0.1.3-dev
package testcases
import (
ssz "github.com/claravanstaden/fastssz"
)
// MarshalSSZ ssz marshals the Case6 object
func (c *Case6) MarshalSSZ() ([]byte, error) {
return ssz.MarshalSSZ(c)
}
// MarshalSSZTo ssz marshals the Case6 object to a target array
func (c *Case6) MarshalSSZTo(buf []byte) (dst []byte, err error) {
dst = buf
// Field (0) 'A'
dst = append(dst, c.A[:]...)
return
}
// UnmarshalSSZ ssz unmarshals the Case6 object
func (c *Case6) UnmarshalSSZ(buf []byte) error {
var err error
size := uint64(len(buf))
if size != 32 {
return ssz.ErrSize
}
// Field (0) 'A'
copy(c.A[:], buf[0:32])
return err
}
// SizeSSZ returns the ssz encoded size in bytes for the Case6 object
func (c *Case6) SizeSSZ() (size int) {
size = 32
return
}
// HashTreeRoot ssz hashes the Case6 object
func (c *Case6) HashTreeRoot() ([32]byte, error) {
return ssz.HashWithDefaultHasher(c)
}
// HashTreeRootWith ssz hashes the Case6 object with a hasher
func (c *Case6) HashTreeRootWith(hh ssz.HashWalker) (err error) {
indx := hh.Index()
// Field (0) 'A'
hh.PutBytes(c.A[:])
hh.Merkleize(indx)
return
}
// GetTree ssz hashes the Case6 object
func (c *Case6) GetTree() (*ssz.Node, error) {
return ssz.ProofTree(c)
}