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

Function writeCallForMethod

compressor/cmd/czip-compressor/main.go:192–210  ·  view source on GitHub ↗
(cmd *cobra.Command, method uint, args []string)

Source from the content-addressed store, hash-verified

190}
191
192func writeCallForMethod(cmd *cobra.Command, method uint, args []string) {
193 buf, err := useBuffer(method, cmd)
194 if err != nil {
195 fail(err)
196 }
197
198 data := common.FromHex(args[0])
199 addr := common.FromHex(args[1])
200
201 if len(addr) != 20 {
202 fail(fmt.Errorf("invalid address length"))
203 }
204
205 if _, err := buf.WriteCall(addr, data); err != nil {
206 fail(err)
207 }
208
209 fmt.Printf("0x%x\n", buf.Commited)
210}
211
212func addEncodeSequenceCommands(cmd *cobra.Command) {
213 encodeSequenceCmd := &cobra.Command{

Callers 1

addEncodeCallCommandsFunction · 0.85

Calls 3

useBufferFunction · 0.85
failFunction · 0.85
WriteCallMethod · 0.80

Tested by

no test coverage detected