I’m wondering if there is an easy way to leverage the generated contract wrappers to send a transaction from an alternative address… to clarify, say I have a contract
MyContract, with a function
doSomething. Now, if I want to just execute
doSomething in a unit test, that is relatively trivial. But, let’s say that
doSomething is a payable function. If I wanted to execute this transaction from another account, say a Credential object
creds, to my knowledge there is no streamlined way to do this using the generated contract wrapper. I can certainly
- Create a function
- Encode it
- Create a transaction
- Send the transaction
- Wait for the tx receipt
But it seems like there is a great opportunity to wrap this behavior in something like
MyContract.doSomething(from = creds, amount = amount).
Curious what other people think, solutions others have come up with, etc.