0

I am trying to write a test using the Truffle framework and for one of the tests I need to send the contract some ether. Is there a way that I can programmatically make a specified ether account send money to the contract?

Thanks

0

You should be able to do this using the web3.eth.accounts array (ex: web3.eth.accounts[0]). If you are using test-rpc, there will be a set of pre-created accounts that are accessible via that array.

There is a tutorial you could try following: https://citywebconsultants.co.uk/blog/blockchain/introducing-ethereum-development-part-3-testrpc-and-truffle

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.