- Fixed some RPC calls not having an
id
field. (#92) - Added
singletons
configuration and renamed theenvironment
option tosingletons.abstraction
. (#96)
- Fixed a bug in the
chai-bn
setup. (#85)
- Removed the requirement to install
chai
when using the library. (#84)
- Removed check for truffle environments on configure due to issues with truffle migrations.
- Renamed the package to
@openzeppelin/test-helpers
. (#78) - Removed hard-dependency on
truffle-contract
(#75):- An
environment
option was added toconfigure
, and can be set to eitherweb3
ortruffle
(default isweb3
, but there is automatic detection of atruffle
environment) singletons
returnweb3 Contract
instances whenenvironment
is set toweb3
expectEvent.inLogs
was deprecated in favor ofexpectEvent
, which receives the full receipt object (not just the logs), and supports both web3 and truffle contract receipts
- An
- Improved how revert reason checks (
expectRevert
) are handled on unsupported environments. (#80) - Breaking:
configure
'sweb3
argument was removed and replaced byprovider
, which can be either a web3 provider or a connection string. The default ishttp://localhost:8545
, unless a globalweb3
instance is found, in which caseweb3.currentProvider
is used. - Add optional
unit
argument tobalance
functions. (#79)
The package has been renamed to @openzeppelin/test-helpers
, so please uninstall openzeppelin-test-helpers
and reinstall it with the new name.
npm remove openzeppelin-test-helpers
npm install --save-dev @openzeppelin/test-helpers
If you are using openzeppelin-test-helpers
in a Truffle environment with automatic configuration, there is nothing you need to do. If you were manually configuring a web3
instance, you will need to configure the provider
instead. The specifics will depend on your setup, but the following should get you started.
-require('openzeppelin-test-helpers/configure')({ web3: myWeb3 });
+require('@openzeppelin/test-helpers/configure')({ provider: myWeb3.currentProvider });
Additionally, Truffle migrations require explicit environment configuration, since automatic detection does not work.
require('@openzeppelin/test-helpers/configure')({ provider: web3.currentProvider, environment: 'truffle' });
- Upgraded web3-utils and truffle-contract dependencies to use the stable web3 release. (#65)
- Added support for web3 ^1.2.0 (included by truffle v5.0.29). (#63)
- Fixed
shouldFail.reverting.withMessage
on non-Ganache chains. (#25) - Fixed
send.transaction
not working on contracts with a fallback function. (#26) - Made
shouldFail.reverting.withMessage
fail if no error string was provided. (#28) - Renamed
makeInterfaceId
tomakeInterfaceId.ERC165
, and addedmakeInterfaceId.ERC1820
. (#21) - Added possibility to configure a custom web3 instance. (#38)
- Replaced
shouldFail
withexpectRevert
, with an improved API. (#39) - Fixed detection of Ganache pre-releases (such as those used by Ganache GUI v2.0.1). (#46)
- Change all occurences of
makeInterfaceId
tomakeInterfaceId.ERC165
. - The
shouldFail
module has been renamed toexpectRevert
, andreverting.withMessage
is now the main module export.
0.3 | 0.4 |
---|---|
shouldFail.reverting.withMessage |
expectRevert |
shouldFail.reverting |
expectRevert.unspecified |
shouldFail.throwing |
expectRevert.invalidOpcode |
shouldFail.outOfGas |
expectRevert.outOfGas |
- Updated ERC1820Registry address. (#26)
- Added support for environments using
web3-provider-engine
. (#24)
chai
is no longer exported, andshould
is no longer automatically installed. (#18)
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
.