Skip to content

[#889] Overload `getAlias`

Diogo Castro requested to merge diogo/#889-get-alias into master

Description

Problem: In !1260 (merged), we added the type SomeAddressOrAlias and overloaded resolveAddress to work with both SomeAdressOrAlias and AddressOrAlias kind.

However, getAlias still only works with AddressOrAlias.

Solution:

  • Rename the ResolveAddress typeclass to simply Resolve
  • Add a getAliasEither method to the Resolve typeclass
  • Implement getAlias and getAliasMaybe in terms of getAliasEither
  • Replace HasTezosClient.findAlias method with the more general HasTezosClient.getAliasesAndAddresses. This can be used to implement both resovleAddress and getAlias.

Related issue(s)

Resolves #889 (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

    • I checked whether I should update the docs and did so if necessary:
    • I updated changelog files of all affected packages released to Hackage if my changes are externally visible.

Stylistic guide (mandatory)

Edited by Diogo Castro

Merge request reports