Skip to content

Commit

Permalink
Add provider-engine support. (#24)
Browse files Browse the repository at this point in the history
* Add provider-engine support.

* Update CHANGELOG.md
  • Loading branch information
nventuro committed Apr 1, 2019
1 parent 58e022d commit 1105155
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 4 additions & 1 deletion CHANGELOG.md
@@ -1,7 +1,10 @@
# Changelog

## 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)
* `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).
4 changes: 2 additions & 2 deletions src/time.js
Expand Up @@ -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',
});
Expand All @@ -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()],
Expand Down

0 comments on commit 1105155

Please sign in to comment.