diff --git a/jest.config.js b/jest.config.js index 95e1c1b..60e61be 100644 --- a/jest.config.js +++ b/jest.config.js @@ -6,4 +6,5 @@ module.exports = { moduleNameMapper: { axios: "axios/dist/node/axios.cjs", // Temporary workaround: Force Jest to import the CommonJS Axios build }, + transformIgnorePatterns: ["node_modules/(?!(@govtechsg/document-store-ethers-v5)/)"], }; diff --git a/package-lock.json b/package-lock.json index 5e0db51..948603b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,9 +10,8 @@ "license": "Apache-2.0", "dependencies": { "@govtechsg/dnsprove": "^2.6.2", - "@govtechsg/document-store": "^2.2.3", + "@govtechsg/document-store-ethers-v5": "^4.0.0", "@govtechsg/open-attestation": "^6.9.0", - "@govtechsg/token-registry": "^4.1.7", "axios": "^1.6.2", "debug": "^4.3.1", "did-resolver": "^4.1.0", @@ -1928,10 +1927,10 @@ "runtypes": "^6.3.0" } }, - "node_modules/@govtechsg/document-store": { - "version": "2.6.1", - "resolved": "https://registry.npmjs.org/@govtechsg/document-store/-/document-store-2.6.1.tgz", - "integrity": "sha512-Jr8dGyr8wBXMOSbUURoYfmz9jKiK2ntbjEYyI06pze6jzyiYLZXcepKVyjNk9PC/mLIlDCZgQWmre7ixBZWWjQ==" + "node_modules/@govtechsg/document-store-ethers-v5": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@govtechsg/document-store-ethers-v5/-/document-store-ethers-v5-4.0.0.tgz", + "integrity": "sha512-kw7MXwLneBJzWjIqo7juhRhAN9+g9g3qoH0XyKOsVluUHPApOIy/X4ZtaSyEngPq18oWkZEHcU7kOR/z4teXgQ==" }, "node_modules/@govtechsg/jsonld": { "version": "0.1.1", @@ -1966,17 +1965,6 @@ "validator": "^13.7.0" } }, - "node_modules/@govtechsg/token-registry": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/@govtechsg/token-registry/-/token-registry-4.3.0.tgz", - "integrity": "sha512-KW73mZAz2EoC0gjt9xnu1MJYBuE/ohP18HWXPv/ZRTweaJa7QHrq8PQ9u97UMjvdFz14k7sPAC9ZlNRNaSst3A==", - "dependencies": { - "@typechain/ethers-v5": "~10.0.0" - }, - "peerDependencies": { - "ethers": ">=5.0.8" - } - }, "node_modules/@humanwhocodes/config-array": { "version": "0.5.0", "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.5.0.tgz", @@ -3404,23 +3392,6 @@ "node": ">= 6" } }, - "node_modules/@typechain/ethers-v5": { - "version": "10.0.0", - "resolved": "https://registry.npmjs.org/@typechain/ethers-v5/-/ethers-v5-10.0.0.tgz", - "integrity": "sha512-Kot7fwAqnH96ZbI8xrRgj5Kpv9yCEdjo7mxRqrH7bYpEgijT5MmuOo8IVsdhOu7Uog4ONg7k/d5UdbAtTKUgsA==", - "dependencies": { - "lodash": "^4.17.15", - "ts-essentials": "^7.0.1" - }, - "peerDependencies": { - "@ethersproject/abi": "^5.0.0", - "@ethersproject/bytes": "^5.0.0", - "@ethersproject/providers": "^5.0.0", - "ethers": "^5.1.3", - "typechain": "^8.0.0", - "typescript": ">=4.3.0" - } - }, "node_modules/@types/babel__core": { "version": "7.20.5", "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.20.5.tgz", @@ -3578,7 +3549,8 @@ "node_modules/@types/prettier": { "version": "2.7.3", "resolved": "https://registry.npmjs.org/@types/prettier/-/prettier-2.7.3.tgz", - "integrity": "sha512-+68kP9yzs4LMp7VNh8gdzMSPZFL44MLGqiHWvttYJe+6qnuVr4Ek9wSBQoveqY/r+LwjCcU29kNVkidwim+kYA==" + "integrity": "sha512-+68kP9yzs4LMp7VNh8gdzMSPZFL44MLGqiHWvttYJe+6qnuVr4Ek9wSBQoveqY/r+LwjCcU29kNVkidwim+kYA==", + "dev": true }, "node_modules/@types/set-cookie-parser": { "version": "2.4.7", @@ -3920,6 +3892,7 @@ "version": "4.3.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, "dependencies": { "color-convert": "^2.0.1" }, @@ -3988,15 +3961,6 @@ "node": ">=0.10.0" } }, - "node_modules/array-back": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/array-back/-/array-back-3.1.0.tgz", - "integrity": "sha512-TkuxA4UCOvxuDK6NZYXCalszEzj+TLszyASooky+i742l9TqsOdYCMJJupxRic61hwquNtppB3hgcuq9SVSH1Q==", - "peer": true, - "engines": { - "node": ">=6" - } - }, "node_modules/array-buffer-byte-length": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/array-buffer-byte-length/-/array-buffer-byte-length-1.0.0.tgz", @@ -4324,7 +4288,8 @@ "node_modules/balanced-match": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", - "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true }, "node_modules/base": { "version": "0.11.2", @@ -4436,6 +4401,7 @@ "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, "dependencies": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -4679,6 +4645,7 @@ "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, "dependencies": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" @@ -4957,6 +4924,7 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, "dependencies": { "color-name": "~1.1.4" }, @@ -4967,7 +4935,8 @@ "node_modules/color-name": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true }, "node_modules/combined-stream": { "version": "1.0.8", @@ -4980,125 +4949,6 @@ "node": ">= 0.8" } }, - "node_modules/command-line-args": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/command-line-args/-/command-line-args-5.2.1.tgz", - "integrity": "sha512-H4UfQhZyakIjC74I9d34fGYDwk3XpSr17QhEd0Q3I9Xq1CETHo4Hcuo87WyWHpAF1aSLjLRf5lD9ZGX2qStUvg==", - "peer": true, - "dependencies": { - "array-back": "^3.1.0", - "find-replace": "^3.0.0", - "lodash.camelcase": "^4.3.0", - "typical": "^4.0.0" - }, - "engines": { - "node": ">=4.0.0" - } - }, - "node_modules/command-line-usage": { - "version": "6.1.3", - "resolved": "https://registry.npmjs.org/command-line-usage/-/command-line-usage-6.1.3.tgz", - "integrity": "sha512-sH5ZSPr+7UStsloltmDh7Ce5fb8XPlHyoPzTpyyMuYCtervL65+ubVZ6Q61cFtFl62UyJlc8/JwERRbAFPUqgw==", - "peer": true, - "dependencies": { - "array-back": "^4.0.2", - "chalk": "^2.4.2", - "table-layout": "^1.0.2", - "typical": "^5.2.0" - }, - "engines": { - "node": ">=8.0.0" - } - }, - "node_modules/command-line-usage/node_modules/ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "peer": true, - "dependencies": { - "color-convert": "^1.9.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/command-line-usage/node_modules/array-back": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/array-back/-/array-back-4.0.2.tgz", - "integrity": "sha512-NbdMezxqf94cnNfWLL7V/im0Ub+Anbb0IoZhvzie8+4HJ4nMQuzHuy49FkGYCJK2yAloZ3meiB6AVMClbrI1vg==", - "peer": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/command-line-usage/node_modules/chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "peer": true, - "dependencies": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/command-line-usage/node_modules/color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "peer": true, - "dependencies": { - "color-name": "1.1.3" - } - }, - "node_modules/command-line-usage/node_modules/color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", - "peer": true - }, - "node_modules/command-line-usage/node_modules/escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", - "peer": true, - "engines": { - "node": ">=0.8.0" - } - }, - "node_modules/command-line-usage/node_modules/has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", - "peer": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/command-line-usage/node_modules/supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "peer": true, - "dependencies": { - "has-flag": "^3.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/command-line-usage/node_modules/typical": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/typical/-/typical-5.2.0.tgz", - "integrity": "sha512-dvdQgNDNJo+8B2uBQoqdb11eUCE1JQXhvjC/CZtgvZseVd5TYMXnq0+vuUemXbd/Se29cTaUuPX3YIc2xgbvIg==", - "peer": true, - "engines": { - "node": ">=8" - } - }, "node_modules/commitizen": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/commitizen/-/commitizen-4.3.0.tgz", @@ -5330,7 +5180,8 @@ "node_modules/concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==" + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", + "dev": true }, "node_modules/config-chain": { "version": "1.1.13", @@ -5754,6 +5605,7 @@ "version": "0.6.0", "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==", + "dev": true, "engines": { "node": ">=4.0.0" } @@ -7175,18 +7027,6 @@ "merge": "^2.1.1" } }, - "node_modules/find-replace": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/find-replace/-/find-replace-3.0.0.tgz", - "integrity": "sha512-6Tb2myMioCAgv5kfvP5/PkZZ/ntTpVK39fHY7WkWBgvbeE+VHd/tZuZ4mrC+bxh4cfOZeYKVPaJIZtZXV7GNCQ==", - "peer": true, - "dependencies": { - "array-back": "^3.0.1" - }, - "engines": { - "node": ">=4.0.0" - } - }, "node_modules/find-root": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/find-root/-/find-root-1.1.0.tgz", @@ -7280,9 +7120,9 @@ "dev": true }, "node_modules/follow-redirects": { - "version": "1.15.3", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.3.tgz", - "integrity": "sha512-1VzOtuEM8pC9SFU1E+8KfTjZyMztRsgEfwQl44z8A25uy13jSzTj6dyK2Df52iV0vgHCfBwLhDWevLn95w5v6Q==", + "version": "1.15.5", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.5.tgz", + "integrity": "sha512-vSFWUON1B+yAw1VN4xMfxgn5fTUiaOzAJCKBwIIgT/+7CuGy9+r+5gITvP62j3RmaD5Ph65UaERdOSRGUzZtgw==", "funding": [ { "type": "individual", @@ -7368,7 +7208,8 @@ "node_modules/fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==" + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", + "dev": true }, "node_modules/fsevents": { "version": "2.3.3", @@ -7805,7 +7646,8 @@ "node_modules/graceful-fs": { "version": "4.2.11", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", - "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==" + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", + "dev": true }, "node_modules/graphql": { "version": "15.8.0", @@ -7866,6 +7708,7 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, "engines": { "node": ">=8" } @@ -8265,6 +8108,7 @@ "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", + "dev": true, "dependencies": { "once": "^1.3.0", "wrappy": "1" @@ -10537,7 +10381,8 @@ "node_modules/lodash.camelcase": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz", - "integrity": "sha512-TwuEnCnxbc3rAvhf/LbG7tJUDzhqXyFnv3dtzLOPgCG/hODL7WFnsbwktkD7yUV0RrreP/l1PALq/YSg6VvjlA==" + "integrity": "sha512-TwuEnCnxbc3rAvhf/LbG7tJUDzhqXyFnv3dtzLOPgCG/hODL7WFnsbwktkD7yUV0RrreP/l1PALq/YSg6VvjlA==", + "dev": true }, "node_modules/lodash.capitalize": { "version": "4.2.1", @@ -10911,6 +10756,7 @@ "version": "3.1.2", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, "dependencies": { "brace-expansion": "^1.1.7" }, @@ -10958,6 +10804,7 @@ "version": "1.0.4", "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", + "dev": true, "bin": { "mkdirp": "bin/cmd.js" }, @@ -14504,6 +14351,7 @@ "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "dev": true, "dependencies": { "wrappy": "1" } @@ -14818,6 +14666,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", + "dev": true, "engines": { "node": ">=0.10.0" } @@ -15048,6 +14897,7 @@ "version": "2.8.8", "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.8.tgz", "integrity": "sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==", + "dev": true, "bin": { "prettier": "bin-prettier.js" }, @@ -15391,15 +15241,6 @@ "esprima": "~4.0.0" } }, - "node_modules/reduce-flatten": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/reduce-flatten/-/reduce-flatten-2.0.0.tgz", - "integrity": "sha512-EJ4UNY/U1t2P/2k6oqotuX2Cc3T6nxJwsM0N0asT7dhrtH1ltUxDn4NalSYmPE2rCkVpcf/X6R0wDwcFpzhd4w==", - "peer": true, - "engines": { - "node": ">=6" - } - }, "node_modules/regex-not": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz", @@ -17120,12 +16961,6 @@ "safe-buffer": "~5.1.0" } }, - "node_modules/string-format": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/string-format/-/string-format-2.0.0.tgz", - "integrity": "sha512-bbEs3scLeYNXLecRRuk6uJxdXUSj6le/8rNPHChIJTn2V79aXVTR1EH2OH5zLKKoz0V02fOUKZZcw01pLUShZA==", - "peer": true - }, "node_modules/string-length": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/string-length/-/string-length-4.0.2.tgz", @@ -17285,6 +17120,7 @@ "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, "dependencies": { "has-flag": "^4.0.0" }, @@ -17339,39 +17175,6 @@ "node": ">=10.0.0" } }, - "node_modules/table-layout": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/table-layout/-/table-layout-1.0.2.tgz", - "integrity": "sha512-qd/R7n5rQTRFi+Zf2sk5XVVd9UQl6ZkduPFC3S7WEGJAmetDTjY3qPN50eSKzwuzEyQKy5TN2TiZdkIjos2L6A==", - "peer": true, - "dependencies": { - "array-back": "^4.0.1", - "deep-extend": "~0.6.0", - "typical": "^5.2.0", - "wordwrapjs": "^4.0.0" - }, - "engines": { - "node": ">=8.0.0" - } - }, - "node_modules/table-layout/node_modules/array-back": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/array-back/-/array-back-4.0.2.tgz", - "integrity": "sha512-NbdMezxqf94cnNfWLL7V/im0Ub+Anbb0IoZhvzie8+4HJ4nMQuzHuy49FkGYCJK2yAloZ3meiB6AVMClbrI1vg==", - "peer": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/table-layout/node_modules/typical": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/typical/-/typical-5.2.0.tgz", - "integrity": "sha512-dvdQgNDNJo+8B2uBQoqdb11eUCE1JQXhvjC/CZtgvZseVd5TYMXnq0+vuUemXbd/Se29cTaUuPX3YIc2xgbvIg==", - "peer": true, - "engines": { - "node": ">=8" - } - }, "node_modules/table/node_modules/is-fullwidth-code-point": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", @@ -17701,29 +17504,6 @@ "node": ">=8" } }, - "node_modules/ts-command-line-args": { - "version": "2.5.1", - "resolved": "https://registry.npmjs.org/ts-command-line-args/-/ts-command-line-args-2.5.1.tgz", - "integrity": "sha512-H69ZwTw3rFHb5WYpQya40YAX2/w7Ut75uUECbgBIsLmM+BNuYnxsltfyyLMxy6sEeKxgijLTnQtLd0nKd6+IYw==", - "peer": true, - "dependencies": { - "chalk": "^4.1.0", - "command-line-args": "^5.1.1", - "command-line-usage": "^6.1.0", - "string-format": "^2.0.0" - }, - "bin": { - "write-markdown": "dist/write-markdown.js" - } - }, - "node_modules/ts-essentials": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/ts-essentials/-/ts-essentials-7.0.3.tgz", - "integrity": "sha512-8+gr5+lqO3G84KdiTSMRLtuyJ+nTBVRKuCrK4lidMPdVeEp0uqC875uE5NMcaA7YYMN7XsNiFQuMvasF8HT/xQ==", - "peerDependencies": { - "typescript": ">=3.7.0" - } - }, "node_modules/ts-jest": { "version": "26.5.6", "resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-26.5.6.tgz", @@ -17839,82 +17619,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/typechain": { - "version": "8.3.2", - "resolved": "https://registry.npmjs.org/typechain/-/typechain-8.3.2.tgz", - "integrity": "sha512-x/sQYr5w9K7yv3es7jo4KTX05CLxOf7TRWwoHlrjRh8H82G64g+k7VuWPJlgMo6qrjfCulOdfBjiaDtmhFYD/Q==", - "peer": true, - "dependencies": { - "@types/prettier": "^2.1.1", - "debug": "^4.3.1", - "fs-extra": "^7.0.0", - "glob": "7.1.7", - "js-sha3": "^0.8.0", - "lodash": "^4.17.15", - "mkdirp": "^1.0.4", - "prettier": "^2.3.1", - "ts-command-line-args": "^2.2.0", - "ts-essentials": "^7.0.1" - }, - "bin": { - "typechain": "dist/cli/cli.js" - }, - "peerDependencies": { - "typescript": ">=4.3.0" - } - }, - "node_modules/typechain/node_modules/fs-extra": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-7.0.1.tgz", - "integrity": "sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw==", - "peer": true, - "dependencies": { - "graceful-fs": "^4.1.2", - "jsonfile": "^4.0.0", - "universalify": "^0.1.0" - }, - "engines": { - "node": ">=6 <7 || >=8" - } - }, - "node_modules/typechain/node_modules/glob": { - "version": "7.1.7", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.7.tgz", - "integrity": "sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ==", - "peer": true, - "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - }, - "engines": { - "node": "*" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/typechain/node_modules/jsonfile": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", - "integrity": "sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg==", - "peer": true, - "optionalDependencies": { - "graceful-fs": "^4.1.6" - } - }, - "node_modules/typechain/node_modules/universalify": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", - "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", - "peer": true, - "engines": { - "node": ">= 4.0.0" - } - }, "node_modules/typed-array-buffer": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/typed-array-buffer/-/typed-array-buffer-1.0.0.tgz", @@ -17993,6 +17697,7 @@ "version": "4.9.5", "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz", "integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==", + "dev": true, "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" @@ -18001,15 +17706,6 @@ "node": ">=4.2.0" } }, - "node_modules/typical": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/typical/-/typical-4.0.0.tgz", - "integrity": "sha512-VAH4IvQ7BDFYglMd7BPRDfLgxZZX4O4TFcRDA6EN5X7erNJJq+McIEp8np9aVtxrCJ6qx4GTYVfOWNjcqwZgRw==", - "peer": true, - "engines": { - "node": ">=8" - } - }, "node_modules/uglify-js": { "version": "3.17.4", "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.17.4.tgz", @@ -18474,28 +18170,6 @@ "integrity": "sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q==", "dev": true }, - "node_modules/wordwrapjs": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/wordwrapjs/-/wordwrapjs-4.0.1.tgz", - "integrity": "sha512-kKlNACbvHrkpIw6oPeYDSmdCTu2hdMHoyXLTcUKala++lx5Y+wjJ/e474Jqv5abnVmwxw08DiTuHmw69lJGksA==", - "peer": true, - "dependencies": { - "reduce-flatten": "^2.0.0", - "typical": "^5.2.0" - }, - "engines": { - "node": ">=8.0.0" - } - }, - "node_modules/wordwrapjs/node_modules/typical": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/typical/-/typical-5.2.0.tgz", - "integrity": "sha512-dvdQgNDNJo+8B2uBQoqdb11eUCE1JQXhvjC/CZtgvZseVd5TYMXnq0+vuUemXbd/Se29cTaUuPX3YIc2xgbvIg==", - "peer": true, - "engines": { - "node": ">=8" - } - }, "node_modules/wrap-ansi": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", @@ -18539,7 +18213,8 @@ "node_modules/wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==" + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", + "dev": true }, "node_modules/write-file-atomic": { "version": "3.0.3", diff --git a/package.json b/package.json index 68f4415..7b00b1b 100644 --- a/package.json +++ b/package.json @@ -26,9 +26,8 @@ "license": "Apache-2.0", "dependencies": { "@govtechsg/dnsprove": "^2.6.2", - "@govtechsg/document-store": "^2.2.3", + "@govtechsg/document-store-ethers-v5": "^4.0.0", "@govtechsg/open-attestation": "^6.9.0", - "@govtechsg/token-registry": "^4.1.7", "axios": "^1.6.2", "debug": "^4.3.1", "did-resolver": "^4.1.0", diff --git a/src/common/utils.test.ts b/src/common/utils.test.ts index 5782df6..c8692e9 100644 --- a/src/common/utils.test.ts +++ b/src/common/utils.test.ts @@ -18,9 +18,11 @@ import { getOpenAttestationHashFragment, invalidArgument, isDocumentStoreAddressOrTokenRegistryAddressInvalid, + isBatchableDocumentStore, serverError, unhandledError, } from "./utils"; +import { Contract } from "ethers"; const fragments: AllVerificationFragment[] = [ { @@ -767,3 +769,30 @@ describe("unhandledError", () => { expect(unhandledError([verificationFragment])).toStrictEqual(false); }); }); + +describe("isBatchableDocumentStore", () => { + let mockDocumentStore: Contract; + + beforeEach(() => { + mockDocumentStore = { + supportsInterface: jest.fn(), + } as unknown as Contract; + }); + + it("should call supportsInterface with the correct id", async () => { + mockDocumentStore.supportsInterface.mockResolvedValue(true); + + const res = await isBatchableDocumentStore(mockDocumentStore); + + expect(mockDocumentStore.supportsInterface).toHaveBeenCalledWith("0xdcfd0745"); + expect(res).toBe(true); + }); + + it("should return false when supportsInterface has error", async () => { + mockDocumentStore.supportsInterface.mockRejectedValue(new Error("Call Exception")); + + const res = await isBatchableDocumentStore(mockDocumentStore); + + expect(res).toBe(false); + }); +}); diff --git a/src/common/utils.ts b/src/common/utils.ts index f5462f5..c6e9c7f 100644 --- a/src/common/utils.ts +++ b/src/common/utils.ts @@ -1,4 +1,4 @@ -import { providers } from "ethers"; +import { Contract, providers } from "ethers"; import { INFURA_API_KEY } from "../config"; import { ProviderDetails, @@ -233,3 +233,12 @@ export const unhandledError = (fragments: VerificationFragment[]): boolean => { tokenRegistryMintedFragment?.reason?.code === OpenAttestationEthereumDocumentStoreStatusCode.ETHERS_UNHANDLED_ERROR ); }; + +export const isBatchableDocumentStore = async (contract: Contract): Promise => { + try { + // Interface for DocumentStoreBatchable + return (await contract.supportsInterface("0xdcfd0745")) as boolean; + } catch { + return false; + } +}; diff --git a/src/verifiers/documentStatus/documentStore/ethereumDocumentStoreStatus.ts b/src/verifiers/documentStatus/documentStore/ethereumDocumentStoreStatus.ts index 9273ba9..092be54 100644 --- a/src/verifiers/documentStatus/documentStore/ethereumDocumentStoreStatus.ts +++ b/src/verifiers/documentStatus/documentStore/ethereumDocumentStoreStatus.ts @@ -1,6 +1,6 @@ import { getData, utils, v2, v3, WrappedDocument } from "@govtechsg/open-attestation"; +import { DocumentStore__factory } from "@govtechsg/document-store-ethers-v5"; import { providers } from "ethers"; -import { DocumentStoreFactory } from "@govtechsg/document-store"; import { VerificationFragmentType, Verifier, VerifierOptions } from "../../../types/core"; import { OpenAttestationEthereumDocumentStoreStatusCode, Reason } from "../../../types/error"; import { CodedError } from "../../../common/error"; @@ -14,6 +14,7 @@ import { ValidDocumentStoreDataV3, ValidDocumentStoreIssuanceStatusArray, } from "./ethereumDocumentStoreStatus.type"; +import { isBatchableDocumentStore } from "../../../common/utils"; const name = "OpenAttestationEthereumDocumentStoreStatus"; const type: VerificationFragmentType = "DOCUMENT_STATUS"; @@ -37,15 +38,27 @@ export const getIssuersDocumentStores = (document: WrappedDocument => { + const documentStoreContract = DocumentStore__factory.connect(documentStore, provider); + try { - const documentStoreContract = await DocumentStoreFactory.connect(documentStore, provider); - const issued = await documentStoreContract.isIssued(merkleRoot); + const isBatchable = await isBatchableDocumentStore(documentStoreContract); + + let issued: boolean; + if (isBatchable) { + issued = await documentStoreContract["isIssued(bytes32,bytes32,bytes32[])"](merkleRoot, targetHash, proofs); + } else { + issued = await documentStoreContract["isIssued(bytes32)"](merkleRoot); + } return issued ? { issued: true, @@ -115,7 +128,7 @@ const verifyV2 = async ( const proofs = document.signature.proof || []; const issuanceStatuses = await Promise.all( documentStores.map((documentStore) => - isIssuedOnDocumentStore({ documentStore, merkleRoot, provider: options.provider }) + isIssuedOnDocumentStore({ documentStore, merkleRoot, targetHash, proofs, provider: options.provider }) ) ); const notIssued = issuanceStatuses.find(InvalidDocumentStoreIssuanceStatus.guard); @@ -189,7 +202,13 @@ const verifyV3 = async ( const merkleRoot = `0x${merkleRootRaw}`; const { value: documentStore } = document.openAttestationMetadata.proof; - const issuance = await isIssuedOnDocumentStore({ documentStore, merkleRoot, provider: options.provider }); + const issuance = await isIssuedOnDocumentStore({ + documentStore, + merkleRoot, + targetHash, + proofs, + provider: options.provider, + }); const revocation = await isRevokedOnDocumentStore({ documentStore, merkleRoot, diff --git a/src/verifiers/documentStatus/tokenRegistry/ethereumTokenRegistryStatus.ts b/src/verifiers/documentStatus/tokenRegistry/ethereumTokenRegistryStatus.ts index 396edb5..aa84a09 100644 --- a/src/verifiers/documentStatus/tokenRegistry/ethereumTokenRegistryStatus.ts +++ b/src/verifiers/documentStatus/tokenRegistry/ethereumTokenRegistryStatus.ts @@ -1,5 +1,5 @@ import { getData, utils, v2, v3, WrappedDocument } from "@govtechsg/open-attestation"; -import { TradeTrustToken__factory } from "@govtechsg/token-registry/contracts"; +import { TransferableDocumentStore__factory } from "@govtechsg/document-store-ethers-v5"; import { constants, errors, providers } from "ethers"; import { VerificationFragmentType, Verifier } from "../../../types/core"; import { OpenAttestationEthereumTokenRegistryStatusCode } from "../../../types/error"; @@ -71,7 +71,10 @@ const getMerkleRoot = ( const isNonExistentToken = (error: any) => { const message: string | undefined = error.message; - if (!message) return false; + if (!message) { + // ERC721NonexistentToken error + return error.data && error.data.slice(0, 10) === "0x7e273289"; + } return message.includes("owner query for nonexistent token"); }; const isMissingTokenRegistry = (error: any) => { @@ -116,8 +119,10 @@ export const isTokenMintedOnRegistry = async ({ provider: providers.Provider; }): Promise => { try { - const tokenRegistryContract = await TradeTrustToken__factory.connect(tokenRegistry, provider); - const minted = await tokenRegistryContract.ownerOf(merkleRoot).then((owner) => !(owner === constants.AddressZero)); + const tokenRegistryContract = TransferableDocumentStore__factory.connect(tokenRegistry, provider); + const minted = await tokenRegistryContract + .ownerOf(merkleRoot) + .then((owner: string) => !(owner === constants.AddressZero)); return minted ? { minted, address: tokenRegistry } : { diff --git a/src/verifiers/documentStatus/utils.ts b/src/verifiers/documentStatus/utils.ts index 837f025..cb2b6eb 100644 --- a/src/verifiers/documentStatus/utils.ts +++ b/src/verifiers/documentStatus/utils.ts @@ -1,7 +1,6 @@ import { utils } from "@govtechsg/open-attestation"; -import { DocumentStore } from "@govtechsg/document-store"; -import { errors, providers } from "ethers"; -import { DocumentStoreFactory } from "@govtechsg/document-store"; +import { DocumentStore__factory } from "@govtechsg/document-store-ethers-v5"; +import { Contract, errors, providers } from "ethers"; import { Hash } from "../../types/core"; import { OpenAttestationEthereumDocumentStoreStatusCode, @@ -11,6 +10,7 @@ import { CodedError } from "../../common/error"; import { OcspResponderRevocationReason, RevocationStatus } from "./revocation.types"; import axios from "axios"; import { ValidOcspResponse, ValidOcspResponseRevoked } from "./didSigned/didSignedDocumentStatus.type"; +import { isBatchableDocumentStore } from "../../common/utils"; export const getIntermediateHashes = (targetHash: Hash, proofs: Hash[] = []) => { const hashes = [`0x${targetHash}`]; @@ -60,12 +60,12 @@ export const decodeError = (error: any) => { /** * Given a list of hashes, check against one smart contract if any of the hash has been revoked * */ -export const isAnyHashRevoked = async (smartContract: DocumentStore, intermediateHashes: Hash[]) => { +export const isAnyHashRevoked = async (smartContract: Contract, intermediateHashes: Hash[]) => { const revokedStatusDeferred = intermediateHashes.map((hash) => - smartContract.isRevoked(hash).then((status) => (status ? hash : undefined)) + smartContract["isRevoked(bytes32)"](hash).then((status: boolean) => status) ); const revokedStatuses = await Promise.all(revokedStatusDeferred); - return revokedStatuses.find((hash) => hash); + return !revokedStatuses.every((status) => !status); }; export const isRevokedOnDocumentStore = async ({ @@ -79,14 +79,24 @@ export const isRevokedOnDocumentStore = async ({ merkleRoot: string; provider: providers.Provider; targetHash: Hash; - proofs?: Hash[]; + proofs: Hash[]; }): Promise => { try { - const documentStoreContract = await DocumentStoreFactory.connect(documentStore, provider); - const intermediateHashes = getIntermediateHashes(targetHash, proofs); - const revokedHash = await isAnyHashRevoked(documentStoreContract, intermediateHashes); + const documentStoreContract = DocumentStore__factory.connect(documentStore, provider); + const isBatchable = await isBatchableDocumentStore(documentStoreContract); + let revoked: boolean; + if (isBatchable) { + revoked = (await documentStoreContract["isRevoked(bytes32,bytes32,bytes32[])"]( + merkleRoot, + targetHash, + proofs + )) as boolean; + } else { + const intermediateHashes = getIntermediateHashes(targetHash, proofs); + revoked = await isAnyHashRevoked(documentStoreContract, intermediateHashes); + } - return revokedHash + return revoked ? { revoked: true, address: documentStore, diff --git a/src/verify.v2.integration.errors.test.ts b/src/verify.v2.integration.errors.test.ts index 323f956..ce11102 100644 --- a/src/verify.v2.integration.errors.test.ts +++ b/src/verify.v2.integration.errors.test.ts @@ -56,12 +56,12 @@ describe("Handling HTTP response errors", () => { "type": "DOCUMENT_STATUS", }, Object { - "data": [Error: missing revert data in call exception; Transaction reverted without a reason string [ See: https://links.ethers.org/v5-errors-CALL_EXCEPTION ] (data="0x", transaction={"to":"0x007d40224F6562461633ccFBaffd359EbB2FC9Ba","data":"0x163aa6311a040999254caaf7a33cba67ec6a9b862da1dacf8a0d1e3bb76347060fc615d6","accessList":null}, error={"reason":"failed response","code":"SERVER_ERROR","requestBody":"{\\"method\\":\\"eth_call\\",\\"params\\":[{\\"to\\":\\"0x007d40224f6562461633ccfbaffd359ebb2fc9ba\\",\\"data\\":\\"0x163aa6311a040999254caaf7a33cba67ec6a9b862da1dacf8a0d1e3bb76347060fc615d6\\"},\\"latest\\"],\\"id\\":42,\\"jsonrpc\\":\\"2.0\\"}","requestMethod":"POST","url":"https://mainnet.infura.io/v3/bb46da3f80e040e8ab73c0a9ff365d18"}, code=CALL_EXCEPTION, version=providers/5.7.2)], + "data": [Error: missing revert data in call exception; Transaction reverted without a reason string [ See: https://links.ethers.org/v5-errors-CALL_EXCEPTION ] (data="0x", transaction={"to":"0x007d40224F6562461633ccFBaffd359EbB2FC9Ba","data":"0x163aa6311a040999254caaf7a33cba67ec6a9b862da1dacf8a0d1e3bb76347060fc615d6","accessList":null}, error={"reason":"failed response","code":"SERVER_ERROR","requestBody":"{\\"method\\":\\"eth_call\\",\\"params\\":[{\\"to\\":\\"0x007d40224f6562461633ccfbaffd359ebb2fc9ba\\",\\"data\\":\\"0x163aa6311a040999254caaf7a33cba67ec6a9b862da1dacf8a0d1e3bb76347060fc615d6\\"},\\"latest\\"],\\"id\\":43,\\"jsonrpc\\":\\"2.0\\"}","requestMethod":"POST","url":"https://mainnet.infura.io/v3/bb46da3f80e040e8ab73c0a9ff365d18"}, code=CALL_EXCEPTION, version=providers/5.7.2)], "name": "OpenAttestationEthereumDocumentStoreStatus", "reason": Object { "code": 0, "codeString": "UNEXPECTED_ERROR", - "message": "missing revert data in call exception; Transaction reverted without a reason string [ See: https://links.ethers.org/v5-errors-CALL_EXCEPTION ] (data=\\"0x\\", transaction={\\"to\\":\\"0x007d40224F6562461633ccFBaffd359EbB2FC9Ba\\",\\"data\\":\\"0x163aa6311a040999254caaf7a33cba67ec6a9b862da1dacf8a0d1e3bb76347060fc615d6\\",\\"accessList\\":null}, error={\\"reason\\":\\"failed response\\",\\"code\\":\\"SERVER_ERROR\\",\\"requestBody\\":\\"{\\\\\\"method\\\\\\":\\\\\\"eth_call\\\\\\",\\\\\\"params\\\\\\":[{\\\\\\"to\\\\\\":\\\\\\"0x007d40224f6562461633ccfbaffd359ebb2fc9ba\\\\\\",\\\\\\"data\\\\\\":\\\\\\"0x163aa6311a040999254caaf7a33cba67ec6a9b862da1dacf8a0d1e3bb76347060fc615d6\\\\\\"},\\\\\\"latest\\\\\\"],\\\\\\"id\\\\\\":42,\\\\\\"jsonrpc\\\\\\":\\\\\\"2.0\\\\\\"}\\",\\"requestMethod\\":\\"POST\\",\\"url\\":\\"https://mainnet.infura.io/v3/bb46da3f80e040e8ab73c0a9ff365d18\\"}, code=CALL_EXCEPTION, version=providers/5.7.2)", + "message": "missing revert data in call exception; Transaction reverted without a reason string [ See: https://links.ethers.org/v5-errors-CALL_EXCEPTION ] (data=\\"0x\\", transaction={\\"to\\":\\"0x007d40224F6562461633ccFBaffd359EbB2FC9Ba\\",\\"data\\":\\"0x163aa6311a040999254caaf7a33cba67ec6a9b862da1dacf8a0d1e3bb76347060fc615d6\\",\\"accessList\\":null}, error={\\"reason\\":\\"failed response\\",\\"code\\":\\"SERVER_ERROR\\",\\"requestBody\\":\\"{\\\\\\"method\\\\\\":\\\\\\"eth_call\\\\\\",\\\\\\"params\\\\\\":[{\\\\\\"to\\\\\\":\\\\\\"0x007d40224f6562461633ccfbaffd359ebb2fc9ba\\\\\\",\\\\\\"data\\\\\\":\\\\\\"0x163aa6311a040999254caaf7a33cba67ec6a9b862da1dacf8a0d1e3bb76347060fc615d6\\\\\\"},\\\\\\"latest\\\\\\"],\\\\\\"id\\\\\\":43,\\\\\\"jsonrpc\\\\\\":\\\\\\"2.0\\\\\\"}\\",\\"requestMethod\\":\\"POST\\",\\"url\\":\\"https://mainnet.infura.io/v3/bb46da3f80e040e8ab73c0a9ff365d18\\"}, code=CALL_EXCEPTION, version=providers/5.7.2)", }, "status": "ERROR", "type": "DOCUMENT_STATUS", @@ -133,12 +133,12 @@ describe("Handling HTTP response errors", () => { "type": "DOCUMENT_STATUS", }, Object { - "data": [Error: missing revert data in call exception; Transaction reverted without a reason string [ See: https://links.ethers.org/v5-errors-CALL_EXCEPTION ] (data="0x", transaction={"to":"0x007d40224F6562461633ccFBaffd359EbB2FC9Ba","data":"0x163aa6311a040999254caaf7a33cba67ec6a9b862da1dacf8a0d1e3bb76347060fc615d6","accessList":null}, error={"reason":"bad response","code":"SERVER_ERROR","status":502,"headers":{"x-powered-by":"msw","content-type":"application/json"},"body":"{\\"jsonrpc\\":\\"2.0\\",\\"result\\":\\"0xs0meR4nd0mErr0r\\",\\"id\\":2}","requestBody":"{\\"method\\":\\"eth_call\\",\\"params\\":[{\\"to\\":\\"0x007d40224f6562461633ccfbaffd359ebb2fc9ba\\",\\"data\\":\\"0x163aa6311a040999254caaf7a33cba67ec6a9b862da1dacf8a0d1e3bb76347060fc615d6\\"},\\"latest\\"],\\"id\\":42,\\"jsonrpc\\":\\"2.0\\"}","requestMethod":"POST","url":"https://mainnet.infura.io/v3/bb46da3f80e040e8ab73c0a9ff365d18"}, code=CALL_EXCEPTION, version=providers/5.7.2)], + "data": [Error: missing revert data in call exception; Transaction reverted without a reason string [ See: https://links.ethers.org/v5-errors-CALL_EXCEPTION ] (data="0x", transaction={"to":"0x007d40224F6562461633ccFBaffd359EbB2FC9Ba","data":"0x163aa6311a040999254caaf7a33cba67ec6a9b862da1dacf8a0d1e3bb76347060fc615d6","accessList":null}, error={"reason":"bad response","code":"SERVER_ERROR","status":502,"headers":{"x-powered-by":"msw","content-type":"application/json"},"body":"{\\"jsonrpc\\":\\"2.0\\",\\"result\\":\\"0xs0meR4nd0mErr0r\\",\\"id\\":2}","requestBody":"{\\"method\\":\\"eth_call\\",\\"params\\":[{\\"to\\":\\"0x007d40224f6562461633ccfbaffd359ebb2fc9ba\\",\\"data\\":\\"0x163aa6311a040999254caaf7a33cba67ec6a9b862da1dacf8a0d1e3bb76347060fc615d6\\"},\\"latest\\"],\\"id\\":43,\\"jsonrpc\\":\\"2.0\\"}","requestMethod":"POST","url":"https://mainnet.infura.io/v3/bb46da3f80e040e8ab73c0a9ff365d18"}, code=CALL_EXCEPTION, version=providers/5.7.2)], "name": "OpenAttestationEthereumDocumentStoreStatus", "reason": Object { "code": 0, "codeString": "UNEXPECTED_ERROR", - "message": "missing revert data in call exception; Transaction reverted without a reason string [ See: https://links.ethers.org/v5-errors-CALL_EXCEPTION ] (data=\\"0x\\", transaction={\\"to\\":\\"0x007d40224F6562461633ccFBaffd359EbB2FC9Ba\\",\\"data\\":\\"0x163aa6311a040999254caaf7a33cba67ec6a9b862da1dacf8a0d1e3bb76347060fc615d6\\",\\"accessList\\":null}, error={\\"reason\\":\\"bad response\\",\\"code\\":\\"SERVER_ERROR\\",\\"status\\":502,\\"headers\\":{\\"x-powered-by\\":\\"msw\\",\\"content-type\\":\\"application/json\\"},\\"body\\":\\"{\\\\\\"jsonrpc\\\\\\":\\\\\\"2.0\\\\\\",\\\\\\"result\\\\\\":\\\\\\"0xs0meR4nd0mErr0r\\\\\\",\\\\\\"id\\\\\\":2}\\",\\"requestBody\\":\\"{\\\\\\"method\\\\\\":\\\\\\"eth_call\\\\\\",\\\\\\"params\\\\\\":[{\\\\\\"to\\\\\\":\\\\\\"0x007d40224f6562461633ccfbaffd359ebb2fc9ba\\\\\\",\\\\\\"data\\\\\\":\\\\\\"0x163aa6311a040999254caaf7a33cba67ec6a9b862da1dacf8a0d1e3bb76347060fc615d6\\\\\\"},\\\\\\"latest\\\\\\"],\\\\\\"id\\\\\\":42,\\\\\\"jsonrpc\\\\\\":\\\\\\"2.0\\\\\\"}\\",\\"requestMethod\\":\\"POST\\",\\"url\\":\\"https://mainnet.infura.io/v3/bb46da3f80e040e8ab73c0a9ff365d18\\"}, code=CALL_EXCEPTION, version=providers/5.7.2)", + "message": "missing revert data in call exception; Transaction reverted without a reason string [ See: https://links.ethers.org/v5-errors-CALL_EXCEPTION ] (data=\\"0x\\", transaction={\\"to\\":\\"0x007d40224F6562461633ccFBaffd359EbB2FC9Ba\\",\\"data\\":\\"0x163aa6311a040999254caaf7a33cba67ec6a9b862da1dacf8a0d1e3bb76347060fc615d6\\",\\"accessList\\":null}, error={\\"reason\\":\\"bad response\\",\\"code\\":\\"SERVER_ERROR\\",\\"status\\":502,\\"headers\\":{\\"x-powered-by\\":\\"msw\\",\\"content-type\\":\\"application/json\\"},\\"body\\":\\"{\\\\\\"jsonrpc\\\\\\":\\\\\\"2.0\\\\\\",\\\\\\"result\\\\\\":\\\\\\"0xs0meR4nd0mErr0r\\\\\\",\\\\\\"id\\\\\\":2}\\",\\"requestBody\\":\\"{\\\\\\"method\\\\\\":\\\\\\"eth_call\\\\\\",\\\\\\"params\\\\\\":[{\\\\\\"to\\\\\\":\\\\\\"0x007d40224f6562461633ccfbaffd359ebb2fc9ba\\\\\\",\\\\\\"data\\\\\\":\\\\\\"0x163aa6311a040999254caaf7a33cba67ec6a9b862da1dacf8a0d1e3bb76347060fc615d6\\\\\\"},\\\\\\"latest\\\\\\"],\\\\\\"id\\\\\\":43,\\\\\\"jsonrpc\\\\\\":\\\\\\"2.0\\\\\\"}\\",\\"requestMethod\\":\\"POST\\",\\"url\\":\\"https://mainnet.infura.io/v3/bb46da3f80e040e8ab73c0a9ff365d18\\"}, code=CALL_EXCEPTION, version=providers/5.7.2)", }, "status": "ERROR", "type": "DOCUMENT_STATUS", @@ -211,12 +211,12 @@ describe("Handling HTTP response errors", () => { "type": "DOCUMENT_STATUS", }, Object { - "data": [Error: missing revert data in call exception; Transaction reverted without a reason string [ See: https://links.ethers.org/v5-errors-CALL_EXCEPTION ] (data="0x", transaction={"to":"0x007d40224F6562461633ccFBaffd359EbB2FC9Ba","data":"0x163aa6311a040999254caaf7a33cba67ec6a9b862da1dacf8a0d1e3bb76347060fc615d6","accessList":null}, error={"reason":"failed response","code":"SERVER_ERROR","requestBody":"{\\"method\\":\\"eth_call\\",\\"params\\":[{\\"to\\":\\"0x007d40224f6562461633ccfbaffd359ebb2fc9ba\\",\\"data\\":\\"0x163aa6311a040999254caaf7a33cba67ec6a9b862da1dacf8a0d1e3bb76347060fc615d6\\"},\\"latest\\"],\\"id\\":42,\\"jsonrpc\\":\\"2.0\\"}","requestMethod":"POST","url":"https://sepolia.infura.io/v3/bb46da3f80e040e8ab73c0a9ff365d18"}, code=CALL_EXCEPTION, version=providers/5.7.2)], + "data": [Error: missing revert data in call exception; Transaction reverted without a reason string [ See: https://links.ethers.org/v5-errors-CALL_EXCEPTION ] (data="0x", transaction={"to":"0x007d40224F6562461633ccFBaffd359EbB2FC9Ba","data":"0x163aa6311a040999254caaf7a33cba67ec6a9b862da1dacf8a0d1e3bb76347060fc615d6","accessList":null}, error={"reason":"failed response","code":"SERVER_ERROR","requestBody":"{\\"method\\":\\"eth_call\\",\\"params\\":[{\\"to\\":\\"0x007d40224f6562461633ccfbaffd359ebb2fc9ba\\",\\"data\\":\\"0x163aa6311a040999254caaf7a33cba67ec6a9b862da1dacf8a0d1e3bb76347060fc615d6\\"},\\"latest\\"],\\"id\\":43,\\"jsonrpc\\":\\"2.0\\"}","requestMethod":"POST","url":"https://sepolia.infura.io/v3/bb46da3f80e040e8ab73c0a9ff365d18"}, code=CALL_EXCEPTION, version=providers/5.7.2)], "name": "OpenAttestationEthereumDocumentStoreStatus", "reason": Object { "code": 0, "codeString": "UNEXPECTED_ERROR", - "message": "missing revert data in call exception; Transaction reverted without a reason string [ See: https://links.ethers.org/v5-errors-CALL_EXCEPTION ] (data=\\"0x\\", transaction={\\"to\\":\\"0x007d40224F6562461633ccFBaffd359EbB2FC9Ba\\",\\"data\\":\\"0x163aa6311a040999254caaf7a33cba67ec6a9b862da1dacf8a0d1e3bb76347060fc615d6\\",\\"accessList\\":null}, error={\\"reason\\":\\"failed response\\",\\"code\\":\\"SERVER_ERROR\\",\\"requestBody\\":\\"{\\\\\\"method\\\\\\":\\\\\\"eth_call\\\\\\",\\\\\\"params\\\\\\":[{\\\\\\"to\\\\\\":\\\\\\"0x007d40224f6562461633ccfbaffd359ebb2fc9ba\\\\\\",\\\\\\"data\\\\\\":\\\\\\"0x163aa6311a040999254caaf7a33cba67ec6a9b862da1dacf8a0d1e3bb76347060fc615d6\\\\\\"},\\\\\\"latest\\\\\\"],\\\\\\"id\\\\\\":42,\\\\\\"jsonrpc\\\\\\":\\\\\\"2.0\\\\\\"}\\",\\"requestMethod\\":\\"POST\\",\\"url\\":\\"https://sepolia.infura.io/v3/bb46da3f80e040e8ab73c0a9ff365d18\\"}, code=CALL_EXCEPTION, version=providers/5.7.2)", + "message": "missing revert data in call exception; Transaction reverted without a reason string [ See: https://links.ethers.org/v5-errors-CALL_EXCEPTION ] (data=\\"0x\\", transaction={\\"to\\":\\"0x007d40224F6562461633ccFBaffd359EbB2FC9Ba\\",\\"data\\":\\"0x163aa6311a040999254caaf7a33cba67ec6a9b862da1dacf8a0d1e3bb76347060fc615d6\\",\\"accessList\\":null}, error={\\"reason\\":\\"failed response\\",\\"code\\":\\"SERVER_ERROR\\",\\"requestBody\\":\\"{\\\\\\"method\\\\\\":\\\\\\"eth_call\\\\\\",\\\\\\"params\\\\\\":[{\\\\\\"to\\\\\\":\\\\\\"0x007d40224f6562461633ccfbaffd359ebb2fc9ba\\\\\\",\\\\\\"data\\\\\\":\\\\\\"0x163aa6311a040999254caaf7a33cba67ec6a9b862da1dacf8a0d1e3bb76347060fc615d6\\\\\\"},\\\\\\"latest\\\\\\"],\\\\\\"id\\\\\\":43,\\\\\\"jsonrpc\\\\\\":\\\\\\"2.0\\\\\\"}\\",\\"requestMethod\\":\\"POST\\",\\"url\\":\\"https://sepolia.infura.io/v3/bb46da3f80e040e8ab73c0a9ff365d18\\"}, code=CALL_EXCEPTION, version=providers/5.7.2)", }, "status": "ERROR", "type": "DOCUMENT_STATUS", @@ -289,12 +289,12 @@ describe("Handling HTTP response errors", () => { "type": "DOCUMENT_STATUS", }, Object { - "data": [Error: missing revert data in call exception; Transaction reverted without a reason string [ See: https://links.ethers.org/v5-errors-CALL_EXCEPTION ] (data="0x", transaction={"to":"0x007d40224F6562461633ccFBaffd359EbB2FC9Ba","data":"0x163aa6311a040999254caaf7a33cba67ec6a9b862da1dacf8a0d1e3bb76347060fc615d6","accessList":null}, error={"reason":"bad response","code":"SERVER_ERROR","status":502,"headers":{"x-powered-by":"msw","content-type":"application/json"},"body":"{\\"jsonrpc\\":\\"2.0\\",\\"result\\":\\"0xs0meR4nd0mErr0r\\",\\"id\\":4}","requestBody":"{\\"method\\":\\"eth_call\\",\\"params\\":[{\\"to\\":\\"0x007d40224f6562461633ccfbaffd359ebb2fc9ba\\",\\"data\\":\\"0x163aa6311a040999254caaf7a33cba67ec6a9b862da1dacf8a0d1e3bb76347060fc615d6\\"},\\"latest\\"],\\"id\\":42,\\"jsonrpc\\":\\"2.0\\"}","requestMethod":"POST","url":"https://sepolia.infura.io/v3/bb46da3f80e040e8ab73c0a9ff365d18"}, code=CALL_EXCEPTION, version=providers/5.7.2)], + "data": [Error: missing revert data in call exception; Transaction reverted without a reason string [ See: https://links.ethers.org/v5-errors-CALL_EXCEPTION ] (data="0x", transaction={"to":"0x007d40224F6562461633ccFBaffd359EbB2FC9Ba","data":"0x163aa6311a040999254caaf7a33cba67ec6a9b862da1dacf8a0d1e3bb76347060fc615d6","accessList":null}, error={"reason":"bad response","code":"SERVER_ERROR","status":502,"headers":{"x-powered-by":"msw","content-type":"application/json"},"body":"{\\"jsonrpc\\":\\"2.0\\",\\"result\\":\\"0xs0meR4nd0mErr0r\\",\\"id\\":4}","requestBody":"{\\"method\\":\\"eth_call\\",\\"params\\":[{\\"to\\":\\"0x007d40224f6562461633ccfbaffd359ebb2fc9ba\\",\\"data\\":\\"0x163aa6311a040999254caaf7a33cba67ec6a9b862da1dacf8a0d1e3bb76347060fc615d6\\"},\\"latest\\"],\\"id\\":43,\\"jsonrpc\\":\\"2.0\\"}","requestMethod":"POST","url":"https://sepolia.infura.io/v3/bb46da3f80e040e8ab73c0a9ff365d18"}, code=CALL_EXCEPTION, version=providers/5.7.2)], "name": "OpenAttestationEthereumDocumentStoreStatus", "reason": Object { "code": 0, "codeString": "UNEXPECTED_ERROR", - "message": "missing revert data in call exception; Transaction reverted without a reason string [ See: https://links.ethers.org/v5-errors-CALL_EXCEPTION ] (data=\\"0x\\", transaction={\\"to\\":\\"0x007d40224F6562461633ccFBaffd359EbB2FC9Ba\\",\\"data\\":\\"0x163aa6311a040999254caaf7a33cba67ec6a9b862da1dacf8a0d1e3bb76347060fc615d6\\",\\"accessList\\":null}, error={\\"reason\\":\\"bad response\\",\\"code\\":\\"SERVER_ERROR\\",\\"status\\":502,\\"headers\\":{\\"x-powered-by\\":\\"msw\\",\\"content-type\\":\\"application/json\\"},\\"body\\":\\"{\\\\\\"jsonrpc\\\\\\":\\\\\\"2.0\\\\\\",\\\\\\"result\\\\\\":\\\\\\"0xs0meR4nd0mErr0r\\\\\\",\\\\\\"id\\\\\\":4}\\",\\"requestBody\\":\\"{\\\\\\"method\\\\\\":\\\\\\"eth_call\\\\\\",\\\\\\"params\\\\\\":[{\\\\\\"to\\\\\\":\\\\\\"0x007d40224f6562461633ccfbaffd359ebb2fc9ba\\\\\\",\\\\\\"data\\\\\\":\\\\\\"0x163aa6311a040999254caaf7a33cba67ec6a9b862da1dacf8a0d1e3bb76347060fc615d6\\\\\\"},\\\\\\"latest\\\\\\"],\\\\\\"id\\\\\\":42,\\\\\\"jsonrpc\\\\\\":\\\\\\"2.0\\\\\\"}\\",\\"requestMethod\\":\\"POST\\",\\"url\\":\\"https://sepolia.infura.io/v3/bb46da3f80e040e8ab73c0a9ff365d18\\"}, code=CALL_EXCEPTION, version=providers/5.7.2)", + "message": "missing revert data in call exception; Transaction reverted without a reason string [ See: https://links.ethers.org/v5-errors-CALL_EXCEPTION ] (data=\\"0x\\", transaction={\\"to\\":\\"0x007d40224F6562461633ccFBaffd359EbB2FC9Ba\\",\\"data\\":\\"0x163aa6311a040999254caaf7a33cba67ec6a9b862da1dacf8a0d1e3bb76347060fc615d6\\",\\"accessList\\":null}, error={\\"reason\\":\\"bad response\\",\\"code\\":\\"SERVER_ERROR\\",\\"status\\":502,\\"headers\\":{\\"x-powered-by\\":\\"msw\\",\\"content-type\\":\\"application/json\\"},\\"body\\":\\"{\\\\\\"jsonrpc\\\\\\":\\\\\\"2.0\\\\\\",\\\\\\"result\\\\\\":\\\\\\"0xs0meR4nd0mErr0r\\\\\\",\\\\\\"id\\\\\\":4}\\",\\"requestBody\\":\\"{\\\\\\"method\\\\\\":\\\\\\"eth_call\\\\\\",\\\\\\"params\\\\\\":[{\\\\\\"to\\\\\\":\\\\\\"0x007d40224f6562461633ccfbaffd359ebb2fc9ba\\\\\\",\\\\\\"data\\\\\\":\\\\\\"0x163aa6311a040999254caaf7a33cba67ec6a9b862da1dacf8a0d1e3bb76347060fc615d6\\\\\\"},\\\\\\"latest\\\\\\"],\\\\\\"id\\\\\\":43,\\\\\\"jsonrpc\\\\\\":\\\\\\"2.0\\\\\\"}\\",\\"requestMethod\\":\\"POST\\",\\"url\\":\\"https://sepolia.infura.io/v3/bb46da3f80e040e8ab73c0a9ff365d18\\"}, code=CALL_EXCEPTION, version=providers/5.7.2)", }, "status": "ERROR", "type": "DOCUMENT_STATUS",