(bz []byte)
| 37 | } |
| 38 | |
| 39 | func EncodeWithLengthPrefix(bz []byte) ([]byte, error) { |
| 40 | if len(bz) > 255 { |
| 41 | return nil, fmt.Errorf("length-prefixed address too long") |
| 42 | } |
| 43 | |
| 44 | return append([]byte{byte(len(bz))}, bz...), nil |
| 45 | } |
| 46 | |
| 47 | func MustEncodeWithLengthPrefix(bz []byte) []byte { |
| 48 | res, err := EncodeWithLengthPrefix(bz) |
no outgoing calls
no test coverage detected