Merge branch 'release-2.1.2'

pull/1609/head^2
Nicolás Venturo 6 years ago
commit e1f40e7e23
  1. 3
      CHANGELOG.md
  2. 2
      ethpm.json
  3. 2
      package-lock.json
  4. 4
      package.json
  5. 2
      test/access/roles/CapperRole.test.js
  6. 2
      test/access/roles/MinterRole.test.js
  7. 2
      test/access/roles/PauserRole.test.js
  8. 2
      test/access/roles/SignerRole.test.js
  9. 2
      test/access/roles/WhitelistAdminRole.test.js
  10. 2
      test/access/roles/WhitelistedRole.test.js
  11. 15
      test/behaviors/access/roles/PublicRole.behavior.js
  12. 2
      test/crowdsale/IndividuallyCappedCrowdsale.test.js
  13. 2
      test/drafts/SignatureBouncer.test.js
  14. 2
      test/lifecycle/Pausable.test.js
  15. 2
      test/token/ERC20/ERC20Mintable.test.js
  16. 2
      test/token/ERC20/ERC20Pausable.test.js
  17. 2
      test/token/ERC721/ERC721Pausable.test.js

@ -10,6 +10,9 @@
### Breaking changes:
## 2.1.2 (2019-17-01)
* Removed most of the test suite from the npm package, except `PublicRole.behavior.js`, which may be useful to users testing their own `Roles`.
## 2.1.1 (2019-04-01)
* Version bump to avoid conflict in the npm registry.

@ -1,6 +1,6 @@
{
"package_name": "zeppelin",
"version": "2.1.1",
"version": "2.1.2",
"description": "Secure Smart Contract library for Solidity",
"authors": [
"OpenZeppelin Community <maintainers@openzeppelin.org>"

2
package-lock.json generated

@ -1,6 +1,6 @@
{
"name": "openzeppelin-solidity",
"version": "2.1.1",
"version": "2.1.2",
"lockfileVersion": 1,
"requires": true,
"dependencies": {

@ -1,11 +1,11 @@
{
"name": "openzeppelin-solidity",
"version": "2.1.1",
"version": "2.1.2",
"description": "Secure Smart Contract library for Solidity",
"files": [
"build",
"contracts",
"test"
"test/behaviors"
],
"scripts": {
"build": "scripts/build.sh",

@ -1,4 +1,4 @@
const { shouldBehaveLikePublicRole } = require('../../access/roles/PublicRole.behavior');
const { shouldBehaveLikePublicRole } = require('../../behaviors/access/roles/PublicRole.behavior');
const CapperRoleMock = artifacts.require('CapperRoleMock');
contract('CapperRole', function ([_, capper, otherCapper, ...otherAccounts]) {

@ -1,4 +1,4 @@
const { shouldBehaveLikePublicRole } = require('../../access/roles/PublicRole.behavior');
const { shouldBehaveLikePublicRole } = require('../../behaviors/access/roles/PublicRole.behavior');
const MinterRoleMock = artifacts.require('MinterRoleMock');
contract('MinterRole', function ([_, minter, otherMinter, ...otherAccounts]) {

@ -1,4 +1,4 @@
const { shouldBehaveLikePublicRole } = require('../../access/roles/PublicRole.behavior');
const { shouldBehaveLikePublicRole } = require('../../behaviors/access/roles/PublicRole.behavior');
const PauserRoleMock = artifacts.require('PauserRoleMock');
contract('PauserRole', function ([_, pauser, otherPauser, ...otherAccounts]) {

@ -1,4 +1,4 @@
const { shouldBehaveLikePublicRole } = require('../../access/roles/PublicRole.behavior');
const { shouldBehaveLikePublicRole } = require('../../behaviors/access/roles/PublicRole.behavior');
const SignerRoleMock = artifacts.require('SignerRoleMock');
contract('SignerRole', function ([_, signer, otherSigner, ...otherAccounts]) {

@ -1,4 +1,4 @@
const { shouldBehaveLikePublicRole } = require('../../access/roles/PublicRole.behavior');
const { shouldBehaveLikePublicRole } = require('../../behaviors/access/roles/PublicRole.behavior');
const WhitelistAdminRoleMock = artifacts.require('WhitelistAdminRoleMock');
contract('WhitelistAdminRole', function ([_, whitelistAdmin, otherWhitelistAdmin, ...otherAccounts]) {

@ -1,4 +1,4 @@
const { shouldBehaveLikePublicRole } = require('../../access/roles/PublicRole.behavior');
const { shouldBehaveLikePublicRole } = require('../../behaviors/access/roles/PublicRole.behavior');
const WhitelistedRoleMock = artifacts.require('WhitelistedRoleMock');
contract('WhitelistedRole', function ([_, whitelisted, otherWhitelisted, whitelistAdmin, ...otherAccounts]) {

@ -5,6 +5,21 @@ function capitalize (str) {
return str.replace(/\b\w/g, l => l.toUpperCase());
}
// Tests that a role complies with the standard role interface, that is:
// * an onlyRole modifier
// * an isRole function
// * an addRole function, accessible to role havers
// * a renounceRole function
// * roleAdded and roleRemoved events
// Both the modifier and an additional internal remove function are tested through a mock contract that exposes them.
// This mock contract should be stored in this.contract.
//
// @param authorized an account that has the role
// @param otherAuthorized another account that also has the role
// @param anyone an account that doesn't have the role, passed inside an array for ergonomics
// @param rolename a string with the name of the role
// @param manager undefined for regular roles, or a manager account for managed roles. In these, only the manager
// account can create and remove new role bearers.
function shouldBehaveLikePublicRole (authorized, otherAuthorized, [anyone], rolename, manager) {
rolename = capitalize(rolename);

@ -2,7 +2,7 @@ const { BN, ether, shouldFail } = require('openzeppelin-test-helpers');
const IndividuallyCappedCrowdsaleImpl = artifacts.require('IndividuallyCappedCrowdsaleImpl');
const SimpleToken = artifacts.require('SimpleToken');
const { shouldBehaveLikePublicRole } = require('../access/roles/PublicRole.behavior');
const { shouldBehaveLikePublicRole } = require('../behaviors/access/roles/PublicRole.behavior');
contract('IndividuallyCappedCrowdsale', function (
[_, capper, otherCapper, wallet, alice, bob, charlie, anyone, ...otherAccounts]) {

@ -1,6 +1,6 @@
const { shouldFail } = require('openzeppelin-test-helpers');
const { getSignFor } = require('../helpers/sign');
const { shouldBehaveLikePublicRole } = require('../access/roles/PublicRole.behavior');
const { shouldBehaveLikePublicRole } = require('../behaviors/access/roles/PublicRole.behavior');
const SignatureBouncerMock = artifacts.require('SignatureBouncerMock');

@ -1,5 +1,5 @@
const { expectEvent, shouldFail } = require('openzeppelin-test-helpers');
const { shouldBehaveLikePublicRole } = require('../access/roles/PublicRole.behavior');
const { shouldBehaveLikePublicRole } = require('../behaviors/access/roles/PublicRole.behavior');
const PausableMock = artifacts.require('PausableMock');

@ -1,6 +1,6 @@
const { shouldBehaveLikeERC20Mintable } = require('./behaviors/ERC20Mintable.behavior');
const ERC20MintableMock = artifacts.require('ERC20MintableMock');
const { shouldBehaveLikePublicRole } = require('../../access/roles/PublicRole.behavior');
const { shouldBehaveLikePublicRole } = require('../../behaviors/access/roles/PublicRole.behavior');
contract('ERC20Mintable', function ([_, minter, otherMinter, ...otherAccounts]) {
beforeEach(async function () {

@ -1,7 +1,7 @@
const { BN, expectEvent, shouldFail } = require('openzeppelin-test-helpers');
const ERC20PausableMock = artifacts.require('ERC20PausableMock');
const { shouldBehaveLikePublicRole } = require('../../access/roles/PublicRole.behavior');
const { shouldBehaveLikePublicRole } = require('../../behaviors/access/roles/PublicRole.behavior');
contract('ERC20Pausable', function ([_, pauser, otherPauser, recipient, anotherAccount, ...otherAccounts]) {
const initialSupply = new BN(100);

@ -1,7 +1,7 @@
require('openzeppelin-test-helpers');
const { shouldBehaveLikeERC721PausedToken } = require('./ERC721PausedToken.behavior');
const { shouldBehaveLikeERC721 } = require('./ERC721.behavior');
const { shouldBehaveLikePublicRole } = require('../../access/roles/PublicRole.behavior');
const { shouldBehaveLikePublicRole } = require('../../behaviors/access/roles/PublicRole.behavior');
const ERC721PausableMock = artifacts.require('ERC721PausableMock.sol');

Loading…
Cancel
Save