Remove the need for wrapping addresses in Nettest
Clarification and motivation
At the moment, working with addresses in Morley.Nettest
tests requires a lot of wrapping/unwrapping with AddressResolved
/addressResolved
, AddressAlias
, toAddress
etc.
The user experience could be improved by introducing some polymorphism in key places.
For example, in the first argument of callFrom
, we need to pass in anything that can be resolved to an actual Address
, so we could refactor it like this:
class ToResolvedAddress a where
toResolvedAddress :: NettestImpl m -> a -> m Address
instance ToToResolvedAddress KnownAlias where
instance ToToResolvedAddress Address where
instance ToToResolvedAddress (TAddress a) where
callFrom
:: (ToResolvedAddress from, ToTAddress v to)
=> from -> to -> etc -> m ()
This issue can be addressed at the same time as #390 (closed), or after it, whichever's easier.
There are more places in the interface where the ergonomics could be improved, some analysis is required.
Acceptance criteria
Writing Nettest tests no longer requires wrapping/unwrapping addresses with AddressResolved
/addressResolved
/ AddressAlias