From 87b93ed3377a24de1b5e43c360c95ba7cec269e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Venturo?= Date: Fri, 29 Mar 2019 18:09:11 -0300 Subject: [PATCH 1/2] Add provider-engine support. --- CHANGELOG.md | 5 ++++- src/time.js | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a9b22d8..0ef0bf9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,10 @@ # Changelog +## 0.3.0 (unreleased) + * Add support for environments using `web3-provider-engine`. ([#24](https://github.com/OpenZeppelin/openzeppelin-test-helpers/pull/24)) + ## 0.3.0 (2019-03-19) * `chai` is no longer exported, and `should` is no longer automatically installed. ([#18](https://github.com/OpenZeppelin/openzeppelin-test-helpers/pull/18)) - + #### How to upgrade from 0.2 If you use Chai assertions in your project you should make sure to explicitly install it: `npm install chai`. If you need to access the `chai` instance you should now get it through `require('chai')`. If you use `should`-style assertions you should set it up manually now, by adding `require('chai/register-should')` in your tests, or e.g. in your Truffle config. Check out OpenZeppelin's upgrade commit in case it might be helpful: [`cf7375d`](https://github.com/OpenZeppelin/openzeppelin-solidity/commit/cf7375d6b873afc9f705e329db39e2ef389af9d2). diff --git a/src/time.js b/src/time.js index 1b0b86f..f22026b 100644 --- a/src/time.js +++ b/src/time.js @@ -2,7 +2,7 @@ const { BN } = require('./setup'); const { promisify } = require('util'); function advanceBlock () { - return promisify(web3.currentProvider.send)({ + return promisify(web3.currentProvider.send.bind(web3.currentProvider))({ jsonrpc: '2.0', method: 'evm_mine', }); @@ -27,7 +27,7 @@ async function increase (duration) { if (duration.isNeg()) throw Error(`Cannot increase time by a negative amount (${duration})`); - await promisify(web3.currentProvider.send)({ + await promisify(web3.currentProvider.send.bind(web3.currentProvider))({ jsonrpc: '2.0', method: 'evm_increaseTime', params: [duration.toNumber()], From 0bef8995ad955399ee1306bb4ed3ab78782c8a9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Venturo?= Date: Fri, 29 Mar 2019 18:09:57 -0300 Subject: [PATCH 2/2] Update CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0ef0bf9..b61f2b3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # Changelog -## 0.3.0 (unreleased) +## 0.3.1 (unreleased) * Add support for environments using `web3-provider-engine`. ([#24](https://github.com/OpenZeppelin/openzeppelin-test-helpers/pull/24)) ## 0.3.0 (2019-03-19)