First test helpers tests (#1369)

* Removed unused advanceToBlock.

* Added advanceBlock tests.

* Fixed advanceToBlock tests.

* Added single argument tests.

* Finished inLogs tests.

* Fixed linter errors.

* Fixed linter errors.
This commit is contained in:
Nicolás Venturo
2018-10-10 20:55:10 -03:00
committed by GitHub
parent eb92fd1f48
commit 9f822906b8
4 changed files with 313 additions and 12 deletions

View File

@ -10,18 +10,6 @@ function advanceBlock () {
});
}
// Advances the block number so that the last mined block is `number`.
async function advanceToBlock (number) {
if (web3.eth.blockNumber > number) {
throw Error(`block number ${number} is in the past (current is ${web3.eth.blockNumber})`);
}
while (web3.eth.blockNumber < number) {
await advanceBlock();
}
}
module.exports = {
advanceBlock,
advanceToBlock,
};