github.com/klaytn/klaytn@v1.12.1/rlp/rlpgen/testdata/uints.out.txt (about) 1 package test 2 3 import "github.com/klaytn/klaytn/rlp" 4 import "io" 5 6 func (obj *Test) EncodeRLP(_w io.Writer) error { 7 w := rlp.NewEncoderBuffer(_w) 8 _tmp0 := w.List() 9 w.WriteUint64(uint64(obj.A)) 10 w.WriteUint64(uint64(obj.B)) 11 w.WriteUint64(uint64(obj.C)) 12 w.WriteUint64(obj.D) 13 w.ListEnd(_tmp0) 14 return w.Flush() 15 } 16 17 func (obj *Test) DecodeRLP(dec *rlp.Stream) error { 18 var _tmp0 Test 19 { 20 if _, err := dec.List(); err != nil { 21 return err 22 } 23 // A: 24 _tmp1, err := dec.Uint8() 25 if err != nil { 26 return err 27 } 28 _tmp0.A = _tmp1 29 // B: 30 _tmp2, err := dec.Uint16() 31 if err != nil { 32 return err 33 } 34 _tmp0.B = _tmp2 35 // C: 36 _tmp3, err := dec.Uint32() 37 if err != nil { 38 return err 39 } 40 _tmp0.C = _tmp3 41 // D: 42 _tmp4, err := dec.Uint64() 43 if err != nil { 44 return err 45 } 46 _tmp0.D = _tmp4 47 if err := dec.ListEnd(); err != nil { 48 return err 49 } 50 } 51 *obj = _tmp0 52 return nil 53 }