From 2261039d52fe0e433a041c377658bfaab132761b Mon Sep 17 00:00:00 2001 From: Jakub Wojciechowski Date: Mon, 7 Aug 2017 18:29:09 +0200 Subject: [PATCH] Simplify advanceBlock in tests --- test/CappedCrowdsale.js | 4 ++-- test/Crowdsale.js | 4 ++-- test/FinalizableCrowdsale.js | 4 ++-- test/RefundableCrowdsale.js | 4 ++-- test/SampleCrowdsale.js | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/test/CappedCrowdsale.js b/test/CappedCrowdsale.js index 96fcd0c89..65d4ac9bd 100644 --- a/test/CappedCrowdsale.js +++ b/test/CappedCrowdsale.js @@ -1,6 +1,6 @@ import moment from 'moment' import ether from './helpers/ether' -import advanceToBlock from './helpers/advanceToBlock' +import {advanceBlock} from './helpers/advanceToBlock' import increaseTime from './helpers/increaseTime' import latestTime from './helpers/latestTime' import EVMThrow from './helpers/EVMThrow' @@ -24,7 +24,7 @@ contract('CappedCrowdsale', function ([_, wallet]) { before(async function() { //Advance to the next block to correctly read time in the solidity "now" function interpreted by testrpc - await advanceToBlock(web3.eth.getBlock('latest').number + 1) + await advanceBlock() }) beforeEach(async function () { diff --git a/test/Crowdsale.js b/test/Crowdsale.js index 698592690..4be913404 100644 --- a/test/Crowdsale.js +++ b/test/Crowdsale.js @@ -1,6 +1,6 @@ import moment from 'moment' import ether from './helpers/ether' -import advanceToBlock from './helpers/advanceToBlock' +import {advanceBlock} from './helpers/advanceToBlock' import increaseTime from './helpers/increaseTime' import latestTime from './helpers/latestTime' import EVMThrow from './helpers/EVMThrow' @@ -24,7 +24,7 @@ contract('Crowdsale', function ([_, investor, wallet, purchaser]) { before(async function() { //Advance to the next block to correctly read time in the solidity "now" function interpreted by testrpc - await advanceToBlock(web3.eth.getBlock('latest').number + 1) + await advanceBlock() }) beforeEach(async function () { diff --git a/test/FinalizableCrowdsale.js b/test/FinalizableCrowdsale.js index 5675c7557..d92fe6608 100644 --- a/test/FinalizableCrowdsale.js +++ b/test/FinalizableCrowdsale.js @@ -1,5 +1,5 @@ import moment from 'moment' -import advanceToBlock from './helpers/advanceToBlock' +import {advanceBlock} from './helpers/advanceToBlock' import increaseTime from './helpers/increaseTime' import latestTime from './helpers/latestTime' import EVMThrow from './helpers/EVMThrow' @@ -20,7 +20,7 @@ contract('FinalizableCrowdsale', function ([_, owner, wallet, thirdparty]) { before(async function() { //Advance to the next block to correctly read time in the solidity "now" function interpreted by testrpc - await advanceToBlock(web3.eth.getBlock('latest').number + 1) + await advanceBlock() }) beforeEach(async function () { diff --git a/test/RefundableCrowdsale.js b/test/RefundableCrowdsale.js index 518f92047..7423fd37f 100644 --- a/test/RefundableCrowdsale.js +++ b/test/RefundableCrowdsale.js @@ -1,6 +1,6 @@ import moment from 'moment' import ether from './helpers/ether' -import advanceToBlock from './helpers/advanceToBlock' +import {advanceBlock} from './helpers/advanceToBlock' import increaseTime from './helpers/increaseTime' import latestTime from './helpers/latestTime' import EVMThrow from './helpers/EVMThrow' @@ -22,7 +22,7 @@ contract('RefundableCrowdsale', function ([_, owner, wallet, investor]) { before(async function() { //Advance to the next block to correctly read time in the solidity "now" function interpreted by testrpc - await advanceToBlock(web3.eth.getBlock('latest').number + 1) + await advanceBlock() }) beforeEach(async function () { diff --git a/test/SampleCrowdsale.js b/test/SampleCrowdsale.js index b2669699a..2e64111c9 100644 --- a/test/SampleCrowdsale.js +++ b/test/SampleCrowdsale.js @@ -1,6 +1,6 @@ import moment from 'moment' import ether from './helpers/ether' -import advanceToBlock from './helpers/advanceToBlock' +import {advanceBlock} from './helpers/advanceToBlock' import increaseTime from './helpers/increaseTime' import latestTime from './helpers/latestTime' import EVMThrow from './helpers/EVMThrow' @@ -23,7 +23,7 @@ contract('Crowdsale', function ([owner, wallet, investor]) { before(async function() { //Advance to the next block to correctly read time in the solidity "now" function interpreted by testrpc - await advanceToBlock(web3.eth.getBlock('latest').number + 1) + await advanceBlock() }) beforeEach(async function () {