(cmd *cobra.Command)
| 210 | } |
| 211 | |
| 212 | func addEncodeSequenceCommands(cmd *cobra.Command) { |
| 213 | encodeSequenceCmd := &cobra.Command{ |
| 214 | Use: "encode-sequence-tx", |
| 215 | Short: "Compress a Sequence Wallet transaction", |
| 216 | } |
| 217 | encodeSequenceCmd.AddCommand(&cobra.Command{ |
| 218 | Use: "decode", |
| 219 | Short: "The decompressor contract will only return the decompressed Sequence transaction.", |
| 220 | Args: cobra.ExactArgs(2), |
| 221 | Run: func(cmd *cobra.Command, args []string) { |
| 222 | writeSequenceForMethod(cmd, compressor.METHOD_DECODE_SEQUENCE_TX, args) |
| 223 | }, |
| 224 | }) |
| 225 | encodeSequenceCmd.AddCommand(&cobra.Command{ |
| 226 | Use: "call", |
| 227 | Short: "The decompressor contract will execute the decompressed Sequence transaction.", |
| 228 | Args: cobra.ExactArgs(2), |
| 229 | Run: func(cmd *cobra.Command, args []string) { |
| 230 | writeSequenceForMethod(cmd, compressor.METHOD_EXECUTE_SEQUENCE_TX, args) |
| 231 | }, |
| 232 | }) |
| 233 | cmd.AddCommand(encodeSequenceCmd) |
| 234 | } |
| 235 | |
| 236 | func writeSequenceForMethod(cmd *cobra.Command, method uint, args []string) { |
| 237 | data := common.FromHex(args[0]) |
no test coverage detected