MCPcopy
hub / github.com/canopy-network/canopy / msgToSend

Function msgToSend

cmd/rpc/eth.go:1445–1455  ·  view source on GitHub ↗

msgToSend() converts an any to MessageSend

(msg *anypb.Any)

Source from the content-addressed store, hash-verified

1443
1444// msgToSend() converts an any to MessageSend
1445func msgToSend(msg *anypb.Any) (*fsm.MessageSend, error) {
1446 a, err := lib.FromAny(msg)
1447 if err != nil {
1448 return nil, err
1449 }
1450 got, ok := a.(*fsm.MessageSend)
1451 if !ok {
1452 return nil, lib.ErrInvalidMessageCast()
1453 }
1454 return got, nil
1455}
1456
1457// cleanHex() strips the 0x prefix from a hex string
1458func cleanHex(s string) string {

Callers 2

txToEIP1559Method · 0.85
txToGetLogsRespMethod · 0.85

Calls 2

FromAnyFunction · 0.92
ErrInvalidMessageCastFunction · 0.92

Tested by

no test coverage detected