Found while writing tests for the rescue tool (wraith-protocol/contracts#199).
On develop, decodeStealthMetaAddress('st:xlm:' + 'zz'.repeat(64)) does not throw, even though the payload is not hex. The prefix and length checks pass, and the decoder returns keys instead of an InvalidMetaAddressError.
Expected: a payload containing non-hex characters is rejected with InvalidMetaAddressError. A strict check such as /^[0-9a-fA-F]{128}$/ on the payload would do it.
Workaround: the rescue tool validates the format with a regex before calling the decoder.
Found while writing tests for the rescue tool (wraith-protocol/contracts#199).
On develop,
decodeStealthMetaAddress('st:xlm:' + 'zz'.repeat(64))does not throw, even though the payload is not hex. The prefix and length checks pass, and the decoder returns keys instead of anInvalidMetaAddressError.Expected: a payload containing non-hex characters is rejected with
InvalidMetaAddressError. A strict check such as/^[0-9a-fA-F]{128}$/on the payload would do it.Workaround: the rescue tool validates the format with a regex before calling the decoder.