Replies: 2 comments
-
Indeed, this is why @frangio and I decided to drop the first account in OZ Test Environment and make the notion of a 'default sender' more explicit. The argument goes that a) any transction in which the sender is relevant should have an explicit sender, and b) all senders defined when destructuring Changing Re. monkey-patching, does it have to be a method in |
Beta Was this translation helpful? Give feedback.
-
This function would need access to the runtime environment, so it would need to receive the |
Beta Was this translation helpful? Give feedback.
-
According to @nventuro, the fact that the first account returned by
getSigners
is the default signer is error-prone, because you need to remember to omit it in tests that involve accounts that are not the one that deployed the contracts. In other words, cases where this:is a mistake, and you actually want to do:
Possible solutions are:
getSigners
. This is a huge breaking change.getSigners
, so that you can dogetSigners(1)
. This seems like a no-solution, because you still have to remember to pass that value all the time. Plus it's ugly.getNonDefaultSigners
orgetTestSigners
orgetOtherSigners
or whatever). Here you still need to remember to use the right method, but that can be enforced by a linter rule.The problem with the third option is that we don't want to keep adding methods to the
ethers
object, because it's very confusing for users who don't understand the difference between ethers itself and our monkey-patched version.Beta Was this translation helpful? Give feedback.
All reactions