(cmd *cobra.Command, method uint, args []string)
| 234 | } |
| 235 | |
| 236 | func writeSequenceForMethod(cmd *cobra.Command, method uint, args []string) { |
| 237 | data := common.FromHex(args[0]) |
| 238 | if len(data) == 0 { |
| 239 | fail(fmt.Errorf("invalid data length")) |
| 240 | } |
| 241 | |
| 242 | addr := common.FromHex(args[1]) |
| 243 | if len(addr) != 20 { |
| 244 | fail(fmt.Errorf("invalid address length")) |
| 245 | } |
| 246 | |
| 247 | txs, nonce, sig, err := sequence.DecodeExecdata(data) |
| 248 | if err != nil { |
| 249 | fail(err) |
| 250 | } |
| 251 | |
| 252 | buf, err := useBuffer(method, cmd) |
| 253 | if err != nil { |
| 254 | fail(err) |
| 255 | } |
| 256 | |
| 257 | _, err = buf.WriteSequenceExecute(addr, &sequence.Transaction{ |
| 258 | Nonce: nonce, |
| 259 | Transactions: txs, |
| 260 | Signature: sig, |
| 261 | }) |
| 262 | |
| 263 | if err != nil { |
| 264 | fail(err) |
| 265 | } |
| 266 | |
| 267 | fmt.Printf("0x%x\n", buf.Commited) |
| 268 | } |
no test coverage detected