0

I have Solidity code that, given the input of the sender's wallet address, deterministically produces a resulting output.

My goal is to write a unit test for this functionality. Is there a way I can override the msg.sender value?

I'm using Truffle 4.0.4 alongside testrpc.

2

One way to achieve that would be to run testrpc always using the same mnemonic which will always generate the same accounts.

You can do that by doing testrpc -m "word1 word2 word3 word..."

  • Ah, of course! I'll do that. Thanks for the recommendation. – Josh1billion Jan 6 '18 at 1:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.