github.com/annchain/OG@v0.0.9/rpc/tx_controller_gen.go (about) 1 package rpc 2 3 // Code generated by github.com/tinylib/msgp DO NOT EDIT. 4 5 import ( 6 "github.com/tinylib/msgp/msgp" 7 ) 8 9 // DecodeMsg implements msgp.Decodable 10 func (z *NewTxRequest) DecodeMsg(dc *msgp.Reader) (err error) { 11 var zb0001 uint32 12 zb0001, err = dc.ReadArrayHeader() 13 if err != nil { 14 return 15 } 16 if zb0001 != 9 { 17 err = msgp.ArrayError{Wanted: 9, Got: zb0001} 18 return 19 } 20 z.Nonce, err = dc.ReadString() 21 if err != nil { 22 return 23 } 24 z.From, err = dc.ReadString() 25 if err != nil { 26 return 27 } 28 z.To, err = dc.ReadString() 29 if err != nil { 30 return 31 } 32 z.Value, err = dc.ReadString() 33 if err != nil { 34 return 35 } 36 z.Data, err = dc.ReadString() 37 if err != nil { 38 return 39 } 40 z.CryptoType, err = dc.ReadString() 41 if err != nil { 42 return 43 } 44 z.Signature, err = dc.ReadString() 45 if err != nil { 46 return 47 } 48 z.Pubkey, err = dc.ReadString() 49 if err != nil { 50 return 51 } 52 z.TokenId, err = dc.ReadInt32() 53 if err != nil { 54 return 55 } 56 return 57 } 58 59 // EncodeMsg implements msgp.Encodable 60 func (z *NewTxRequest) EncodeMsg(en *msgp.Writer) (err error) { 61 // array header, size 9 62 err = en.Append(0x99) 63 if err != nil { 64 return 65 } 66 err = en.WriteString(z.Nonce) 67 if err != nil { 68 return 69 } 70 err = en.WriteString(z.From) 71 if err != nil { 72 return 73 } 74 err = en.WriteString(z.To) 75 if err != nil { 76 return 77 } 78 err = en.WriteString(z.Value) 79 if err != nil { 80 return 81 } 82 err = en.WriteString(z.Data) 83 if err != nil { 84 return 85 } 86 err = en.WriteString(z.CryptoType) 87 if err != nil { 88 return 89 } 90 err = en.WriteString(z.Signature) 91 if err != nil { 92 return 93 } 94 err = en.WriteString(z.Pubkey) 95 if err != nil { 96 return 97 } 98 err = en.WriteInt32(z.TokenId) 99 if err != nil { 100 return 101 } 102 return 103 } 104 105 // MarshalMsg implements msgp.Marshaler 106 func (z *NewTxRequest) MarshalMsg(b []byte) (o []byte, err error) { 107 o = msgp.Require(b, z.Msgsize()) 108 // array header, size 9 109 o = append(o, 0x99) 110 o = msgp.AppendString(o, z.Nonce) 111 o = msgp.AppendString(o, z.From) 112 o = msgp.AppendString(o, z.To) 113 o = msgp.AppendString(o, z.Value) 114 o = msgp.AppendString(o, z.Data) 115 o = msgp.AppendString(o, z.CryptoType) 116 o = msgp.AppendString(o, z.Signature) 117 o = msgp.AppendString(o, z.Pubkey) 118 o = msgp.AppendInt32(o, z.TokenId) 119 return 120 } 121 122 // UnmarshalMsg implements msgp.Unmarshaler 123 func (z *NewTxRequest) UnmarshalMsg(bts []byte) (o []byte, err error) { 124 var zb0001 uint32 125 zb0001, bts, err = msgp.ReadArrayHeaderBytes(bts) 126 if err != nil { 127 return 128 } 129 if zb0001 != 9 { 130 err = msgp.ArrayError{Wanted: 9, Got: zb0001} 131 return 132 } 133 z.Nonce, bts, err = msgp.ReadStringBytes(bts) 134 if err != nil { 135 return 136 } 137 z.From, bts, err = msgp.ReadStringBytes(bts) 138 if err != nil { 139 return 140 } 141 z.To, bts, err = msgp.ReadStringBytes(bts) 142 if err != nil { 143 return 144 } 145 z.Value, bts, err = msgp.ReadStringBytes(bts) 146 if err != nil { 147 return 148 } 149 z.Data, bts, err = msgp.ReadStringBytes(bts) 150 if err != nil { 151 return 152 } 153 z.CryptoType, bts, err = msgp.ReadStringBytes(bts) 154 if err != nil { 155 return 156 } 157 z.Signature, bts, err = msgp.ReadStringBytes(bts) 158 if err != nil { 159 return 160 } 161 z.Pubkey, bts, err = msgp.ReadStringBytes(bts) 162 if err != nil { 163 return 164 } 165 z.TokenId, bts, err = msgp.ReadInt32Bytes(bts) 166 if err != nil { 167 return 168 } 169 o = bts 170 return 171 } 172 173 // Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message 174 func (z *NewTxRequest) Msgsize() (s int) { 175 s = 1 + msgp.StringPrefixSize + len(z.Nonce) + msgp.StringPrefixSize + len(z.From) + msgp.StringPrefixSize + len(z.To) + msgp.StringPrefixSize + len(z.Value) + msgp.StringPrefixSize + len(z.Data) + msgp.StringPrefixSize + len(z.CryptoType) + msgp.StringPrefixSize + len(z.Signature) + msgp.StringPrefixSize + len(z.Pubkey) + msgp.Int32Size 176 return 177 } 178 179 // DecodeMsg implements msgp.Decodable 180 func (z *NewTxsRequests) DecodeMsg(dc *msgp.Reader) (err error) { 181 var zb0001 uint32 182 zb0001, err = dc.ReadArrayHeader() 183 if err != nil { 184 return 185 } 186 if zb0001 != 1 { 187 err = msgp.ArrayError{Wanted: 1, Got: zb0001} 188 return 189 } 190 var zb0002 uint32 191 zb0002, err = dc.ReadArrayHeader() 192 if err != nil { 193 return 194 } 195 if cap(z.Txs) >= int(zb0002) { 196 z.Txs = (z.Txs)[:zb0002] 197 } else { 198 z.Txs = make([]NewTxRequest, zb0002) 199 } 200 for za0001 := range z.Txs { 201 err = z.Txs[za0001].DecodeMsg(dc) 202 if err != nil { 203 return 204 } 205 } 206 return 207 } 208 209 // EncodeMsg implements msgp.Encodable 210 func (z *NewTxsRequests) EncodeMsg(en *msgp.Writer) (err error) { 211 // array header, size 1 212 err = en.Append(0x91) 213 if err != nil { 214 return 215 } 216 err = en.WriteArrayHeader(uint32(len(z.Txs))) 217 if err != nil { 218 return 219 } 220 for za0001 := range z.Txs { 221 err = z.Txs[za0001].EncodeMsg(en) 222 if err != nil { 223 return 224 } 225 } 226 return 227 } 228 229 // MarshalMsg implements msgp.Marshaler 230 func (z *NewTxsRequests) MarshalMsg(b []byte) (o []byte, err error) { 231 o = msgp.Require(b, z.Msgsize()) 232 // array header, size 1 233 o = append(o, 0x91) 234 o = msgp.AppendArrayHeader(o, uint32(len(z.Txs))) 235 for za0001 := range z.Txs { 236 o, err = z.Txs[za0001].MarshalMsg(o) 237 if err != nil { 238 return 239 } 240 } 241 return 242 } 243 244 // UnmarshalMsg implements msgp.Unmarshaler 245 func (z *NewTxsRequests) UnmarshalMsg(bts []byte) (o []byte, err error) { 246 var zb0001 uint32 247 zb0001, bts, err = msgp.ReadArrayHeaderBytes(bts) 248 if err != nil { 249 return 250 } 251 if zb0001 != 1 { 252 err = msgp.ArrayError{Wanted: 1, Got: zb0001} 253 return 254 } 255 var zb0002 uint32 256 zb0002, bts, err = msgp.ReadArrayHeaderBytes(bts) 257 if err != nil { 258 return 259 } 260 if cap(z.Txs) >= int(zb0002) { 261 z.Txs = (z.Txs)[:zb0002] 262 } else { 263 z.Txs = make([]NewTxRequest, zb0002) 264 } 265 for za0001 := range z.Txs { 266 bts, err = z.Txs[za0001].UnmarshalMsg(bts) 267 if err != nil { 268 return 269 } 270 } 271 o = bts 272 return 273 } 274 275 // Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message 276 func (z *NewTxsRequests) Msgsize() (s int) { 277 s = 1 + msgp.ArrayHeaderSize 278 for za0001 := range z.Txs { 279 s += z.Txs[za0001].Msgsize() 280 } 281 return 282 }