From b0cd3397c3341669bf26c85270d417f9472acd92 Mon Sep 17 00:00:00 2001 From: rzadp Date: Wed, 10 Aug 2022 11:25:06 +0200 Subject: [PATCH 1/5] =?UTF-8?q?=F0=9F=91=94=20Add=20a=20big=20number=20tes?= =?UTF-8?q?t=20to=20revertedWith=20withArgs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- waffle-hardhat/contracts/CustomError.sol | 4 ++++ waffle-hardhat/test/reverted.test.ts | 21 ++++++++++++++++++++- 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/waffle-hardhat/contracts/CustomError.sol b/waffle-hardhat/contracts/CustomError.sol index fadad6ffb..773176ecb 100644 --- a/waffle-hardhat/contracts/CustomError.sol +++ b/waffle-hardhat/contracts/CustomError.sol @@ -8,6 +8,10 @@ contract Matchers { revert One(0, 'message', 0x00cFBbaF7DDB3a1476767101c12a0162e241fbAD2a0162e2410cFBbaF7162123); } + function doRevertWithBigNumber() public pure { + revert One(9007199254740991000000, 'message', 0x00cFBbaF7DDB3a1476767101c12a0162e241fbAD2a0162e2410cFBbaF7162123); + } + function doRevertWithTwo() public pure { revert Two( [ diff --git a/waffle-hardhat/test/reverted.test.ts b/waffle-hardhat/test/reverted.test.ts index b88423704..9e900e682 100644 --- a/waffle-hardhat/test/reverted.test.ts +++ b/waffle-hardhat/test/reverted.test.ts @@ -2,7 +2,7 @@ import {waffle} from 'hardhat'; import {expect} from 'chai'; import {MockProvider} from 'ethereum-waffle'; import {revertedTest, revertedWithTest} from '@ethereum-waffle/chai/test'; -import {ContractFactory} from 'ethers'; +import {BigNumber, ContractFactory} from 'ethers'; import CustomError from '../build/contracts/CustomError.sol/Matchers.json'; describe('INTEGRATION: Matchers: reverted', () => { @@ -58,6 +58,25 @@ describe('INTEGRATION: Matchers: revertedWith', () => { 'message', '0x00cfbbaf7ddb3a1476767101c12a0162e241fbad2a0162e2410cfbbaf7162123' ); + + await expect(matchers.doRevertWithOne()) + .to.be.revertedWith('One') + .withArgs( + BigNumber.from('0'), // Check BigNumber instance as well. + 'message', + '0x00cfbbaf7ddb3a1476767101c12a0162e241fbad2a0162e2410cfbbaf7162123' + ); + }); + + it('With args and big number success', async () => { + const matchers = await deploy(); + await expect(matchers.doRevertWithBigNumber()) + .to.be.revertedWith('One') + .withArgs( + BigNumber.from('9007199254740991000000'), + 'message', + '0x00cfbbaf7ddb3a1476767101c12a0162e241fbad2a0162e2410cfbbaf7162123' + ); }); it('With args failure', async () => { From 08f7085f09498900532849a4135f8fd67296aea4 Mon Sep 17 00:00:00 2001 From: rzadp Date: Mon, 31 Oct 2022 14:54:55 +0100 Subject: [PATCH 2/5] Implement json parse preserving big ints as strings --- pnpm-lock.yaml | 206 +++++++++-------------- waffle-chai/package.json | 10 +- waffle-chai/src/matchers/revertedWith.ts | 12 +- 3 files changed, 100 insertions(+), 128 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 2eb418c9e..9bdc3b9ee 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -216,17 +216,21 @@ importers: specifiers: '@ethereum-waffle/provider': workspace:* '@types/debug': ^4.1.7 + '@types/json-bigint': ^1.0.1 debug: ^4.3.4 eslint: ^7.14.0 ethers: 5.6.2 + json-bigint: ^1.0.0 mocha: ^8.2.1 rimraf: ^3.0.2 typescript: ^4.6.2 dependencies: '@ethereum-waffle/provider': link:../waffle-provider debug: 4.3.4 + json-bigint: 1.0.0 devDependencies: '@types/debug': 4.1.7 + '@types/json-bigint': 1.0.1 eslint: 7.18.0 ethers: 5.6.2 mocha: 8.2.1 @@ -354,23 +358,23 @@ importers: waffle-hardhat: specifiers: '@ethereum-waffle/chai': workspace:* - '@nomiclabs/hardhat-ethers': 2.1.0 + '@nomiclabs/hardhat-ethers': 2.0.3 '@nomiclabs/hardhat-waffle': 2.0.3 '@types/node': ^17.0.41 eslint: ^7.14.0 ethereum-waffle: workspace:* ethers: 5.6.2 - hardhat: 2.10.1 + hardhat: 2.9.2 mocha: ^8.2.1 devDependencies: '@ethereum-waffle/chai': link:../waffle-chai - '@nomiclabs/hardhat-ethers': 2.1.0_mdh44cjfarfq76b44mvd54x3wq - '@nomiclabs/hardhat-waffle': 2.0.3_vzwoki3ygnfacj5msaazjpoonu + '@nomiclabs/hardhat-ethers': 2.0.3_ethers@5.6.2+hardhat@2.9.2 + '@nomiclabs/hardhat-waffle': 2.0.3_kadr5nyj4sdosrx7ad4g4lszyu '@types/node': 17.0.41 eslint: 7.18.0 ethereum-waffle: link:../waffle-cli ethers: 5.6.2 - hardhat: 2.10.1 + hardhat: 2.9.2 mocha: 8.2.1 waffle-mock-contract: @@ -1214,14 +1218,6 @@ packages: tweetnacl-util: 0.15.1 dev: true - /@noble/hashes/1.1.2: - resolution: {integrity: sha512-KYRCASVTv6aeUi1tsF8/vpyR7zpfs3FUzy2Jqm+MU+LmUKhQ0y2FpfwqkCcxSg2ua4GALJd8k2R76WxwZGbQpA==} - dev: true - - /@noble/secp256k1/1.6.3: - resolution: {integrity: sha512-T04e4iTurVy7I8Sw4+c5OSN9/RkPlo1uKxAomtxQNLq8j1uPAqnsqG1bqvY3Jv7c13gyr6dui0zmh/I3+f/JaQ==} - dev: true - /@nodelib/fs.scandir/2.1.4: resolution: {integrity: sha512-33g3pMJk3bg5nXbL/+CY6I2eJDzZAni49PfJnL5fghPTggPvBd/pFNSgJsdAgWptuFu7qq/ERvOYFlhvsLTCKA==} engines: {node: '>= 8'} @@ -1240,17 +1236,17 @@ packages: '@nodelib/fs.scandir': 2.1.4 fastq: 1.10.0 - /@nomiclabs/hardhat-ethers/2.1.0_mdh44cjfarfq76b44mvd54x3wq: - resolution: {integrity: sha512-vlW90etB3675QWG7tMrHaDoTa7ymMB7irM4DAQ98g8zJoe9YqEggeDnbO6v5b+BLth/ty4vN6Ko/kaqRN1krHw==} + /@nomiclabs/hardhat-ethers/2.0.3_ethers@5.6.2+hardhat@2.9.2: + resolution: {integrity: sha512-IJ0gBotVtO7YyLZyHNgbxzskUtFok+JkRlKPo8YELqj1ms9XL6Qm3vsfsGdZr22wnJeVEF5TQPotKuwQk21Dag==} peerDependencies: ethers: ^5.0.0 hardhat: ^2.0.0 dependencies: ethers: 5.6.2 - hardhat: 2.10.1 + hardhat: 2.9.2 dev: true - /@nomiclabs/hardhat-waffle/2.0.3_vzwoki3ygnfacj5msaazjpoonu: + /@nomiclabs/hardhat-waffle/2.0.3_kadr5nyj4sdosrx7ad4g4lszyu: resolution: {integrity: sha512-049PHSnI1CZq6+XTbrMbMv5NaL7cednTfPenx02k3cEh8wBMLa6ys++dBETJa6JjfwgA9nBhhHQ173LJv6k2Pg==} peerDependencies: '@nomiclabs/hardhat-ethers': ^2.0.0 @@ -1258,12 +1254,12 @@ packages: ethers: ^5.0.0 hardhat: ^2.0.0 dependencies: - '@nomiclabs/hardhat-ethers': 2.1.0_mdh44cjfarfq76b44mvd54x3wq + '@nomiclabs/hardhat-ethers': 2.0.3_ethers@5.6.2+hardhat@2.9.2 '@types/sinon-chai': 3.2.5 '@types/web3': 1.0.19 ethereum-waffle: link:waffle-cli ethers: 5.6.2 - hardhat: 2.10.1 + hardhat: 2.9.2 dev: true /@openzeppelin/contracts/3.0.1: @@ -1315,25 +1311,6 @@ packages: - supports-color dev: false - /@scure/base/1.1.1: - resolution: {integrity: sha512-ZxOhsSyxYwLJj3pLZCefNitxsj093tb2vq90mp2txoYeBqbcjDjqFhyM8eUjq/uFm6zJ+mUuqxlS2FkuSY1MTA==} - dev: true - - /@scure/bip32/1.1.0: - resolution: {integrity: sha512-ftTW3kKX54YXLCxH6BB7oEEoJfoE2pIgw7MINKAs5PsS6nqKPuKk1haTF/EuHmYqG330t5GSrdmtRuHaY1a62Q==} - dependencies: - '@noble/hashes': 1.1.2 - '@noble/secp256k1': 1.6.3 - '@scure/base': 1.1.1 - dev: true - - /@scure/bip39/1.1.0: - resolution: {integrity: sha512-pwrPOS16VeTKg98dYXQyIjJEcWfz7/1YJIwxUEPFfQPtc86Ym/1sVgQ2RLoD43AazMk2l/unK4ITySSpW2+82w==} - dependencies: - '@noble/hashes': 1.1.2 - '@scure/base': 1.1.1 - dev: true - /@sentry/core/5.30.0: resolution: {integrity: sha512-TmfrII8w1PQZSZgPpUESqjB+jC6MvZJZdLtE/0hZ+SrnKhW3x5WlYLvTXZpcWePYBku7rl2wn1RZu6uT0qCTeg==} engines: {node: '>=6'} @@ -1524,6 +1501,10 @@ packages: ci-info: 3.3.0 dev: false + /@types/json-bigint/1.0.1: + resolution: {integrity: sha512-zpchZLNsNuzJHi6v64UBoFWAvQlPhch7XAi36FkH6tL1bbbmimIF+cS7vwkzY4u5RaSWMoflQfu+TshMPPw8uw==} + dev: true + /@types/json-schema/7.0.10: resolution: {integrity: sha512-BLO9bBq59vW3fxCpD4o0N4U+DXsvwvIcl+jofw0frQo/GrBFC+/jRZj1E7kgp6dvTyNmA4y6JCV5Id/r3mNP5A==} dev: true @@ -2048,6 +2029,10 @@ packages: is-windows: 1.0.2 dev: false + /bignumber.js/9.1.0: + resolution: {integrity: sha512-4LwHK4nfDOraBCtst+wOWIHbu1vhvAPJK8g8nROd4iuc3PSEjWif/qwbkh8jwCJz6yDBvtU4KPynETgrfh7y3A==} + dev: false + /binary-extensions/2.2.0: resolution: {integrity: sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==} engines: {node: '>=8'} @@ -2085,12 +2070,6 @@ packages: balanced-match: 1.0.0 concat-map: 0.0.1 - /brace-expansion/2.0.1: - resolution: {integrity: sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==} - dependencies: - balanced-match: 1.0.0 - dev: true - /braces/3.0.2: resolution: {integrity: sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==} engines: {node: '>=8'} @@ -2582,8 +2561,8 @@ packages: supports-color: 7.2.0 dev: true - /debug/4.3.4: - resolution: {integrity: sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==} + /debug/4.3.3_supports-color@8.1.1: + resolution: {integrity: sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q==} engines: {node: '>=6.0'} peerDependencies: supports-color: '*' @@ -2592,8 +2571,10 @@ packages: optional: true dependencies: ms: 2.1.2 + supports-color: 8.1.1 + dev: true - /debug/4.3.4_supports-color@8.1.1: + /debug/4.3.4: resolution: {integrity: sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==} engines: {node: '>=6.0'} peerDependencies: @@ -2603,8 +2584,6 @@ packages: optional: true dependencies: ms: 2.1.2 - supports-color: 8.1.1 - dev: true /decamelize-keys/1.1.0: resolution: {integrity: sha1-0XGoeTMlKAfrPLYdwcFEXQeN8tk=} @@ -3070,23 +3049,14 @@ packages: create-hash: 1.2.0 create-hmac: 1.1.7 hash.js: 1.1.7 - keccak: 3.0.1 + keccak: 3.0.2 pbkdf2: 3.1.2 randombytes: 2.1.0 safe-buffer: 5.2.1 scrypt-js: 3.0.1 - secp256k1: 4.0.2 + secp256k1: 4.0.3 setimmediate: 1.0.5 - /ethereum-cryptography/1.1.2: - resolution: {integrity: sha512-XDSJlg4BD+hq9N2FjvotwUET9Tfxpxc3kWGE2AqUG5vcbeunnbImVk3cj6e/xT3phdW21mE8R5IugU4fspQDcQ==} - dependencies: - '@noble/hashes': 1.1.2 - '@noble/secp256k1': 1.6.3 - '@scure/bip32': 1.1.0 - '@scure/bip39': 1.1.0 - dev: true - /ethereumjs-abi/0.6.8: resolution: {integrity: sha512-Tx0r/iXI6r+lRsdvkFDlut0N08jWMnKRZ6Gkq+Nmw75lZe4e6o3EkSnkaBP5NF6+m5PTGAr9JP43N3LyeoglsA==} dependencies: @@ -3598,18 +3568,10 @@ packages: engines: {node: '>=6'} dev: false - /hardhat/2.10.1: - resolution: {integrity: sha512-0FN9TyCtn7Lt25SB2ei2G7nA2rZjP+RN6MvFOm+zYwherxLZNo6RbD8nDz88eCbhRapevmXqOiL2nM8INKsjmA==} - engines: {node: ^14.0.0 || ^16.0.0 || ^18.0.0} + /hardhat/2.9.2: + resolution: {integrity: sha512-elTcUK1EdFverWinybQ+DoJzsM6sgiHUYs0ZYNNXMfESty6ESHiFSwkfJsC88/q09vmIz6YVaMh73BYnYd+feQ==} + engines: {node: ^12.0.0 || ^14.0.0 || ^16.0.0} hasBin: true - peerDependencies: - ts-node: '*' - typescript: '*' - peerDependenciesMeta: - ts-node: - optional: true - typescript: - optional: true dependencies: '@ethereumjs/block': 3.6.3 '@ethereumjs/blockchain': 5.5.3 @@ -3632,7 +3594,7 @@ packages: debug: 4.3.4 enquirer: 2.3.6 env-paths: 2.2.1 - ethereum-cryptography: 1.1.2 + ethereum-cryptography: 0.1.3 ethereumjs-abi: 0.6.8 ethereumjs-util: 7.1.5 find-up: 2.1.0 @@ -3644,7 +3606,7 @@ packages: lodash: 4.17.21 merkle-patricia-tree: 4.2.4 mnemonist: 0.38.5 - mocha: 10.0.0 + mocha: 9.2.2 p-map: 4.0.0 qs: 6.10.3 raw-body: 2.5.1 @@ -3656,7 +3618,7 @@ packages: stacktrace-parser: 0.1.10 true-case-path: 2.2.1 tsort: 0.0.1 - undici: 5.8.0 + undici: 4.16.0 uuid: 8.3.2 ws: 7.4.6 transitivePeerDependencies: @@ -4069,6 +4031,12 @@ packages: resolution: {integrity: sha512-UVU9dibq2JcFWxQPA6KCqj5O42VOmAY3zQUfEKxU0KpTGXwNoCjkX1e13eHNvw/xPynt6pU0rZ1htjWTNTSXsg==} dev: false + /json-bigint/1.0.0: + resolution: {integrity: sha512-SiPv/8VpZuWbvLSMtTDU8hEfrZWg/mH/nV/b4o0CYbSxu1UIQPLdwKOCIyLQX+VIPO5vrLX3i8qtqFyhdPSUSQ==} + dependencies: + bignumber.js: 9.1.0 + dev: false + /json-parse-even-better-errors/2.3.1: resolution: {integrity: sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==} dev: false @@ -4139,6 +4107,7 @@ packages: dependencies: node-addon-api: 2.0.2 node-gyp-build: 4.4.0 + dev: false /keccak/3.0.2: resolution: {integrity: sha512-PyKKjkH53wDMLGrvmRGSNWgmSxZOUqbnXwKL9tmgbFYA1iAYqW21kfR7mZXV0MlESiefxQQE9X9fTa3X+2MPDQ==} @@ -4510,11 +4479,11 @@ packages: dependencies: brace-expansion: 1.1.11 - /minimatch/5.0.1: - resolution: {integrity: sha512-nLDxIFRyhDblz3qMuq+SoRZED4+miJ/G+tdDrjkkkRnjAsBexeGpgjLEQ0blJy7rHhR2b93rhQY4SvyWu9v03g==} + /minimatch/4.2.1: + resolution: {integrity: sha512-9Uq1ChtSZO+Mxa/CL1eGizn2vRn3MlLgzhT0Iz8zaY8NdvxvB0d5QdPFmCKf7JKA9Lerx5vRrnwO03jsSfGG9g==} engines: {node: '>=10'} dependencies: - brace-expansion: 2.0.1 + brace-expansion: 1.1.11 dev: true /minimist-options/4.1.0: @@ -4555,35 +4524,6 @@ packages: obliterator: 2.0.2 dev: true - /mocha/10.0.0: - resolution: {integrity: sha512-0Wl+elVUD43Y0BqPZBzZt8Tnkw9CMUdNYnUsTfOM1vuhJVZL+kiesFYsqwBkEEuEixaiPe5ZQdqDgX2jddhmoA==} - engines: {node: '>= 14.0.0'} - hasBin: true - dependencies: - '@ungap/promise-all-settled': 1.1.2 - ansi-colors: 4.1.1 - browser-stdout: 1.3.1 - chokidar: 3.5.3 - debug: 4.3.4_supports-color@8.1.1 - diff: 5.0.0 - escape-string-regexp: 4.0.0 - find-up: 5.0.0 - glob: 7.2.0 - he: 1.2.0 - js-yaml: 4.1.0 - log-symbols: 4.1.0 - minimatch: 5.0.1 - ms: 2.1.3 - nanoid: 3.3.3 - serialize-javascript: 6.0.0 - strip-json-comments: 3.1.1 - supports-color: 8.1.1 - workerpool: 6.2.1 - yargs: 16.2.0 - yargs-parser: 20.2.4 - yargs-unparser: 2.0.0 - dev: true - /mocha/7.2.0: resolution: {integrity: sha512-O9CIypScywTVpNaRrCAgoUnJgozpIofjKUYmJhiCIJMiuYnLI6otcb1/kpW9/n/tJODHGZ7i8aLQoDVsMtOKQQ==} engines: {node: '>= 8.10.0'} @@ -4647,6 +4587,37 @@ packages: yargs-unparser: 2.0.0 dev: true + /mocha/9.2.2: + resolution: {integrity: sha512-L6XC3EdwT6YrIk0yXpavvLkn8h+EU+Y5UcCHKECyMbdUIxyMuZj4bX4U9e1nvnvUUvQVsV2VHQr5zLdcUkhW/g==} + engines: {node: '>= 12.0.0'} + hasBin: true + dependencies: + '@ungap/promise-all-settled': 1.1.2 + ansi-colors: 4.1.1 + browser-stdout: 1.3.1 + chokidar: 3.5.3 + debug: 4.3.3_supports-color@8.1.1 + diff: 5.0.0 + escape-string-regexp: 4.0.0 + find-up: 5.0.0 + glob: 7.2.0 + growl: 1.10.5 + he: 1.2.0 + js-yaml: 4.1.0 + log-symbols: 4.1.0 + minimatch: 4.2.1 + ms: 2.1.3 + nanoid: 3.3.1 + serialize-javascript: 6.0.0 + strip-json-comments: 3.1.1 + supports-color: 8.1.1 + which: 2.0.2 + workerpool: 6.2.0 + yargs: 16.2.0 + yargs-parser: 20.2.4 + yargs-unparser: 2.0.0 + dev: true + /ms/2.0.0: resolution: {integrity: sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=} @@ -4666,8 +4637,8 @@ packages: hasBin: true dev: true - /nanoid/3.3.3: - resolution: {integrity: sha512-p1sjXuopFs0xg+fPASzQ28agW1oHD7xDsd9Xkf3T15H3c/cifrFHVwrh74PdoklAPi+i7MdRsE47vm2r6JoB+w==} + /nanoid/3.3.1: + resolution: {integrity: sha512-n6Vs/3KGyxPQd6uO0eH4Bv0ojGSUvuLlIHtC3Y0kEO23YRge8H9x1GCzLn28YX0H66pMkxuaeESFq4tKISKwdw==} engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} hasBin: true dev: true @@ -5421,15 +5392,6 @@ packages: /scrypt-js/3.0.1: resolution: {integrity: sha512-cdwTTnqPu0Hyvf5in5asVdZocVDTNRmR7XEcJuIzMjJeSHybHl7vpB66AzwTaIg6CLSbtjcxc8fqcySfnTkccA==} - /secp256k1/4.0.2: - resolution: {integrity: sha512-UDar4sKvWAksIlfX3xIaQReADn+WFnHvbVujpcbr+9Sf/69odMwy2MUsz5CKLQgX9nsIyrjuxL2imVyoNHa3fg==} - engines: {node: '>=10.0.0'} - requiresBuild: true - dependencies: - elliptic: 6.5.4 - node-addon-api: 2.0.2 - node-gyp-build: 4.4.0 - /secp256k1/4.0.3: resolution: {integrity: sha512-NLZVf+ROMxwtEj3Xa562qgv2BK5e2WNmXPiOdVIPLgs6lyTzMvBq0aWTYMI5XCP9jZMVKOcqZLw/Wc4vDkuxhA==} engines: {node: '>=10.0.0'} @@ -6120,8 +6082,8 @@ packages: resolution: {integrity: sha512-ekY1NhRzq0B08g4bGuX4wd2jZx5GnKz6mKSqFL4nqBlfyMGiG10gDFhDTMEfYmDL6Jy0FUIZp7wiRB+0BP7J2g==} dev: true - /undici/5.8.0: - resolution: {integrity: sha512-1F7Vtcez5w/LwH2G2tGnFIihuWUlc58YidwLiCv+jR2Z50x0tNXpRRw7eOIJ+GvqCqIkg9SB7NWAJ/T9TLfv8Q==} + /undici/4.16.0: + resolution: {integrity: sha512-tkZSECUYi+/T1i4u+4+lwZmQgLXd4BLGlrc7KZPcLIW7Jpq99+Xpc30ONv7nS6F5UNOxp/HBZSSL9MafUrvJbw==} engines: {node: '>=12.18'} dev: true @@ -6135,7 +6097,7 @@ packages: dev: true /unpipe/1.0.0: - resolution: {integrity: sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw=} + resolution: {integrity: sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==} engines: {node: '>= 0.8'} dev: true @@ -6298,8 +6260,8 @@ packages: resolution: {integrity: sha512-DSNyvOpFKrNusaaUwk+ej6cBj1bmhLcBfj80elGk+ZIo5JSkq+unB1dLKEOcNfJDZgjGICfhQ0Q5TbP0PvF4+Q==} dev: true - /workerpool/6.2.1: - resolution: {integrity: sha512-ILEIE97kDZvF9Wb9f6h5aXK4swSlKGUcOEGiIYb2OOu/IrDU9iwj0fD//SsA6E5ibwJxpEvhullJY4Sl4GcpAw==} + /workerpool/6.2.0: + resolution: {integrity: sha512-Rsk5qQHJ9eowMH28Jwhe8HEbmdYDX4lwoMWshiCXugjtHqMD9ZbiqSDLxcsfdqsETPzVUtX5s1Z5kStiIM6l4A==} dev: true /wrap-ansi/2.1.0: diff --git a/waffle-chai/package.json b/waffle-chai/package.json index 52cf68ce7..b1eb21643 100644 --- a/waffle-chai/package.json +++ b/waffle-chai/package.json @@ -43,15 +43,17 @@ }, "dependencies": { "@ethereum-waffle/provider": "workspace:*", - "debug": "^4.3.4" + "debug": "^4.3.4", + "json-bigint": "^1.0.0" }, "devDependencies": { - "ethers": "5.6.2", "@types/debug": "^4.1.7", + "@types/json-bigint": "^1.0.1", + "eslint": "^7.14.0", + "ethers": "5.6.2", "mocha": "^8.2.1", "rimraf": "^3.0.2", - "typescript": "^4.6.2", - "eslint": "^7.14.0" + "typescript": "^4.6.2" }, "peerDependencies": { "ethers": "*" diff --git a/waffle-chai/src/matchers/revertedWith.ts b/waffle-chai/src/matchers/revertedWith.ts index d6aabebbd..7e5b9ee95 100644 --- a/waffle-chai/src/matchers/revertedWith.ts +++ b/waffle-chai/src/matchers/revertedWith.ts @@ -1,5 +1,6 @@ import {decodeRevertString} from '@ethereum-waffle/provider'; import {callPromise} from '../call-promise'; +import JSONbig from 'json-bigint'; export function supportRevertedWith(Assertion: Chai.AssertionStatic) { Assertion.addMethod('revertedWith', function (this: any, revertReason: string | RegExp) { @@ -65,8 +66,15 @@ const decodeHardhatError = (error: any, context: any) => { const regexp = /VM Exception while processing transaction: reverted with custom error '([a-zA-Z0-9$_]+)\((.*)\)'/g; const matches = regexp.exec(errorString); if (matches && matches.length >= 1) { - // needs to be wrapped in list to be consistent with the emit matcher - context.args = [JSON.parse(`[${matches[2]}]`)]; + // Matches is in a format of string: "arg1, arg2, arg3, ..." + // So it only makes sense in an array: + const matchesList = `[${matches[2]}]`; + // Next, it needs to be wrapped in a list to be consistent with the emit matcher: + context.args = [ + // Additionally, we preserve numbers as strings, + // otherwise we face an overflow of bignumber. + JSONbig({storeAsString: true}).parse(matchesList) + ]; const errorName = matches[1]; context.txErrorName = errorName; return errorName; From 7fc30ab0bef2578b4165b039ee221db9ce541997 Mon Sep 17 00:00:00 2001 From: Przemyslaw Rzad Date: Mon, 31 Oct 2022 14:59:38 +0100 Subject: [PATCH 3/5] Create polite-fans-arrive.md --- .changeset/polite-fans-arrive.md | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 .changeset/polite-fans-arrive.md diff --git a/.changeset/polite-fans-arrive.md b/.changeset/polite-fans-arrive.md new file mode 100644 index 000000000..1a0542548 --- /dev/null +++ b/.changeset/polite-fans-arrive.md @@ -0,0 +1,6 @@ +--- +"@ethereum-waffle/chai": patch +"@ethereum-waffle/hardhat": patch +--- + +👔 revertedWith().withArgs no longer fails for uint values exceeding JavaScript's max int limit From 21bd135514b94b4bc8af4758841e82c73b0fbdd4 Mon Sep 17 00:00:00 2001 From: rzadp Date: Mon, 31 Oct 2022 15:01:20 +0100 Subject: [PATCH 4/5] Lockfile --- pnpm-lock.yaml | 294 ++++++++++++++++++++++++++++++++----------------- 1 file changed, 191 insertions(+), 103 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 9bdc3b9ee..1a17ca9b8 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -36,12 +36,12 @@ importers: '@types/rimraf': 3.0.0 '@types/sinon': 9.0.10 '@types/sinon-chai': 3.2.5 - '@typescript-eslint/eslint-plugin': 5.15.0_5xebumbela46o2i2wjf3q6khoq - '@typescript-eslint/parser': 5.15.0_c6rgizndxqcplp6oy5ayxlzjgm + '@typescript-eslint/eslint-plugin': 5.15.0_3idpik77dtp2p37mwvxiru2mra + '@typescript-eslint/parser': 5.15.0 chai: 4.2.0 chai-as-promised: 7.1.1_chai@4.2.0 chai-string: 1.5.0_chai@4.2.0 - eslint-plugin-import: 2.22.1_x76hk6kpvj4wcg2rfkjxf5ikka + eslint-plugin-import: 2.22.1_3idpik77dtp2p37mwvxiru2mra eslint-plugin-no-only-tests: 2.6.0 sinon: 9.2.4 sinon-chai: 3.5.0_chai@4.2.0+sinon@9.2.4 @@ -293,7 +293,7 @@ importers: dependencies: '@resolver-engine/imports': 0.3.3 '@resolver-engine/imports-fs': 0.3.3 - '@typechain/ethers-v5': 10.0.0_6dxoac5aapbom64r54k4um366m + '@typechain/ethers-v5': 10.0.0_75qa7wxcw3bgzsbibxcrrwvlx4 '@types/mkdirp': 0.5.2 '@types/node-fetch': 2.6.1 mkdirp: 0.5.5 @@ -332,8 +332,8 @@ importers: ethers: 5.6.2 mocha: 8.2.1 solc: 0.8.15 - ts-node: 9.1.1_typescript@4.6.2 - typechain: 8.0.0_typescript@4.6.2 + ts-node: 9.1.1 + typechain: 8.0.0 waffle-ens: specifiers: @@ -358,23 +358,23 @@ importers: waffle-hardhat: specifiers: '@ethereum-waffle/chai': workspace:* - '@nomiclabs/hardhat-ethers': 2.0.3 + '@nomiclabs/hardhat-ethers': 2.1.0 '@nomiclabs/hardhat-waffle': 2.0.3 '@types/node': ^17.0.41 eslint: ^7.14.0 ethereum-waffle: workspace:* ethers: 5.6.2 - hardhat: 2.9.2 + hardhat: 2.10.1 mocha: ^8.2.1 devDependencies: '@ethereum-waffle/chai': link:../waffle-chai - '@nomiclabs/hardhat-ethers': 2.0.3_ethers@5.6.2+hardhat@2.9.2 - '@nomiclabs/hardhat-waffle': 2.0.3_kadr5nyj4sdosrx7ad4g4lszyu + '@nomiclabs/hardhat-ethers': 2.1.0_mdh44cjfarfq76b44mvd54x3wq + '@nomiclabs/hardhat-waffle': 2.0.3_vzwoki3ygnfacj5msaazjpoonu '@types/node': 17.0.41 eslint: 7.18.0 ethereum-waffle: link:../waffle-cli ethers: 5.6.2 - hardhat: 2.9.2 + hardhat: 2.10.1 mocha: 8.2.1 waffle-mock-contract: @@ -1218,6 +1218,14 @@ packages: tweetnacl-util: 0.15.1 dev: true + /@noble/hashes/1.1.2: + resolution: {integrity: sha512-KYRCASVTv6aeUi1tsF8/vpyR7zpfs3FUzy2Jqm+MU+LmUKhQ0y2FpfwqkCcxSg2ua4GALJd8k2R76WxwZGbQpA==} + dev: true + + /@noble/secp256k1/1.6.3: + resolution: {integrity: sha512-T04e4iTurVy7I8Sw4+c5OSN9/RkPlo1uKxAomtxQNLq8j1uPAqnsqG1bqvY3Jv7c13gyr6dui0zmh/I3+f/JaQ==} + dev: true + /@nodelib/fs.scandir/2.1.4: resolution: {integrity: sha512-33g3pMJk3bg5nXbL/+CY6I2eJDzZAni49PfJnL5fghPTggPvBd/pFNSgJsdAgWptuFu7qq/ERvOYFlhvsLTCKA==} engines: {node: '>= 8'} @@ -1236,17 +1244,17 @@ packages: '@nodelib/fs.scandir': 2.1.4 fastq: 1.10.0 - /@nomiclabs/hardhat-ethers/2.0.3_ethers@5.6.2+hardhat@2.9.2: - resolution: {integrity: sha512-IJ0gBotVtO7YyLZyHNgbxzskUtFok+JkRlKPo8YELqj1ms9XL6Qm3vsfsGdZr22wnJeVEF5TQPotKuwQk21Dag==} + /@nomiclabs/hardhat-ethers/2.1.0_mdh44cjfarfq76b44mvd54x3wq: + resolution: {integrity: sha512-vlW90etB3675QWG7tMrHaDoTa7ymMB7irM4DAQ98g8zJoe9YqEggeDnbO6v5b+BLth/ty4vN6Ko/kaqRN1krHw==} peerDependencies: ethers: ^5.0.0 hardhat: ^2.0.0 dependencies: ethers: 5.6.2 - hardhat: 2.9.2 + hardhat: 2.10.1 dev: true - /@nomiclabs/hardhat-waffle/2.0.3_kadr5nyj4sdosrx7ad4g4lszyu: + /@nomiclabs/hardhat-waffle/2.0.3_vzwoki3ygnfacj5msaazjpoonu: resolution: {integrity: sha512-049PHSnI1CZq6+XTbrMbMv5NaL7cednTfPenx02k3cEh8wBMLa6ys++dBETJa6JjfwgA9nBhhHQ173LJv6k2Pg==} peerDependencies: '@nomiclabs/hardhat-ethers': ^2.0.0 @@ -1254,12 +1262,12 @@ packages: ethers: ^5.0.0 hardhat: ^2.0.0 dependencies: - '@nomiclabs/hardhat-ethers': 2.0.3_ethers@5.6.2+hardhat@2.9.2 + '@nomiclabs/hardhat-ethers': 2.1.0_mdh44cjfarfq76b44mvd54x3wq '@types/sinon-chai': 3.2.5 '@types/web3': 1.0.19 ethereum-waffle: link:waffle-cli ethers: 5.6.2 - hardhat: 2.9.2 + hardhat: 2.10.1 dev: true /@openzeppelin/contracts/3.0.1: @@ -1311,6 +1319,25 @@ packages: - supports-color dev: false + /@scure/base/1.1.1: + resolution: {integrity: sha512-ZxOhsSyxYwLJj3pLZCefNitxsj093tb2vq90mp2txoYeBqbcjDjqFhyM8eUjq/uFm6zJ+mUuqxlS2FkuSY1MTA==} + dev: true + + /@scure/bip32/1.1.0: + resolution: {integrity: sha512-ftTW3kKX54YXLCxH6BB7oEEoJfoE2pIgw7MINKAs5PsS6nqKPuKk1haTF/EuHmYqG330t5GSrdmtRuHaY1a62Q==} + dependencies: + '@noble/hashes': 1.1.2 + '@noble/secp256k1': 1.6.3 + '@scure/base': 1.1.1 + dev: true + + /@scure/bip39/1.1.0: + resolution: {integrity: sha512-pwrPOS16VeTKg98dYXQyIjJEcWfz7/1YJIwxUEPFfQPtc86Ym/1sVgQ2RLoD43AazMk2l/unK4ITySSpW2+82w==} + dependencies: + '@noble/hashes': 1.1.2 + '@scure/base': 1.1.1 + dev: true + /@sentry/core/5.30.0: resolution: {integrity: sha512-TmfrII8w1PQZSZgPpUESqjB+jC6MvZJZdLtE/0hZ+SrnKhW3x5WlYLvTXZpcWePYBku7rl2wn1RZu6uT0qCTeg==} engines: {node: '>=6'} @@ -1427,7 +1454,7 @@ packages: dev: false optional: true - /@typechain/ethers-v5/10.0.0_6dxoac5aapbom64r54k4um366m: + /@typechain/ethers-v5/10.0.0_75qa7wxcw3bgzsbibxcrrwvlx4: resolution: {integrity: sha512-Kot7fwAqnH96ZbI8xrRgj5Kpv9yCEdjo7mxRqrH7bYpEgijT5MmuOo8IVsdhOu7Uog4ONg7k/d5UdbAtTKUgsA==} peerDependencies: '@ethersproject/abi': ^5.0.0 @@ -1437,9 +1464,6 @@ packages: typechain: ^8.0.0 typescript: '>=4.3.0' dependencies: - '@ethersproject/abi': 5.6.1 - '@ethersproject/bytes': 5.6.1 - '@ethersproject/providers': 5.6.2 ethers: 5.6.2 lodash: 4.17.21 ts-essentials: 7.0.3_typescript@4.6.2 @@ -1632,7 +1656,7 @@ packages: '@types/underscore': 1.11.4 dev: true - /@typescript-eslint/eslint-plugin/5.15.0_5xebumbela46o2i2wjf3q6khoq: + /@typescript-eslint/eslint-plugin/5.15.0_3idpik77dtp2p37mwvxiru2mra: resolution: {integrity: sha512-u6Db5JfF0Esn3tiAKELvoU5TpXVSkOpZ78cEGn/wXtT2RVqs2vkt4ge6N8cRCyw7YVKhmmLDbwI2pg92mlv7cA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: @@ -1643,23 +1667,21 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/parser': 5.15.0_c6rgizndxqcplp6oy5ayxlzjgm + '@typescript-eslint/parser': 5.15.0 '@typescript-eslint/scope-manager': 5.15.0 - '@typescript-eslint/type-utils': 5.15.0_c6rgizndxqcplp6oy5ayxlzjgm - '@typescript-eslint/utils': 5.15.0_c6rgizndxqcplp6oy5ayxlzjgm + '@typescript-eslint/type-utils': 5.15.0 + '@typescript-eslint/utils': 5.15.0 debug: 4.3.4 - eslint: 7.18.0 functional-red-black-tree: 1.0.1 ignore: 5.1.8 regexpp: 3.2.0 semver: 7.3.5 - tsutils: 3.21.0_typescript@4.6.2 - typescript: 4.6.2 + tsutils: 3.21.0 transitivePeerDependencies: - supports-color dev: true - /@typescript-eslint/parser/5.15.0_c6rgizndxqcplp6oy5ayxlzjgm: + /@typescript-eslint/parser/5.15.0: resolution: {integrity: sha512-NGAYP/+RDM2sVfmKiKOCgJYPstAO40vPAgACoWPO/+yoYKSgAXIFaBKsV8P0Cc7fwKgvj27SjRNX4L7f4/jCKQ==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: @@ -1671,10 +1693,8 @@ packages: dependencies: '@typescript-eslint/scope-manager': 5.15.0 '@typescript-eslint/types': 5.15.0 - '@typescript-eslint/typescript-estree': 5.15.0_typescript@4.6.2 + '@typescript-eslint/typescript-estree': 5.15.0 debug: 4.3.4 - eslint: 7.18.0 - typescript: 4.6.2 transitivePeerDependencies: - supports-color dev: true @@ -1687,7 +1707,7 @@ packages: '@typescript-eslint/visitor-keys': 5.15.0 dev: true - /@typescript-eslint/type-utils/5.15.0_c6rgizndxqcplp6oy5ayxlzjgm: + /@typescript-eslint/type-utils/5.15.0: resolution: {integrity: sha512-KGeDoEQ7gHieLydujGEFLyLofipe9PIzfvA/41urz4hv+xVxPEbmMQonKSynZ0Ks2xDhJQ4VYjB3DnRiywvKDA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: @@ -1697,11 +1717,9 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/utils': 5.15.0_c6rgizndxqcplp6oy5ayxlzjgm + '@typescript-eslint/utils': 5.15.0 debug: 4.3.4 - eslint: 7.18.0 - tsutils: 3.21.0_typescript@4.6.2 - typescript: 4.6.2 + tsutils: 3.21.0 transitivePeerDependencies: - supports-color dev: true @@ -1711,7 +1729,7 @@ packages: engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dev: true - /@typescript-eslint/typescript-estree/5.15.0_typescript@4.6.2: + /@typescript-eslint/typescript-estree/5.15.0: resolution: {integrity: sha512-Hb0e3dGc35b75xLzixM3cSbG1sSbrTBQDfIScqdyvrfJZVEi4XWAT+UL/HMxEdrJNB8Yk28SKxPLtAhfCbBInA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: @@ -1726,13 +1744,12 @@ packages: globby: 11.1.0 is-glob: 4.0.3 semver: 7.3.5 - tsutils: 3.21.0_typescript@4.6.2 - typescript: 4.6.2 + tsutils: 3.21.0 transitivePeerDependencies: - supports-color dev: true - /@typescript-eslint/utils/5.15.0_c6rgizndxqcplp6oy5ayxlzjgm: + /@typescript-eslint/utils/5.15.0: resolution: {integrity: sha512-081rWu2IPKOgTOhHUk/QfxuFog8m4wxW43sXNOMSCdh578tGJ1PAaWPsj42LOa7pguh173tNlMigsbrHvh/mtA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: @@ -1741,10 +1758,9 @@ packages: '@types/json-schema': 7.0.10 '@typescript-eslint/scope-manager': 5.15.0 '@typescript-eslint/types': 5.15.0 - '@typescript-eslint/typescript-estree': 5.15.0_typescript@4.6.2 - eslint: 7.18.0 + '@typescript-eslint/typescript-estree': 5.15.0 eslint-scope: 5.1.1 - eslint-utils: 3.0.0_eslint@7.18.0 + eslint-utils: 3.0.0 transitivePeerDependencies: - supports-color - typescript @@ -2070,6 +2086,12 @@ packages: balanced-match: 1.0.0 concat-map: 0.0.1 + /brace-expansion/2.0.1: + resolution: {integrity: sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==} + dependencies: + balanced-match: 1.0.0 + dev: true + /braces/3.0.2: resolution: {integrity: sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==} engines: {node: '>=8'} @@ -2147,6 +2169,13 @@ packages: node-gyp-build: 4.4.0 optional: true + /busboy/1.6.0: + resolution: {integrity: sha512-8SFQbg/0hQ9xy3UNTB0YEnsNBbWfhf7RtnzpL7TkBiTBRfrQ9Fxcnz7VJsleJpyp6rVLvXiuORqjlHi5q+PYuA==} + engines: {node: '>=10.16.0'} + dependencies: + streamsearch: 1.1.0 + dev: true + /bytes/3.1.2: resolution: {integrity: sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==} engines: {node: '>= 0.8'} @@ -2561,8 +2590,8 @@ packages: supports-color: 7.2.0 dev: true - /debug/4.3.3_supports-color@8.1.1: - resolution: {integrity: sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q==} + /debug/4.3.4: + resolution: {integrity: sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==} engines: {node: '>=6.0'} peerDependencies: supports-color: '*' @@ -2571,10 +2600,8 @@ packages: optional: true dependencies: ms: 2.1.2 - supports-color: 8.1.1 - dev: true - /debug/4.3.4: + /debug/4.3.4_supports-color@8.1.1: resolution: {integrity: sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==} engines: {node: '>=6.0'} peerDependencies: @@ -2584,6 +2611,8 @@ packages: optional: true dependencies: ms: 2.1.2 + supports-color: 8.1.1 + dev: true /decamelize-keys/1.1.0: resolution: {integrity: sha1-0XGoeTMlKAfrPLYdwcFEXQeN8tk=} @@ -2844,7 +2873,7 @@ packages: eslint-import-resolver-webpack: optional: true dependencies: - '@typescript-eslint/parser': 5.15.0_c6rgizndxqcplp6oy5ayxlzjgm + '@typescript-eslint/parser': 5.15.0 debug: 2.6.9 eslint-import-resolver-node: 0.3.4 pkg-dir: 2.0.0 @@ -2852,7 +2881,7 @@ packages: - supports-color dev: true - /eslint-plugin-import/2.22.1_x76hk6kpvj4wcg2rfkjxf5ikka: + /eslint-plugin-import/2.22.1_3idpik77dtp2p37mwvxiru2mra: resolution: {integrity: sha512-8K7JjINHOpH64ozkAhpT3sd+FswIZTfMZTjdx052pnWrgRCVfp8op9tbjpAk3DdUeI/Ba4C8OjdC0r90erHEOw==} engines: {node: '>=4'} peerDependencies: @@ -2862,13 +2891,12 @@ packages: '@typescript-eslint/parser': optional: true dependencies: - '@typescript-eslint/parser': 5.15.0_c6rgizndxqcplp6oy5ayxlzjgm + '@typescript-eslint/parser': 5.15.0 array-includes: 3.1.2 array.prototype.flat: 1.2.4 contains-path: 0.1.0 debug: 2.6.9 doctrine: 1.5.0 - eslint: 7.18.0 eslint-import-resolver-node: 0.3.4 eslint-module-utils: 2.6.0_i6ewxqunfsnauarvu3h4jo73fi has: 1.0.3 @@ -2903,13 +2931,12 @@ packages: eslint-visitor-keys: 1.3.0 dev: true - /eslint-utils/3.0.0_eslint@7.18.0: + /eslint-utils/3.0.0: resolution: {integrity: sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA==} engines: {node: ^10.0.0 || ^12.0.0 || >= 14.0.0} peerDependencies: eslint: '>=5' dependencies: - eslint: 7.18.0 eslint-visitor-keys: 2.0.0 dev: true @@ -3057,6 +3084,15 @@ packages: secp256k1: 4.0.3 setimmediate: 1.0.5 + /ethereum-cryptography/1.1.2: + resolution: {integrity: sha512-XDSJlg4BD+hq9N2FjvotwUET9Tfxpxc3kWGE2AqUG5vcbeunnbImVk3cj6e/xT3phdW21mE8R5IugU4fspQDcQ==} + dependencies: + '@noble/hashes': 1.1.2 + '@noble/secp256k1': 1.6.3 + '@scure/bip32': 1.1.0 + '@scure/bip39': 1.1.0 + dev: true + /ethereumjs-abi/0.6.8: resolution: {integrity: sha512-Tx0r/iXI6r+lRsdvkFDlut0N08jWMnKRZ6Gkq+Nmw75lZe4e6o3EkSnkaBP5NF6+m5PTGAr9JP43N3LyeoglsA==} dependencies: @@ -3568,10 +3604,18 @@ packages: engines: {node: '>=6'} dev: false - /hardhat/2.9.2: - resolution: {integrity: sha512-elTcUK1EdFverWinybQ+DoJzsM6sgiHUYs0ZYNNXMfESty6ESHiFSwkfJsC88/q09vmIz6YVaMh73BYnYd+feQ==} - engines: {node: ^12.0.0 || ^14.0.0 || ^16.0.0} + /hardhat/2.10.1: + resolution: {integrity: sha512-0FN9TyCtn7Lt25SB2ei2G7nA2rZjP+RN6MvFOm+zYwherxLZNo6RbD8nDz88eCbhRapevmXqOiL2nM8INKsjmA==} + engines: {node: ^14.0.0 || ^16.0.0 || ^18.0.0} hasBin: true + peerDependencies: + ts-node: '*' + typescript: '*' + peerDependenciesMeta: + ts-node: + optional: true + typescript: + optional: true dependencies: '@ethereumjs/block': 3.6.3 '@ethereumjs/blockchain': 5.5.3 @@ -3594,7 +3638,7 @@ packages: debug: 4.3.4 enquirer: 2.3.6 env-paths: 2.2.1 - ethereum-cryptography: 0.1.3 + ethereum-cryptography: 1.1.2 ethereumjs-abi: 0.6.8 ethereumjs-util: 7.1.5 find-up: 2.1.0 @@ -3606,7 +3650,7 @@ packages: lodash: 4.17.21 merkle-patricia-tree: 4.2.4 mnemonist: 0.38.5 - mocha: 9.2.2 + mocha: 10.1.0 p-map: 4.0.0 qs: 6.10.3 raw-body: 2.5.1 @@ -3618,7 +3662,7 @@ packages: stacktrace-parser: 0.1.10 true-case-path: 2.2.1 tsort: 0.0.1 - undici: 4.16.0 + undici: 5.12.0 uuid: 8.3.2 ws: 7.4.6 transitivePeerDependencies: @@ -4479,11 +4523,11 @@ packages: dependencies: brace-expansion: 1.1.11 - /minimatch/4.2.1: - resolution: {integrity: sha512-9Uq1ChtSZO+Mxa/CL1eGizn2vRn3MlLgzhT0Iz8zaY8NdvxvB0d5QdPFmCKf7JKA9Lerx5vRrnwO03jsSfGG9g==} + /minimatch/5.0.1: + resolution: {integrity: sha512-nLDxIFRyhDblz3qMuq+SoRZED4+miJ/G+tdDrjkkkRnjAsBexeGpgjLEQ0blJy7rHhR2b93rhQY4SvyWu9v03g==} engines: {node: '>=10'} dependencies: - brace-expansion: 1.1.11 + brace-expansion: 2.0.1 dev: true /minimist-options/4.1.0: @@ -4524,6 +4568,34 @@ packages: obliterator: 2.0.2 dev: true + /mocha/10.1.0: + resolution: {integrity: sha512-vUF7IYxEoN7XhQpFLxQAEMtE4W91acW4B6En9l97MwE9stL1A9gusXfoHZCLVHDUJ/7V5+lbCM6yMqzo5vNymg==} + engines: {node: '>= 14.0.0'} + hasBin: true + dependencies: + ansi-colors: 4.1.1 + browser-stdout: 1.3.1 + chokidar: 3.5.3 + debug: 4.3.4_supports-color@8.1.1 + diff: 5.0.0 + escape-string-regexp: 4.0.0 + find-up: 5.0.0 + glob: 7.2.0 + he: 1.2.0 + js-yaml: 4.1.0 + log-symbols: 4.1.0 + minimatch: 5.0.1 + ms: 2.1.3 + nanoid: 3.3.3 + serialize-javascript: 6.0.0 + strip-json-comments: 3.1.1 + supports-color: 8.1.1 + workerpool: 6.2.1 + yargs: 16.2.0 + yargs-parser: 20.2.4 + yargs-unparser: 2.0.0 + dev: true + /mocha/7.2.0: resolution: {integrity: sha512-O9CIypScywTVpNaRrCAgoUnJgozpIofjKUYmJhiCIJMiuYnLI6otcb1/kpW9/n/tJODHGZ7i8aLQoDVsMtOKQQ==} engines: {node: '>= 8.10.0'} @@ -4587,37 +4659,6 @@ packages: yargs-unparser: 2.0.0 dev: true - /mocha/9.2.2: - resolution: {integrity: sha512-L6XC3EdwT6YrIk0yXpavvLkn8h+EU+Y5UcCHKECyMbdUIxyMuZj4bX4U9e1nvnvUUvQVsV2VHQr5zLdcUkhW/g==} - engines: {node: '>= 12.0.0'} - hasBin: true - dependencies: - '@ungap/promise-all-settled': 1.1.2 - ansi-colors: 4.1.1 - browser-stdout: 1.3.1 - chokidar: 3.5.3 - debug: 4.3.3_supports-color@8.1.1 - diff: 5.0.0 - escape-string-regexp: 4.0.0 - find-up: 5.0.0 - glob: 7.2.0 - growl: 1.10.5 - he: 1.2.0 - js-yaml: 4.1.0 - log-symbols: 4.1.0 - minimatch: 4.2.1 - ms: 2.1.3 - nanoid: 3.3.1 - serialize-javascript: 6.0.0 - strip-json-comments: 3.1.1 - supports-color: 8.1.1 - which: 2.0.2 - workerpool: 6.2.0 - yargs: 16.2.0 - yargs-parser: 20.2.4 - yargs-unparser: 2.0.0 - dev: true - /ms/2.0.0: resolution: {integrity: sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=} @@ -4637,8 +4678,8 @@ packages: hasBin: true dev: true - /nanoid/3.3.1: - resolution: {integrity: sha512-n6Vs/3KGyxPQd6uO0eH4Bv0ojGSUvuLlIHtC3Y0kEO23YRge8H9x1GCzLn28YX0H66pMkxuaeESFq4tKISKwdw==} + /nanoid/3.3.3: + resolution: {integrity: sha512-p1sjXuopFs0xg+fPASzQ28agW1oHD7xDsd9Xkf3T15H3c/cifrFHVwrh74PdoklAPi+i7MdRsE47vm2r6JoB+w==} engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} hasBin: true dev: true @@ -5667,6 +5708,11 @@ packages: mixme: 0.5.4 dev: false + /streamsearch/1.1.0: + resolution: {integrity: sha512-Mcc5wHehp9aXz1ax6bZUyY5afg9u2rv5cqQI3mRrYkGC8rW2hM02jWuwjtL++LS5qinSyhj2QfLyNsuc+VsExg==} + engines: {node: '>=10.0.0'} + dev: true + /strict-uri-encode/1.1.0: resolution: {integrity: sha1-J5siXfHVgrH1TmWt3UNS4Y+qBxM=} engines: {node: '>=0.10.0'} @@ -5904,6 +5950,12 @@ packages: command-line-usage: 6.1.1 string-format: 2.0.0 + /ts-essentials/7.0.3: + resolution: {integrity: sha512-8+gr5+lqO3G84KdiTSMRLtuyJ+nTBVRKuCrK4lidMPdVeEp0uqC875uE5NMcaA7YYMN7XsNiFQuMvasF8HT/xQ==} + peerDependencies: + typescript: '>=3.7.0' + dev: true + /ts-essentials/7.0.3_typescript@4.6.2: resolution: {integrity: sha512-8+gr5+lqO3G84KdiTSMRLtuyJ+nTBVRKuCrK4lidMPdVeEp0uqC875uE5NMcaA7YYMN7XsNiFQuMvasF8HT/xQ==} peerDependencies: @@ -5926,6 +5978,21 @@ packages: yn: 3.1.1 dev: true + /ts-node/9.1.1: + resolution: {integrity: sha512-hPlt7ZACERQGf03M253ytLY3dHbGNGrAq9qIHWUY9XHYl1z7wYngSr3OQ5xmui8o2AaxsONxIzjafLUiWBo1Fg==} + engines: {node: '>=10.0.0'} + hasBin: true + peerDependencies: + typescript: '>=2.7' + dependencies: + arg: 4.1.3 + create-require: 1.1.1 + diff: 4.0.2 + make-error: 1.3.6 + source-map-support: 0.5.19 + yn: 3.1.1 + dev: true + /ts-node/9.1.1_typescript@4.6.2: resolution: {integrity: sha512-hPlt7ZACERQGf03M253ytLY3dHbGNGrAq9qIHWUY9XHYl1z7wYngSr3OQ5xmui8o2AaxsONxIzjafLUiWBo1Fg==} engines: {node: '>=10.0.0'} @@ -5959,14 +6026,13 @@ packages: resolution: {integrity: sha1-4igPXoF/i/QnVlf9D5rr1E9aJ4Y=} dev: true - /tsutils/3.21.0_typescript@4.6.2: + /tsutils/3.21.0: resolution: {integrity: sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==} engines: {node: '>= 6'} peerDependencies: typescript: '>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta' dependencies: tslib: 1.14.1 - typescript: 4.6.2 dev: true /tty-table/2.8.13: @@ -6036,6 +6102,26 @@ packages: resolution: {integrity: sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==} engines: {node: '>=8'} + /typechain/8.0.0: + resolution: {integrity: sha512-rqDfDYc9voVAhmfVfAwzg3VYFvhvs5ck1X9T/iWkX745Cul4t+V/smjnyqrbDzWDbzD93xfld1epg7Y/uFAesQ==} + hasBin: true + peerDependencies: + typescript: '>=4.3.0' + dependencies: + '@types/prettier': 2.3.0 + debug: 4.3.4 + fs-extra: 7.0.1 + glob: 7.1.7 + js-sha3: 0.8.0 + lodash: 4.17.21 + mkdirp: 1.0.4 + prettier: 2.3.1 + ts-command-line-args: 2.2.1 + ts-essentials: 7.0.3 + transitivePeerDependencies: + - supports-color + dev: true + /typechain/8.0.0_typescript@4.6.2: resolution: {integrity: sha512-rqDfDYc9voVAhmfVfAwzg3VYFvhvs5ck1X9T/iWkX745Cul4t+V/smjnyqrbDzWDbzD93xfld1epg7Y/uFAesQ==} hasBin: true @@ -6082,9 +6168,11 @@ packages: resolution: {integrity: sha512-ekY1NhRzq0B08g4bGuX4wd2jZx5GnKz6mKSqFL4nqBlfyMGiG10gDFhDTMEfYmDL6Jy0FUIZp7wiRB+0BP7J2g==} dev: true - /undici/4.16.0: - resolution: {integrity: sha512-tkZSECUYi+/T1i4u+4+lwZmQgLXd4BLGlrc7KZPcLIW7Jpq99+Xpc30ONv7nS6F5UNOxp/HBZSSL9MafUrvJbw==} + /undici/5.12.0: + resolution: {integrity: sha512-zMLamCG62PGjd9HHMpo05bSLvvwWOZgGeiWlN/vlqu3+lRo3elxktVGEyLMX+IO7c2eflLjcW74AlkhEZm15mg==} engines: {node: '>=12.18'} + dependencies: + busboy: 1.6.0 dev: true /universalify/0.1.2: @@ -6260,8 +6348,8 @@ packages: resolution: {integrity: sha512-DSNyvOpFKrNusaaUwk+ej6cBj1bmhLcBfj80elGk+ZIo5JSkq+unB1dLKEOcNfJDZgjGICfhQ0Q5TbP0PvF4+Q==} dev: true - /workerpool/6.2.0: - resolution: {integrity: sha512-Rsk5qQHJ9eowMH28Jwhe8HEbmdYDX4lwoMWshiCXugjtHqMD9ZbiqSDLxcsfdqsETPzVUtX5s1Z5kStiIM6l4A==} + /workerpool/6.2.1: + resolution: {integrity: sha512-ILEIE97kDZvF9Wb9f6h5aXK4swSlKGUcOEGiIYb2OOu/IrDU9iwj0fD//SsA6E5ibwJxpEvhullJY4Sl4GcpAw==} dev: true /wrap-ansi/2.1.0: From b6f259be48ce12ba3c3690b6278d1f308fcbf3c1 Mon Sep 17 00:00:00 2001 From: rzadp Date: Mon, 31 Oct 2022 15:13:59 +0100 Subject: [PATCH 5/5] Add a negative test --- waffle-hardhat/test/reverted.test.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/waffle-hardhat/test/reverted.test.ts b/waffle-hardhat/test/reverted.test.ts index ca0ab1b08..7c33315ac 100644 --- a/waffle-hardhat/test/reverted.test.ts +++ b/waffle-hardhat/test/reverted.test.ts @@ -79,6 +79,18 @@ describe('INTEGRATION: Matchers: revertedWith', () => { ); }); + it('With args and big number failure', async () => { + const matchers = await deploy(); + await expect(expect(matchers.doRevertWithBigNumber()) + .to.be.revertedWith('One') + .withArgs( + BigNumber.from('9007199254740991000001'), // different + 'message', + '0x00cfbbaf7ddb3a1476767101c12a0162e241fbad2a0162e2410cfbbaf7162123' + ) + ).to.be.eventually.rejectedWith('Expected "9007199254740991000000" to be equal 9007199254740991000001'); + }); + it('With args failure', async () => { const matchers = await deploy(); await expect(expect(matchers.doRevertWithOne())