Skip to content

Commit

Permalink
Use the gasPrice from the transaction.
Browse files Browse the repository at this point in the history
  • Loading branch information
JakeLin committed Aug 11, 2019
1 parent d1d0c40 commit aea2555
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion test/splitter.js
Expand Up @@ -95,7 +95,7 @@ contract('Splitter', accounts => {

it('should withdraw the ether to Bob\'s account', async () => {
// Assert
const gasPrice = toBN(await web3.eth.getGasPrice());
const gasPrice = toBN((await web3.eth.getTransaction(tx.transactionHash)).gasPrice);
const gasFee = toBN(tx.gasUsed).mul(gasPrice);
assert.strictEqual(toBN((await web3.eth.getBalance(bob))).sub(bobBeforeWithdrawBalance).toString(10), toBN(toWei('0.03', 'ether')).sub(gasFee).toString(10));
});
Expand Down

0 comments on commit aea2555

Please sign in to comment.