msgToSend() converts an any to MessageSend
(msg *anypb.Any)
| 1443 | |
| 1444 | // msgToSend() converts an any to MessageSend |
| 1445 | func 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 |
| 1458 | func cleanHex(s string) string { |
no test coverage detected