Przeglądaj źródła

Update chai matchers (#4899)

Co-authored-by: ernestognw <ernestognw@gmail.com>
Renan Souza 1 rok temu
rodzic
commit
141c947921
4 zmienionych plików z 9 dodań i 9 usunięć
  1. 3 3
      contracts/utils/Panic.sol
  2. 4 4
      package-lock.json
  3. 1 1
      package.json
  4. 1 1
      test/utils/Panic.test.js

+ 3 - 3
contracts/utils/Panic.sol

@@ -47,9 +47,9 @@ library Panic {
     function panic(uint256 code) internal pure {
         /// @solidity memory-safe-assembly
         assembly {
-            mstore(0x00, shl(0xe0, 0x4e487b71))
-            mstore(0x04, code)
-            revert(0x00, 0x24)
+            mstore(0x00, 0x4e487b71)
+            mstore(0x20, code)
+            revert(0x1c, 0x24)
         }
     }
 }

+ 4 - 4
package-lock.json

@@ -13,7 +13,7 @@
         "@changesets/cli": "^2.26.0",
         "@changesets/pre": "^2.0.0",
         "@changesets/read": "^0.6.0",
-        "@nomicfoundation/hardhat-chai-matchers": "^2.0.3",
+        "@nomicfoundation/hardhat-chai-matchers": "^2.0.6",
         "@nomicfoundation/hardhat-ethers": "^3.0.4",
         "@nomicfoundation/hardhat-network-helpers": "^1.0.3",
         "@openzeppelin/docs-utils": "^0.1.5",
@@ -2080,9 +2080,9 @@
       }
     },
     "node_modules/@nomicfoundation/hardhat-chai-matchers": {
-      "version": "2.0.3",
-      "resolved": "https://registry.npmjs.org/@nomicfoundation/hardhat-chai-matchers/-/hardhat-chai-matchers-2.0.3.tgz",
-      "integrity": "sha512-A40s7EAK4Acr8UP1Yudgi9GGD9Cca/K3LHt3DzmRIje14lBfHtg9atGQ7qK56vdPcTwKmeaGn30FzxMUfPGEMw==",
+      "version": "2.0.6",
+      "resolved": "https://registry.npmjs.org/@nomicfoundation/hardhat-chai-matchers/-/hardhat-chai-matchers-2.0.6.tgz",
+      "integrity": "sha512-Te1Uyo9oJcTCF0Jy9dztaLpshmlpjLf2yPtWXlXuLjMt3RRSmJLm/+rKVTW6gfadAEs12U/it6D0ZRnnRGiICQ==",
       "dev": true,
       "dependencies": {
         "@types/chai-as-promised": "^7.1.3",

+ 1 - 1
package.json

@@ -53,7 +53,7 @@
     "@changesets/cli": "^2.26.0",
     "@changesets/pre": "^2.0.0",
     "@changesets/read": "^0.6.0",
-    "@nomicfoundation/hardhat-chai-matchers": "^2.0.3",
+    "@nomicfoundation/hardhat-chai-matchers": "^2.0.6",
     "@nomicfoundation/hardhat-ethers": "^3.0.4",
     "@nomicfoundation/hardhat-network-helpers": "^1.0.3",
     "@openzeppelin/docs-utils": "^0.1.5",

+ 1 - 1
test/utils/Panic.test.js

@@ -15,7 +15,7 @@ describe('Panic', function () {
   for (const [name, code] of Object.entries({
     GENERIC: 0x0,
     ASSERT: PANIC_CODES.ASSERTION_ERROR,
-    UNDER_OVERFLOW: PANIC_CODES.ARITHMETIC_UNDER_OR_OVERFLOW,
+    UNDER_OVERFLOW: PANIC_CODES.ARITHMETIC_OVERFLOW,
     DIVISION_BY_ZERO: PANIC_CODES.DIVISION_BY_ZERO,
     ENUM_CONVERSION_ERROR: PANIC_CODES.ENUM_CONVERSION_OUT_OF_BOUNDS,
     STORAGE_ENCODING_ERROR: PANIC_CODES.INCORRECTLY_ENCODED_STORAGE_BYTE_ARRAY,