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.
(cherry picked from commit 9f822906b8)
This commit is contained in:
committed by
Leo Arias
parent
7ec6079784
commit
10a5864fdf
@ -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,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user