Open sebastianst opened 3 years ago
I replaced it with a common.Address
.
We also use wallet.Address
and wire.Address
in some cases. They could all be changed/should all be changed to common.Address
. This would require some wrapper code.
PS: These changes should be done all at once to prevent inconsistency. Otherwise the user would need to cast between wallet.Address
, wire.Address
and common.Address
.
To be honest, I don't immediately see the benefit of using wallet.Address
over common.Address
.
@sebastianst Can you give an example?
One of the purposes of this eth payment api is to hide abstract types like wallet.Address
. It is just confusing for the user, particularly because most of the api already uses common.Address
.
Right now, the API mixes up the use of concrete types like common.Address
and the abstract wallet.Address
, which is not clean. A new user would be confused how to even pass a common.Address
for this wallet.Address
, because they would need to find out how to convert it.
Moreover, a function should only ask in its parameters for what it can handle. And the functions in this package can actually only handle common.Address
es and not any other implementation of wallet.Address
, so it provides more type safety to accept only the concrete type.
This is an eth-specific wrapper, so it should hide abstractions.
Client.OnChainBalance
currently useswallet.Address
in its parameters. Didn't check if there are other abstract types visible that could be concretized.