From 5d9f4140bf620f655e29a0d9c4cb001a16a97eda Mon Sep 17 00:00:00 2001 From: Francisco Tobar Date: Thu, 15 Feb 2024 09:43:31 -0600 Subject: [PATCH] test: fix --- package-lock.json | 124 +++++++++++++-------------- test/relayserver/RelayServer.test.ts | 4 +- test/verifier/verifiers.test.ts | 46 ---------- 3 files changed, 64 insertions(+), 110 deletions(-) diff --git a/package-lock.json b/package-lock.json index 364be5a3..028fb54c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1420,9 +1420,9 @@ } }, "node_modules/@jridgewell/resolve-uri": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.1.tgz", - "integrity": "sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA==", + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", + "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", "engines": { "node": ">=6.0.0" } @@ -2343,7 +2343,7 @@ }, "node_modules/@rsksmart/rif-relay-contracts": { "version": "2.0.0-beta.1", - "resolved": "git+ssh://git@github.com/rsksmart/rif-relay-contracts.git#b3b578e72b8c692eca846ad52c2f4605c5910c09", + "resolved": "git+ssh://git@github.com/rsksmart/rif-relay-contracts.git#f17201d02fbd8c8b11d5a751b68618c74727865e", "license": "MIT", "dependencies": { "@metamask/eth-sig-util": "^4.0.1", @@ -2480,7 +2480,7 @@ }, "node_modules/@rsksmart/rif-relay-server": { "version": "2.2.2", - "resolved": "git+ssh://git@github.com/rsksmart/rif-relay-server.git#a1ae29259d6675d6f1f78c2951f7a11383b3acd0", + "resolved": "git+ssh://git@github.com/rsksmart/rif-relay-server.git#cb4f8be2b1f6b07f2bd5ff65903d0b17e2d44c59", "license": "MIT", "dependencies": { "@rsksmart/rif-relay-client": "github:rsksmart/rif-relay-client#PP-885/explore-solution-b2", @@ -3038,9 +3038,9 @@ "integrity": "sha512-nG96G3Wp6acyAgJqGasjODb+acrI7KltPiRxzHPXnP3NgI28bpQDRv53olbqGXbfcgF5aiiHmO3xpwEpS5Ld9g==" }, "node_modules/@types/node": { - "version": "18.19.15", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.19.15.tgz", - "integrity": "sha512-AMZ2UWx+woHNfM11PyAEQmfSxi05jm9OlkxczuHeEqmvwPkYj6MWv44gbzDPefYOLysTOFyI3ziiy2ONmUZfpA==", + "version": "18.19.16", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.19.16.tgz", + "integrity": "sha512-mjtrR7Wco9ZwcGBc1zre6fENlj9z42/+0W26lBGtGBTPiR3Zm9iZAaiPhxreG6magwGCILLVYwlQ48GjAaqM6w==", "dependencies": { "undici-types": "~5.26.4" } @@ -4030,9 +4030,9 @@ } }, "node_modules/browserslist": { - "version": "4.22.3", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.22.3.tgz", - "integrity": "sha512-UAp55yfwNv0klWNapjs/ktHoguxuQNGnOzxYmfnXIS+8AsRDZkSDxg7R1AX3GKzn078SBI5dzwzj/Yx0Or0e3A==", + "version": "4.23.0", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.23.0.tgz", + "integrity": "sha512-QW8HiM1shhT2GuzkvklfjcKDiWFXHOeFCIA/huJPwHsslwcydgk7X+z2zXpEijP98UCY7HbubZt5J2Zgvf0CaQ==", "funding": [ { "type": "opencollective", @@ -4048,8 +4048,8 @@ } ], "dependencies": { - "caniuse-lite": "^1.0.30001580", - "electron-to-chromium": "^1.4.648", + "caniuse-lite": "^1.0.30001587", + "electron-to-chromium": "^1.4.668", "node-releases": "^2.0.14", "update-browserslist-db": "^1.0.13" }, @@ -5208,9 +5208,9 @@ "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==" }, "node_modules/electron-to-chromium": { - "version": "1.4.668", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.668.tgz", - "integrity": "sha512-ZOBocMYCehr9W31+GpMclR+KBaDZOoAEabLdhpZ8oU1JFDwIaFY0UDbpXVEUFc0BIP2O2Qn3rkfCjQmMR4T/bQ==" + "version": "1.4.670", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.670.tgz", + "integrity": "sha512-hcijYOWjOtjKrKPtNA6tuLlA/bTLO3heFG8pQA6mLpq7dRydSWicXova5lyxDzp1iVJaYhK7J2OQlGE52KYn7A==" }, "node_modules/elliptic": { "version": "6.5.4", @@ -6940,9 +6940,9 @@ } }, "node_modules/hardhat": { - "version": "2.20.0", - "resolved": "https://registry.npmjs.org/hardhat/-/hardhat-2.20.0.tgz", - "integrity": "sha512-TtWZ4mKOH5YA+PCDAGAjG7Gub2NA+egAX7RIHq5XnGrEALNXAbyP3S0I9vOE1MWCgZhn+XOFUNfDuHgkBOPoRw==", + "version": "2.20.1", + "resolved": "https://registry.npmjs.org/hardhat/-/hardhat-2.20.1.tgz", + "integrity": "sha512-q75xDQiQtCZcTMBwjTovrXEU5ECr49baxr4/OBkIu/ULTPzlB20yk1dRWNmD2IFbAeAeXggaWvQAdpiScaHtPw==", "dependencies": { "@ethersproject/abi": "^5.1.2", "@metamask/eth-sig-util": "^4.0.0", @@ -11067,9 +11067,9 @@ } }, "node_modules/spdx-exceptions": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.4.0.tgz", - "integrity": "sha512-hcjppoJ68fhxA/cjbN4T8N6uCUejN8yFw69ttpqtBeCbF3u13n7mb31NB9jKwGTTWWnt9IbRA/mf1FprYS8wfw==" + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.5.0.tgz", + "integrity": "sha512-PiU42r+xO4UbUS1buo3LPJkjlO7430Xn5SVAhdpzzsPHsjbYVflnnFdATgabnLude+Cqu25p6N+g2lw/PFsa4w==" }, "node_modules/spdx-expression-parse": { "version": "3.0.1", @@ -11329,9 +11329,9 @@ } }, "node_modules/swagger-ui-dist": { - "version": "5.11.4", - "resolved": "https://registry.npmjs.org/swagger-ui-dist/-/swagger-ui-dist-5.11.4.tgz", - "integrity": "sha512-2rxWfHXIKCcCP/V1Y89MV1vmnTc6J0hRLzPAWtkM2BYnolVE0iNrHGGQRneiuo5/g4kYa5Kyk8DxPRqr4WWQ1w==" + "version": "5.11.6", + "resolved": "https://registry.npmjs.org/swagger-ui-dist/-/swagger-ui-dist-5.11.6.tgz", + "integrity": "sha512-K5BpYuMoPpJY7NwCHIWohH6tU9o0fs1+plNT5KJ+3BBlVEh4H1CpeKJV8o91lpscVY9oqb2jmaAassnW3wVoTg==" }, "node_modules/swagger-ui-express": { "version": "4.6.3", @@ -11451,9 +11451,9 @@ } }, "node_modules/terser": { - "version": "5.27.0", - "resolved": "https://registry.npmjs.org/terser/-/terser-5.27.0.tgz", - "integrity": "sha512-bi1HRwVRskAjheeYl291n3JC4GgO/Ty4z1nVs5AAsmonJulGxpSektecnNedrwK9C7vpvVtcX3cw00VSLt7U2A==", + "version": "5.27.1", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.27.1.tgz", + "integrity": "sha512-29wAr6UU/oQpnTw5HoadwjUZnFQXGdOfj0LjZ4sVxzqwHh/QVkvr7m8y9WoR4iN3FRitVduTc6KdjcW38Npsug==", "dependencies": { "@jridgewell/source-map": "^0.3.3", "acorn": "^8.8.2", @@ -12134,9 +12134,9 @@ } }, "node_modules/webpack": { - "version": "5.90.1", - "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.90.1.tgz", - "integrity": "sha512-SstPdlAC5IvgFnhiRok8hqJo/+ArAbNv7rhU4fnWGHNVfN59HSQFaxZDSAL3IFG2YmqxuRs+IU33milSxbPlog==", + "version": "5.90.2", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.90.2.tgz", + "integrity": "sha512-ziXu8ABGr0InCMEYFnHrYweinHK2PWrMqnwdHk2oK3rRhv/1B+2FnfwYv5oD+RrknK/Pp/Hmyvu+eAsaMYhzCw==", "dependencies": { "@types/eslint-scope": "^3.7.3", "@types/estree": "^1.0.5", @@ -13323,9 +13323,9 @@ } }, "@jridgewell/resolve-uri": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.1.tgz", - "integrity": "sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA==" + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", + "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==" }, "@jridgewell/set-array": { "version": "1.1.2", @@ -14019,7 +14019,7 @@ } }, "@rsksmart/rif-relay-contracts": { - "version": "git+ssh://git@github.com/rsksmart/rif-relay-contracts.git#b3b578e72b8c692eca846ad52c2f4605c5910c09", + "version": "git+ssh://git@github.com/rsksmart/rif-relay-contracts.git#f17201d02fbd8c8b11d5a751b68618c74727865e", "from": "@rsksmart/rif-relay-contracts@github:rsksmart/rif-relay-contracts#PP-885/explore-solution-b2", "requires": { "@metamask/eth-sig-util": "^4.0.1", @@ -14147,7 +14147,7 @@ } }, "@rsksmart/rif-relay-server": { - "version": "git+ssh://git@github.com/rsksmart/rif-relay-server.git#a1ae29259d6675d6f1f78c2951f7a11383b3acd0", + "version": "git+ssh://git@github.com/rsksmart/rif-relay-server.git#cb4f8be2b1f6b07f2bd5ff65903d0b17e2d44c59", "from": "@rsksmart/rif-relay-server@github:rsksmart/rif-relay-server#PP-885/explore-solution-b2", "requires": { "@rsksmart/rif-relay-client": "github:rsksmart/rif-relay-client#PP-885/explore-solution-b2", @@ -14661,9 +14661,9 @@ "integrity": "sha512-nG96G3Wp6acyAgJqGasjODb+acrI7KltPiRxzHPXnP3NgI28bpQDRv53olbqGXbfcgF5aiiHmO3xpwEpS5Ld9g==" }, "@types/node": { - "version": "18.19.15", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.19.15.tgz", - "integrity": "sha512-AMZ2UWx+woHNfM11PyAEQmfSxi05jm9OlkxczuHeEqmvwPkYj6MWv44gbzDPefYOLysTOFyI3ziiy2ONmUZfpA==", + "version": "18.19.16", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.19.16.tgz", + "integrity": "sha512-mjtrR7Wco9ZwcGBc1zre6fENlj9z42/+0W26lBGtGBTPiR3Zm9iZAaiPhxreG6magwGCILLVYwlQ48GjAaqM6w==", "requires": { "undici-types": "~5.26.4" } @@ -15456,12 +15456,12 @@ } }, "browserslist": { - "version": "4.22.3", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.22.3.tgz", - "integrity": "sha512-UAp55yfwNv0klWNapjs/ktHoguxuQNGnOzxYmfnXIS+8AsRDZkSDxg7R1AX3GKzn078SBI5dzwzj/Yx0Or0e3A==", + "version": "4.23.0", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.23.0.tgz", + "integrity": "sha512-QW8HiM1shhT2GuzkvklfjcKDiWFXHOeFCIA/huJPwHsslwcydgk7X+z2zXpEijP98UCY7HbubZt5J2Zgvf0CaQ==", "requires": { - "caniuse-lite": "^1.0.30001580", - "electron-to-chromium": "^1.4.648", + "caniuse-lite": "^1.0.30001587", + "electron-to-chromium": "^1.4.668", "node-releases": "^2.0.14", "update-browserslist-db": "^1.0.13" } @@ -16306,9 +16306,9 @@ "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==" }, "electron-to-chromium": { - "version": "1.4.668", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.668.tgz", - "integrity": "sha512-ZOBocMYCehr9W31+GpMclR+KBaDZOoAEabLdhpZ8oU1JFDwIaFY0UDbpXVEUFc0BIP2O2Qn3rkfCjQmMR4T/bQ==" + "version": "1.4.670", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.670.tgz", + "integrity": "sha512-hcijYOWjOtjKrKPtNA6tuLlA/bTLO3heFG8pQA6mLpq7dRydSWicXova5lyxDzp1iVJaYhK7J2OQlGE52KYn7A==" }, "elliptic": { "version": "6.5.4", @@ -17626,9 +17626,9 @@ "integrity": "sha512-VIZB+ibDhx7ObhAe7OVtoEbuP4h/MuOTHJ+J8h/eBXotJYl0fBgR72xDFCKgIh22OJZIOVNxBMWuhAr10r8HdA==" }, "hardhat": { - "version": "2.20.0", - "resolved": "https://registry.npmjs.org/hardhat/-/hardhat-2.20.0.tgz", - "integrity": "sha512-TtWZ4mKOH5YA+PCDAGAjG7Gub2NA+egAX7RIHq5XnGrEALNXAbyP3S0I9vOE1MWCgZhn+XOFUNfDuHgkBOPoRw==", + "version": "2.20.1", + "resolved": "https://registry.npmjs.org/hardhat/-/hardhat-2.20.1.tgz", + "integrity": "sha512-q75xDQiQtCZcTMBwjTovrXEU5ECr49baxr4/OBkIu/ULTPzlB20yk1dRWNmD2IFbAeAeXggaWvQAdpiScaHtPw==", "requires": { "@ethersproject/abi": "^5.1.2", "@metamask/eth-sig-util": "^4.0.0", @@ -20672,9 +20672,9 @@ } }, "spdx-exceptions": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.4.0.tgz", - "integrity": "sha512-hcjppoJ68fhxA/cjbN4T8N6uCUejN8yFw69ttpqtBeCbF3u13n7mb31NB9jKwGTTWWnt9IbRA/mf1FprYS8wfw==" + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.5.0.tgz", + "integrity": "sha512-PiU42r+xO4UbUS1buo3LPJkjlO7430Xn5SVAhdpzzsPHsjbYVflnnFdATgabnLude+Cqu25p6N+g2lw/PFsa4w==" }, "spdx-expression-parse": { "version": "3.0.1", @@ -20872,9 +20872,9 @@ } }, "swagger-ui-dist": { - "version": "5.11.4", - "resolved": "https://registry.npmjs.org/swagger-ui-dist/-/swagger-ui-dist-5.11.4.tgz", - "integrity": "sha512-2rxWfHXIKCcCP/V1Y89MV1vmnTc6J0hRLzPAWtkM2BYnolVE0iNrHGGQRneiuo5/g4kYa5Kyk8DxPRqr4WWQ1w==" + "version": "5.11.6", + "resolved": "https://registry.npmjs.org/swagger-ui-dist/-/swagger-ui-dist-5.11.6.tgz", + "integrity": "sha512-K5BpYuMoPpJY7NwCHIWohH6tU9o0fs1+plNT5KJ+3BBlVEh4H1CpeKJV8o91lpscVY9oqb2jmaAassnW3wVoTg==" }, "swagger-ui-express": { "version": "4.6.3", @@ -20965,9 +20965,9 @@ "integrity": "sha512-GNzQvQTOIP6RyTfE2Qxb8ZVlNmw0n88vp1szwWRimP02mnTsx3Wtn5qRdqY9w2XduFNUgvOwhNnQsjwCp+kqaQ==" }, "terser": { - "version": "5.27.0", - "resolved": "https://registry.npmjs.org/terser/-/terser-5.27.0.tgz", - "integrity": "sha512-bi1HRwVRskAjheeYl291n3JC4GgO/Ty4z1nVs5AAsmonJulGxpSektecnNedrwK9C7vpvVtcX3cw00VSLt7U2A==", + "version": "5.27.1", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.27.1.tgz", + "integrity": "sha512-29wAr6UU/oQpnTw5HoadwjUZnFQXGdOfj0LjZ4sVxzqwHh/QVkvr7m8y9WoR4iN3FRitVduTc6KdjcW38Npsug==", "requires": { "@jridgewell/source-map": "^0.3.3", "acorn": "^8.8.2", @@ -21458,9 +21458,9 @@ } }, "webpack": { - "version": "5.90.1", - "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.90.1.tgz", - "integrity": "sha512-SstPdlAC5IvgFnhiRok8hqJo/+ArAbNv7rhU4fnWGHNVfN59HSQFaxZDSAL3IFG2YmqxuRs+IU33milSxbPlog==", + "version": "5.90.2", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.90.2.tgz", + "integrity": "sha512-ziXu8ABGr0InCMEYFnHrYweinHK2PWrMqnwdHk2oK3rRhv/1B+2FnfwYv5oD+RrknK/Pp/Hmyvu+eAsaMYhzCw==", "requires": { "@types/eslint-scope": "^3.7.3", "@types/estree": "^1.0.5", diff --git a/test/relayserver/RelayServer.test.ts b/test/relayserver/RelayServer.test.ts index 79ba1027..776f5716 100644 --- a/test/relayserver/RelayServer.test.ts +++ b/test/relayserver/RelayServer.test.ts @@ -1379,7 +1379,7 @@ describe('RelayServer', function () { await expect( relayServer.tokenHandler(wrongVerifierAddress) - ).to.be.rejectedWith('supplied verifier is not trusted'); + ).to.be.rejectedWith('Supplied verifier is not trusted'); }); it('should return no tokens for verifiers when none were allowed', async function () { @@ -1483,7 +1483,7 @@ describe('RelayServer', function () { await expect( relayServer.destinationContractHandler(wrongVerifierAddress) - ).to.be.rejectedWith('supplied verifier is not trusted'); + ).to.be.rejectedWith('Supplied verifier is not trusted'); }); it('should return no contracts for verifiers when none were allowed', async function () { diff --git a/test/verifier/verifiers.test.ts b/test/verifier/verifiers.test.ts index 2d464be3..17659731 100644 --- a/test/verifier/verifiers.test.ts +++ b/test/verifier/verifiers.test.ts @@ -870,30 +870,6 @@ describe('Verifiers tests', function () { let smartWalletFactory: MinimalBoltzSmartWalletFactory; let smartWallet: MinimalBoltzSmartWallet; - async function prepareSmartWallet() { - const hardHatSmartWalletFactory = await hardhat.getContractFactory( - 'MinimalBoltzSmartWallet' - ); - const smartWalletTemplate = await hardHatSmartWalletFactory.deploy(); - - const hardHatSmartWalletFactoryFactory = await hardhat.getContractFactory( - 'MinimalBoltzSmartWalletFactory' - ); - smartWalletFactory = await hardHatSmartWalletFactoryFactory.deploy( - smartWalletTemplate.address - ); - - const smartWallet = await createSupportedSmartWallet({ - relayHub: relayHub.address, - sender: relayHub, - owner, - factory: smartWalletFactory, - type: 'Default', - }); - - return smartWallet; - } - beforeEach(async function () { const [, localRelayHub] = await hardhat.getSigners(); relayHub = localRelayHub as SignerWithAddress; @@ -930,28 +906,6 @@ describe('Verifiers tests', function () { }); }); - it('Should fail if the factory is incorrect', async function () { - const wrongSmartWallet = await prepareSmartWallet(); - - const relayRequest = createEnvelopingRequest( - false, - { - relayHub: relayHub.address, - from: owner.address, - }, - { - callForwarder: wrongSmartWallet.address, - callVerifier: relayVerifier.address, - } - ) as RelayRequest; - - const signature = '0x00'; - - await expect( - relayVerifier.verifyRelayedCall(relayRequest, signature) - ).to.be.rejectedWith('SW different to template'); - }); - it('Should always fail', async function () { const relayRequest = createEnvelopingRequest( false,