Closed humanwhoexplores closed 3 years ago
`beforeEach(async () => { // beforeEach runs before running each test // Get a list of all accounts accounts = await web3.eth.getAccounts();
inbox = await new web3.eth.Contract(JSON.parse(interface)) .deploy({data : bytecode, arguments: ['Inbox contract']}) .send({from: accounts[0], gas: '1000000'}) let balance = await web3.eth.getBalance(accounts[0]); console.log("The balance is ", balance);
});`
accounts[0] is the address of account
The current balance for the given address in wei.
`beforeEach(async () => { // beforeEach runs before running each test // Get a list of all accounts accounts = await web3.eth.getAccounts();
});`
accounts[0] is the address of account