{"_id":"@dragnio/contract-helpers-test","_rev":"3-5d8a1cd61636f04cb7feebba15b8c7a3","name":"@dragnio/contract-helpers-test","dist-tags":{"latest":"0.1.1"},"versions":{"0.1.0":{"name":"@dragnio/contract-helpers-test","version":"0.1.0","author":"","license":"","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":"@dragnio/contract-helpers-test@0.1.0","_nodeVersion":"14.17.3","_npmVersion":"6.14.13","dist":{"integrity":"sha512-FhyR+bKGba3ZRlxQB8jf8X9L6axhaZheWicm72QDNKp0YJT2DnCKFcDDcJqT4MCOrBnanMtIL2cZqXChZ5/MuQ==","shasum":"b5f929d01fd0f6c84bfb0ee4144b2abb0003df2f","tarball":"https://registry.npmjs.org/@dragnio/contract-helpers-test/-/contract-helpers-test-0.1.0.tgz","fileCount":37,"unpackedSize":50172,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAXj2CwvtEF70WZKFQ9WCleDvb21rrGpIdG2l171v2G4AiAgHFI9yzPSmUvdTVjWXSSv17pqqR7fLVDsUsLO5AwKgQ=="}]},"_npmUser":{"name":"henrysyahputra","email":"henry.syahputra@gmail.com"},"directories":{},"maintainers":[{"name":"henrysyahputra","email":"henry.syahputra@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/contract-helpers-test_0.1.0_1632602417115_0.4623137047950767"},"_hasShrinkwrap":false},"0.1.1":{"name":"@dragnio/contract-helpers-test","version":"0.1.1","author":"","license":"","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":"@dragnio/contract-helpers-test@0.1.1","_nodeVersion":"14.17.0","_npmVersion":"6.14.13","dist":{"integrity":"sha512-jcB65+FWjdpr9aycCgSryozMo9h70kEuZT9BHmDu+hEp+JH2j4idepxR1JuEv4o0dWIDV/FxDt9SOYbDeCv1Ug==","shasum":"88be8f4ce834e27d535ea1531e8ac418150e2363","tarball":"https://registry.npmjs.org/@dragnio/contract-helpers-test/-/contract-helpers-test-0.1.1.tgz","fileCount":37,"unpackedSize":50167,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhzzkiCRA9TVsSAnZWagAASVUP/0RoW/+kDZpidrKd+Ux1\n+EguxmUOoedwBh1eHOoJaxQxNkfUMHpDYf/NwNsDsADgin46c3vGABo7dqoz\nNOdQTqe71p6gc3tRVt28qFU+zybJlwIX81+j2zC9XjSlN8qO5C4BMsG+a7No\n2R365FXnc+vn4HF3/J9Jwl4jJ9M5RUAbizlw1Av1B4zaRz/rXUgDmBJp4aVo\nNW6y3ke9nX0Z6eAUm7PEMPQZfBcMpvnAI/QsZBL/2q9HN0xbXxJwWIXCQ1/I\neAGedq3oS5NvA++yAsWLYf50kx7UXcYf9wJF0BYKKFPS17MM4zD0NY0/qy8r\nUoaWLk/G4d58g/Q4QK25b4NmqwgMj4lOW2Bn2ySBs4AiKKGSAOscw23K+nwt\nIkWkolnrSXIvOgj4LWPlKdCZP/eCHf9td5Te7TDTeYd4bC+p+bA14sS2i1Q1\nvkKn5JQvAX45v/s8Qn1zk+Exadg5+IamWExEMD1A0R+hfHuTYF2NljvuaO62\nfP02ZmLDx9K595VTzDIhB1x7R4gpSIjhjm+WYMHDF3zvXAOCG8KYlPvGr4kk\n5R5i+ya8AzY59OdsuGGCTz2Gd1ZalC78joDfKr5mpmY2wyHWZ+wsF6ufVuQw\nwj1v3spL33d036qAmmlkYd6kFjs9qWjDRYs3i7yYR3VvqgX8dTIvR100+W1I\nf/Og\r\n=pRnS\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIC7rn62KyzCc6m469Ll3eQdqf8dWpkY6ms5nK4uunghqAiAubqaxMswfweJ68J6P4mQx7VVn1g5RxlyCL6VomfKajw=="}]},"_npmUser":{"name":"henrysyahputra","email":"henry.syahputra@gmail.com"},"directories":{},"maintainers":[{"name":"henrysyahputra","email":"henry.syahputra@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/contract-helpers-test_0.1.1_1632926868426_0.1617216412829987"},"_hasShrinkwrap":false}},"time":{"created":"2021-09-25T20:40:17.062Z","0.1.0":"2021-09-25T20:40:17.267Z","modified":"2022-04-05T05:36:11.611Z","0.1.1":"2021-09-29T14:47:48.545Z"},"maintainers":[{"name":"henrysyahputra","email":"henry.syahputra@gmail.com"}],"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","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/@aragon/contract-helpers-test.svg?style=flat-square&color=lightgrey)](https://npmjs.org/package/@aragon/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 @aragon/contract-helpers-test`.\n\nIn your tests, you'll then import these utilities like so:\n\n```js\nconst { bn, getEvents, MAX_UINT256, ZERO_ADDRESS } = require('@aragon/contract-helpers-test')\nconst { assertEvent, assertRevert } = require('@aragon/contract-helpers-test/asserts')\nconst { newDao, newDaoFactory } = require('@aragon/contract-helpers-test/aragon-os')\n```\n\nA number of contract mocks are also accessible through `@aragon/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- [`@aragon/contract-helpers-test/`](#generic-utilities): generic utilities for on-chain interactions\n- [`@aragon/contract-helpers-test/asserts`](#custom-assertions): custom assertions for on-chain interactions\n- [`@aragon/contract-helpers-test/aragon-os`](#aragonos-utilities): aragonOS-related utilities\n- [`@aragon/contract-helpers-test/aragon-os/asserts`](#aragonos-assertions): aragonOS-related assertions\n\nFurthermore, the package also comes with:\n\n- [`@aragon/contract-helpers-test/contracts`](#smart-contract-mocks): smart contract mocks\n- [`@aragon/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"}