{"_id":"@1hive/contract-helpers-test","_rev":"6-f52d188a42eb8b4fff7580c3c05b11ff","name":"@1hive/contract-helpers-test","dist-tags":{"latest":"0.1.2"},"versions":{"0.1.0":{"name":"@1hive/contract-helpers-test","version":"0.1.0","author":{"name":"Aragon Assocation","email":"legal@aragon.org"},"license":"MIT","engines":{"node":">= 10.0.0"},"main":"src/index.js","peerDependencies":{"chai":"^4.2.0","web3":"^1.0.0"},"dependencies":{"web3-eth-abi":"1.2.5","web3-utils":"1.2.5"},"devDependencies":{"eslint":"^7.4.0","eslint-config-prettier":"^6.11.0","eslint-config-standard":"^14.1.1","eslint-plugin-import":"^2.22.0","eslint-plugin-node":"^11.1.0","eslint-plugin-prettier":"^3.1.4","eslint-plugin-promise":"^4.2.1","eslint-plugin-standard":"^4.0.1","prettier":"^2.0.5"},"scripts":{"lint":"eslint ./src","test":"npm run lint"},"description":"[![Status](https://img.shields.io/badge/stability-stable.svg?style=flat-square)](https://nodejs.org/api/documentation.html#documentation_stability_index) [![npm version](https://img.shields.io/npm/v/@aragon/contract-helpers-test.svg?style=flat-square&colo","_id":"@1hive/contract-helpers-test@0.1.0","_nodeVersion":"16.4.2","_npmVersion":"7.18.1","dist":{"integrity":"sha512-3bxPwd5KfYJpidq1UqgcEgpVAlv0LV4NWWhAwWLfQf6JSPMfSLI9XlyCCartqcLYHQHtjHY+Y9QQlwej1oxwkg==","shasum":"3184f7c9e1a67a366fddc052b4626b8d721b0f95","tarball":"https://registry.npmjs.org/@1hive/contract-helpers-test/-/contract-helpers-test-0.1.0.tgz","fileCount":37,"unpackedSize":50563,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg55sLCRA9TVsSAnZWagAA70AP/2eLSjwJ4TQ2Q1BejYs3\n+URWfHHXkk6J62/7QYvQQ3qNM+Ha3UN/d3zqyQ/v9S8rwxijZJo0Ujg6ylXc\n6pt1beaZq/Vi+e1WWl+HUlPv5Q/7f389Gnz/K0XsL4zl9ab9v2+m9qyJIgQ3\n/hMUFy7QAcpvxq6Z/ArOvvSdM9KB1icey8tl/L0Ifq+PO/Kyv0bEZ5vD3h1m\nuOAGH1tIdxOmP6ZzoYv3cJUphnH39k7NWkQtcjrV/W81oSUmUfVB6Q1xe4cR\nFcE5cXV2LOCM6cgekoEjuq9R7ieL12gOlcbtWELqJy2zsGjEGzXA4gLn1cde\ndBwh/8aN1+qwCVFaMxVmJMwN2YjY6riQuZohcd+2rhdsE6GD29k1oGus+3Qn\nI5dRzdJhbchcPqyNj1q6piDToO+JHkv+GWpuYNam+0s7E0yiGzOBWulw5ovv\nXgRiu3W6XcTB8a+2NKL35Q9ZIQYfCtbHTSjZiX+uaCJ4zD1rNeiXHS2P8LTe\nzcemCWtZ2AmZS8EUiV04vb4MH3S7GhBT+nKfKpz8be5E/y8hMbzGxa1t4Sui\nOO1feDRuRDr7i+r+rf1JBwdWY1Sq2z17vX5gg/fRG7WAM5snAKQHQ4tvznR3\nIRINEY7I6fF+7qVbekxk3gaHpv8JN6KRBErikr5vKW0ujRBJhenASBMm6MF3\niH74\r\n=i4vR\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC1B5sht/bd47W2FH7rqLzCpz8atb/bQcIL9Ijx4pAJ9gIhANHpgy3LLyEiIFfq6zyX0eztDwcTiNxsaDBZSWq4Dkf9"}]},"_npmUser":{"name":"gabrielg","email":"gabrielpk.18@gmail.com"},"directories":{},"maintainers":[{"name":"crisog","email":"ortega.cpp@gmail.com"},{"name":"gabrielg","email":"gabrielpk.18@gmail.com"},{"name":"fabriv","email":"fabriziovigevani@gmail.com"},{"name":"starsower","email":"sembrestels@gmail.com"},{"name":"willjgriff","email":"willjgriff@gmail.com"},{"name":"rperez89","email":"rodrigopi1989@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/contract-helpers-test_0.1.0_1625791243161_0.14933065600812734"},"_hasShrinkwrap":false},"0.1.1":{"name":"@1hive/contract-helpers-test","version":"0.1.1","author":{"name":"Aragon Assocation","email":"legal@aragon.org"},"license":"MIT","engines":{"node":">= 10.0.0"},"main":"src/index.js","peerDependencies":{"chai":"^4.2.0","web3":"^1.0.0"},"dependencies":{"web3-eth-abi":"1.2.5","web3-utils":"1.2.5"},"devDependencies":{"eslint":"^7.4.0","eslint-config-prettier":"^6.11.0","eslint-config-standard":"^14.1.1","eslint-plugin-import":"^2.22.0","eslint-plugin-node":"^11.1.0","eslint-plugin-prettier":"^3.1.4","eslint-plugin-promise":"^4.2.1","eslint-plugin-standard":"^4.0.1","prettier":"^2.0.5"},"scripts":{"lint":"eslint ./src","test":"npm run lint"},"description":"[![Status](https://img.shields.io/badge/stability-stable.svg?style=flat-square)](https://nodejs.org/api/documentation.html#documentation_stability_index) [![npm version](https://img.shields.io/npm/v/@1hive/contract-helpers-test.svg?style=flat-square&color","_id":"@1hive/contract-helpers-test@0.1.1","_nodeVersion":"16.4.2","_npmVersion":"7.18.1","dist":{"integrity":"sha512-VqD5FGcWCjM92r4k7Wp0qWR0PjnDcLvK8TN3TV56iWcULc3Jttbg9deIfrDjy3VBQqAFevIUizEHWuxOfFtw4Q==","shasum":"1040bf60dcd6de99489678e0a5eded53a04d2685","tarball":"https://registry.npmjs.org/@1hive/contract-helpers-test/-/contract-helpers-test-0.1.1.tgz","fileCount":37,"unpackedSize":50717,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg577VCRA9TVsSAnZWagAAgmEP/Akr0h/2UAT7XkB9CeqO\nToM1b7ffSFmjFO2HJaRZemxP0lzdWoOMTslneMAMW9xztOkSbg9iMyHHeLL1\ngvJ2oWNTg8/veaekRDnpxhJEZi/94d4V2la+y/GwRaKqt+CtZlBRrhSkEvhI\n6j1C9BZYgiBanIsYg2XZAyrJhj+m4+buPH69pq+BKG0/sp9G8Ai77kKvHI6G\nJ8QM0LBaktoeWeaqpBVo0UwHIV7alfzjNfjQ2FWGyHx8X+zbytk3UPrXlkLe\n/DTEBXCZ5jdWgwcwWAo+UGEKp9MhvVDV64mRd3+zEuza5vyh5nqDPtFZdldW\nVI5NyICBuCE5n5/9WWDAlff4cZhcUlpAQXmhkwspJwhA1inLprm2IlZKkdnD\nw6jZANmc8Ulqd4/MHT6RAakiR+fFaJGA4qSnQwd2YLgnJWBMcwnNaREBNSln\n1AH28c2uCK3e6zrmkblb6nP0+HIeB9+mDqtWwnvU/wcqWaN4pClK2zLcGQqx\nthCXRTBBxYpkG1xHjT4RCPgR9cogFWyphQT+9Eaqg+P5k3uu2dWddOAIuySj\nk+UL84TtWATUlVeZEHF6rp0laUSaGFwy8iN25noflAlBUPCg1vmCv1TBZivG\n4xCOf2laVTCJ4YN2zxK1d4czXOeWrPcnbZypTdXfbDDaujF0DCM5gDevDxhC\nUCP3\r\n=g33n\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDCHRM73Y6KH8xGU8SPTnkOXNWtzbTCUaRPr/DH+ERRWwIhAKtlJCeOJpz1s2l5rtSNS35Qv+ISbNL7CCwsZPlZRgFv"}]},"_npmUser":{"name":"gabrielg","email":"gabrielpk.18@gmail.com"},"directories":{},"maintainers":[{"name":"crisog","email":"ortega.cpp@gmail.com"},{"name":"gabrielg","email":"gabrielpk.18@gmail.com"},{"name":"fabriv","email":"fabriziovigevani@gmail.com"},{"name":"starsower","email":"sembrestels@gmail.com"},{"name":"willjgriff","email":"willjgriff@gmail.com"},{"name":"rperez89","email":"rodrigopi1989@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/contract-helpers-test_0.1.1_1625800404937_0.517064381355862"},"_hasShrinkwrap":false},"0.1.2":{"name":"@1hive/contract-helpers-test","version":"0.1.2","author":{"name":"Aragon Assocation","email":"legal@aragon.org"},"license":"MIT","engines":{"node":">= 10.0.0"},"main":"src/index.js","peerDependencies":{"chai":"^4.2.0","web3":"^1.0.0"},"dependencies":{"web3-eth-abi":"1.2.5","web3-utils":"1.2.5"},"devDependencies":{"eslint":"^7.4.0","eslint-config-prettier":"^6.11.0","eslint-config-standard":"^14.1.1","eslint-plugin-import":"^2.22.0","eslint-plugin-node":"^11.1.0","eslint-plugin-prettier":"^3.1.4","eslint-plugin-promise":"^4.2.1","eslint-plugin-standard":"^4.0.1","prettier":"^2.0.5"},"scripts":{"lint":"eslint ./src","test":"npm run lint"},"description":"[![Status](https://img.shields.io/badge/stability-stable.svg?style=flat-square)](https://nodejs.org/api/documentation.html#documentation_stability_index) [![npm version](https://img.shields.io/npm/v/@1hive/contract-helpers-test.svg?style=flat-square&color","_id":"@1hive/contract-helpers-test@0.1.2","_nodeVersion":"16.4.2","_npmVersion":"7.18.1","dist":{"integrity":"sha512-BDgn9DmAn8aYLMCRuWc0OLgp7n1DhWdtdWA8urAmwLFYhwNuzF/DNx8+o9HWFA+4d0A3AVjUVQpHts80XkZTHg==","shasum":"38be4d483512ea7b4031b37fd0aee829a25ea2f5","tarball":"https://registry.npmjs.org/@1hive/contract-helpers-test/-/contract-helpers-test-0.1.2.tgz","fileCount":37,"unpackedSize":49779,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg+zi/CRA9TVsSAnZWagAAW3YQAIQYXaOrArBZnJUfN6XS\nHt7n8o+noZKTt37qyEPF5kDULtqsNzXNGjxtEaO1iANvfZNgtN4AMBOIpgQk\nT9QrzgpzuGI7ayKIWW1vkImqUH+6EppO1m02DvNUQs3DlowUPjcA0TkSeZRv\nEmuo90fppLeTfh4q3j3LkwRmMZfJB8Jc/2mSwL7Wf0Uxh8YCtfOr6hzxB4lo\nRzbxAiR/AX5drIvQr00THPEc+Htx26xrY+eeeXtEFeCAEqFShXb5ivDkE5NB\nRI2FdqttlpMdXLrYvqlPuzfSooBM4x1OOiWuNJ2D7Mo8pQfwOqhFK7ev0SXh\nsYf5e9kvXvXHfR+pcsu9nsapEFQcOwL13WIs3BoGnpS561L3Y+7hx9UEWvSE\nIZVc+JMBQJFcScCA/f2cvbZBYM7Isq9GWhXqexnOU+B7QG+ISVBvBBIi3d+Z\nb6M+P9EdzajuzZpBqjvDrvagFJqmhllBxotjLN06Lk0AcU4yRQ9E85xSG8N3\n+l1UBIAzvRqfcpF8Q9w6EcCxcQxcL03GpyyFrM36rA0ppgRyrwvIJBq797XJ\n8uT0ED3DZq73iKQQEWY8q5CulC8QTWlWoTaFBpQ5lIE9a100Ng3ZtuUuXrc9\nnPPTnpHqvxxoNMWPeC0T/2RjQEgY5pTbU99kH/PdjAuC6pfAiaLdXRiv+Yfg\nbse8\r\n=JDkw\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDWfaoLmH5B5UwUeh7h2QH7cXEVvvPKUgoPjgfNi+lCzAIgFEB6a6Wv+0IRJadFaC3XpqWSr1T3snlAagqIPBpNMHw="}]},"_npmUser":{"name":"gabrielg","email":"gabrielpk.18@gmail.com"},"directories":{},"maintainers":[{"name":"gabrielg","email":"gabrielpk.18@gmail.com"},{"name":"fabriv","email":"fabriziovigevani@gmail.com"},{"name":"starsower","email":"sembrestels@gmail.com"},{"name":"willjgriff","email":"willjgriff@gmail.com"},{"name":"rperez89","email":"rodrigopi1989@gmail.com"},{"name":"crisog","email":"ortega.cpp@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/contract-helpers-test_0.1.2_1627076799835_0.13590426353061202"},"_hasShrinkwrap":false}},"time":{"created":"2021-07-09T00:40:42.905Z","0.1.0":"2021-07-09T00:40:43.331Z","modified":"2024-05-01T23:03:45.999Z","0.1.1":"2021-07-09T03:13:25.067Z","0.1.2":"2021-07-23T21:46:39.954Z"},"maintainers":[{"email":"windholyghost@gmail.com","name":"kamikazebr"},{"email":"gabrielpk.18@gmail.com","name":"gabrielg"},{"email":"fabriziovigevani@gmail.com","name":"fabriv"},{"email":"sembrestels@gmail.com","name":"starsower"},{"email":"willjgriff@gmail.com","name":"willjgriff"},{"email":"rodrigopi1989@gmail.com","name":"rperez89"}],"description":"[![Status](https://img.shields.io/badge/stability-stable.svg?style=flat-square)](https://nodejs.org/api/documentation.html#documentation_stability_index) [![npm version](https://img.shields.io/npm/v/@1hive/contract-helpers-test.svg?style=flat-square&color","author":{"name":"Aragon Assocation","email":"legal@aragon.org"},"license":"MIT","readme":"# Aragon test helpers\n\n[![Status](https://img.shields.io/badge/stability-stable.svg?style=flat-square)](https://nodejs.org/api/documentation.html#documentation_stability_index)\n[![npm version](https://img.shields.io/npm/v/@1hive/contract-helpers-test.svg?style=flat-square&color=lightgrey)](https://npmjs.org/package/@1hive/truffle-config-v4)\n\nTest helpers for both generic Solidity and Aragon-related smart contracts.\n\n> 🛠 This package is designed to be used in a [`web3.js@1`](js.readthedocs.io/en/1.0/) and [Truffle v5](https://www.trufflesuite.com/docs/truffle/overview) environment. If you are using [ethers.js](https://docs.ethers.io/v5/), you are likely much better served by [waffle](https://getwaffle.io/) which comes batteries-included with most of the [assertion matchers](https://ethereum-waffle.readthedocs.io/en/latest/matchers.html) you'll need.\n\n## Quick start\n\nInstall with `yarn add --dev @1hive/contract-helpers-test`.\n\nIn your tests, you'll then import these utilities like so:\n\n```js\nconst {\n  bn,\n  getEvents,\n  MAX_UINT256,\n  ZERO_ADDRESS,\n} = require('@1hive/contract-helpers-test')\nconst {\n  assertEvent,\n  assertRevert,\n} = require('@1hive/contract-helpers-test/asserts')\nconst {\n  newDao,\n  newDaoFactory,\n} = require('@1hive/contract-helpers-test/aragon-os')\n```\n\nA number of contract mocks are also accessible through `@1hive/contract-helpers-test/contracts/` and may be useful for testing Aragon apps or other generic smart contracts. More documentation on these contract mocks is available in the [`contracts/`](./contracts) subdirectory.\n\n## API\n\nThe test helpers are grouped into several main exports:\n\n- [`@1hive/contract-helpers-test/`](#generic-utilities): generic utilities for on-chain interactions\n- [`@1hive/contract-helpers-test/asserts`](#custom-assertions): custom assertions for on-chain interactions\n- [`@1hive/contract-helpers-test/aragon-os`](#aragonos-utilities): aragonOS-related utilities\n- [`@1hive/contract-helpers-test/aragon-os/asserts`](#aragonos-assertions): aragonOS-related assertions\n\nFurthermore, the package also comes with:\n\n- [`@1hive/contract-helpers-test/contracts`](#smart-contract-mocks): smart contract mocks\n- [`@1hive/contract-helpers-test/scripts`](#shell-scripts): utility shell scripts\n\n### Global state\n\nThe utilities exposed from the test helpers will automatically detect and bind to an injected Truffle environment (`artifacts` and `web3`).\n\nHowever, it is possible to override this default binding or inject your own if none exist at the start of a file.\n\n#### `ctx`\n\nIndividual utilities containing a trailing `ctx` parameter allow you to override the environment specifically for that single call.\n\n```ts\ntype Artifacts = {\n  require: (name: string) => TruffleContract\n}\n\ntype Context = {\n  artifacts: Artifacts\n  web3: Web3\n}\n```\n\n#### `injectArtifacts()`\n\nInject an `artifacts` object into the global default environment.\n\nNote that all future calls will now reference this new `artifacts` object by default.\n\n#### `injectWeb3()`\n\nInject a `web3` object into the global default environment.\n\nNote that all future calls will now reference this new `web3` object by default.\n\n### Generic utilities\n\n#### Constants\n\nThe following constants are available, and mostly self-explanatory:\n\n- Ethereum related\n  - `EMPTY_BYTES`\n  - `ZERO_ADDRESS`\n  - `ZERO_BYTES32`\n- Number related\n  - `MAX_UINT64`\n  - `MAX_UINT192`\n  - `MAX_UINT256`\n- Time related\n  - `NOW`: `Date.now()`, _in seconds_\n  - `TOMORROW`: one day ahead of `Date.now()`, _in seconds_\n  - `NEXT_WEEK`: one week ahead of `Date.now()`, _in seconds_\n  - `ONE_DAY`: duration for one day, _in seconds_\n  - `ONE_WEEK`: duration for one week, _in seconds_\n\n### Custom assertions\n\n### aragonOS utilities\n\n#### Constants\n\nThe following constants are available:\n\n- ACL\n  - `ANY_ENTITY`: address denoting any address has permission\n  - `BURN_MANAGER`: address denoting a permission has been frozen via discarding (burning) its manager\n- EVM Scripts\n  - `EMPTY_CALLS_SCRIPT`: empty CallsScript (with spec id 1)\n\n### aragonOS assertions\n\n### Smart contract mocks\n\nPlease visit the documentation available in [`contracts/`](./contracts).\n\n### Shell scripts\n\n#### `ganache-cli.sh`\n\nA utility script to start a local `ganache-cli` or `solidity-coverage` RPC node and initiate `npx truffle test`.\n\nThis script is generally considered deprecated but may be useful if your test framework still requires you to start a local test node manually.\n\nIf you haven't already done so, you may be interested in migrating to [buidler](https://buidler.dev/), which handles this connection for you.\n","readmeFilename":"README.md"}