Replies: 2 comments
-
An indirect benefit of this would be that it would make it easier for third-party devs and integrating partners to read data from Sablier. If they are only interested in querying the |
Beta Was this translation helpful? Give feedback.
-
Update: I was wrong when I said that all that is needed to DRY-ify The |
Beta Was this translation helpful? Give feedback.
-
One of the limitations of structs in Solidity is that they don't have anything equivalent to Rust traits. So testing against some expected shared behavior between multiple different structs is not possible in Solidity (alas).
We could go around this though by defining constant getters for those particular struct members that we're interested in. For example, if we wanted to DRY-ify the
renounce
function (that is, move it in theISablierV2
contract), we would have to define only two getters:getStreamSender
andisStreamCancelable
.We would of course still have to test these getters on a per-contract basis, but the number of test cases would be just 1, or 2 at worst. The
reduce
function could thus be moved to the abstract contractISablierV2
and tested only once.Beta Was this translation helpful? Give feedback.
All reactions