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

Function addEncodeCallsCommands

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

Source from the content-addressed store, hash-verified

97}
98
99func addEncodeCallsCommands(cmd *cobra.Command) {
100 encodeCallsCmd := &cobra.Command{
101 Use: "encode-calls",
102 Short: "Compress multiple calls to many contracts: <data> <to> <data> <to> ... <data> <to>",
103 }
104 encodeCallsCmd.AddCommand(&cobra.Command{
105 Use: "decode",
106 Short: "The decompressor contract will only return the decompressed calls.",
107 Args: validateCallsArgs,
108 Run: func(cmd *cobra.Command, args []string) {
109 writeCallsForMethod(cmd, compressor.METHOD_DECODE_N_CALLS, args)
110 },
111 })
112 encodeCallsCmd.AddCommand(&cobra.Command{
113 Use: "call",
114 Short: "The decompressor contract will execute the decompressed calls, discarting the results.",
115 Args: validateCallsArgs,
116 Run: func(cmd *cobra.Command, args []string) {
117 writeCallsForMethod(cmd, compressor.METHOD_EXECUTE_N_CALLS, args)
118 },
119 })
120 cmd.AddCommand(encodeCallsCmd)
121}
122
123func validateCallsArgs(cmd *cobra.Command, args []string) error {
124 if len(args) < 2 {

Callers 1

initFunction · 0.85

Calls 1

writeCallsForMethodFunction · 0.85

Tested by

no test coverage detected