MCPcopy Create free account
hub / github.com/0xsequence/czip / addEncodeSequenceCommands

Function addEncodeSequenceCommands

compressor/cmd/czip-compressor/main.go:212–234  ·  view source on GitHub ↗
(cmd *cobra.Command)

Source from the content-addressed store, hash-verified

210}
211
212func 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
236func writeSequenceForMethod(cmd *cobra.Command, method uint, args []string) {
237 data := common.FromHex(args[0])

Callers 1

initFunction · 0.85

Calls 1

writeSequenceForMethodFunction · 0.85

Tested by

no test coverage detected