How is it possible to test if my contract actually transfers money to a specific account?

function _transfer(address receiver_, uint256 payout) internal{

Testing in JavaScript Syntax. Expecting something like:

assert.equal(accounts[1].balance, 100 Ether);

To assert the balance of an account, try this:

let expectedBalance = web3.toBigNumber(web3.toWei(3, 'ether'));
let actualBalance = await web3.eth.getBalance(accounts[1]);

assert.deepEqual(actualBalance, expectedBalance, "Balance incorrect!");
| improve this answer | |

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.