[#843] Use tagged decoder for Address
Description
Problem: Currently, Morley.Tezos.Address.parseAddressRaw
uses ad-hoc splitAt
-based bytestring parsing. However, we have a generic way of parsing tagged data, namely Morley.Util.Binary.TaggedDecoder
. Would be nice to rewrite parseAddressRaw
using TaggedDecoder
and reusing functions from Morley.Tezos.Crypto
.
Solution: First, generalize TaggedDecoder
machinery to allow for custom errors, then rewrite address parser using this generalized machinery.
NB: I went the road of "use structured exceptions where possible", but we could also go the way of "just use binary fail
", that would've simplified things a bit at the cost of specificity. We don't actually use any of that specificity, mind, so either approach is workable.
Related issue(s)
Resolves #843 (closed)
✅ Checklist for your Merge Request
Related changes (conditional)
-
Tests (see short guidelines)
-
If I added new functionality, I added tests covering it. -
If I fixed a bug, I added a regression test to prevent the bug from silently reappearing again.
-
-
Documentation
Stylistic guide (mandatory)
-
My commits comply with the following policy. -
My code complies with the style guide.