[#922] Fix recursive deriveRPC for Address
NB: this is a rather annoying bug tbh.
TODO:
-
Add a regression test using Lorentz.Hash
type; the setup is the same, but some details are different.
Description
Problem: there's a logic error in findWithoutInstance
that fails to
consider instances for saturated type aliases. Thus when it encounters
Address
or potentially other type aliases for saturated types, it only
looks for AsRPC
instances of unsaturated types, i.e. in the case of
Address
that would be AsRPC (Constrained a)
, which obviously doesn't
exist.
Solution: Change the order of checks: first check whether there's an instance, regardless whether the type is an alias or not, and only recurse if there isn't.
Related issue(s)
Resolves #922 (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.
Edited by Nikolay Yakimov