From 01f1df98c4c1cf096f807671ec1b0da578b4f786 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 9 Sep 2021 17:03:11 +0000 Subject: [PATCH 1/4] chore(deps): bump github/codeql-action from 1.0.13 to 1.0.14 Bumps [github/codeql-action](https://github.com/github/codeql-action) from 1.0.13 to 1.0.14. - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/github/codeql-action/compare/89d78ba4572c7854683ec144d212bf0b52cd2a2a...4854dd23d5f2aada3f026670784d5109e7702ea9) --- updated-dependencies: - dependency-name: github/codeql-action dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- .github/workflows/audit_and_lint.yml | 2 +- .github/workflows/codeql.yml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/audit_and_lint.yml b/.github/workflows/audit_and_lint.yml index e404ed230..3d90c1511 100644 --- a/.github/workflows/audit_and_lint.yml +++ b/.github/workflows/audit_and_lint.yml @@ -68,7 +68,7 @@ jobs: - name: Upload lint results # run if lint failed and only on master/dev branch and pull requests if: always() && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/dev' || github.event_name == 'pull_request') - uses: github/codeql-action/upload-sarif@89d78ba4572c7854683ec144d212bf0b52cd2a2a # pin@codeql-bundle-20210517 + uses: github/codeql-action/upload-sarif@4854dd23d5f2aada3f026670784d5109e7702ea9 # pin@codeql-bundle-20210517 with: sarif_file: lint-results.sarif continue-on-error: true diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 44c0ac79a..0a2539740 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -17,10 +17,10 @@ jobs: uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # pin@v2 - name: Initialize CodeQL - uses: github/codeql-action/init@89d78ba4572c7854683ec144d212bf0b52cd2a2a + uses: github/codeql-action/init@4854dd23d5f2aada3f026670784d5109e7702ea9 with: queries: security-and-quality languages: javascript - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@89d78ba4572c7854683ec144d212bf0b52cd2a2a + uses: github/codeql-action/analyze@4854dd23d5f2aada3f026670784d5109e7702ea9 From db7126969fe0f1a6e71b0dea8176c5fc7358803d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 14 Sep 2021 17:06:18 +0000 Subject: [PATCH 2/4] chore(deps): bump cypress from 8.3.1 to 8.4.0 Bumps [cypress](https://github.com/cypress-io/cypress) from 8.3.1 to 8.4.0. - [Release notes](https://github.com/cypress-io/cypress/releases) - [Changelog](https://github.com/cypress-io/cypress/blob/develop/.releaserc.base.js) - [Commits](https://github.com/cypress-io/cypress/compare/v8.3.1...v8.4.0) --- updated-dependencies: - dependency-name: cypress dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- package-lock.json | 14 +++++++------- package.json | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/package-lock.json b/package-lock.json index 84931716c..963fe0fb2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -26,7 +26,7 @@ "bytes32": "0.0.3", "commander": "8.1.0", "cross-zip": "4.0.0", - "cypress": "8.3.1", + "cypress": "8.4.0", "cypress-wait-until": "1.7.1", "eslint": "7.32.0", "eslint-config-prettier": "8.3.0", @@ -7689,9 +7689,9 @@ } }, "node_modules/cypress": { - "version": "8.3.1", - "resolved": "https://registry.npmjs.org/cypress/-/cypress-8.3.1.tgz", - "integrity": "sha512-1v6pfx+/5cXhaT5T6QKOvnkawmEHWHLiVzm3MYMoQN1fkX2Ma1C32STd3jBStE9qT5qPSTILjGzypVRxCBi40g==", + "version": "8.4.0", + "resolved": "https://registry.npmjs.org/cypress/-/cypress-8.4.0.tgz", + "integrity": "sha512-RtVgGFR06ikyMaq/VqapeqOjGaIA42PpK7F0qe1MCiFArfUuJECsLmeYaOA+1TlmNUgJNMSF5fWKkZIJr5Uc7w==", "hasInstallScript": true, "dependencies": { "@cypress/request": "^2.88.6", @@ -29189,9 +29189,9 @@ "integrity": "sha512-FYDTSHb/7KXsWICVsxdmiExPjCfRC4qRFBdVwv7Ax9hMnvMmEjP9RfxTEZ3qPZGmADDn2vAKSo9UcN1jKVYscg==" }, "cypress": { - "version": "8.3.1", - "resolved": "https://registry.npmjs.org/cypress/-/cypress-8.3.1.tgz", - "integrity": "sha512-1v6pfx+/5cXhaT5T6QKOvnkawmEHWHLiVzm3MYMoQN1fkX2Ma1C32STd3jBStE9qT5qPSTILjGzypVRxCBi40g==", + "version": "8.4.0", + "resolved": "https://registry.npmjs.org/cypress/-/cypress-8.4.0.tgz", + "integrity": "sha512-RtVgGFR06ikyMaq/VqapeqOjGaIA42PpK7F0qe1MCiFArfUuJECsLmeYaOA+1TlmNUgJNMSF5fWKkZIJr5Uc7w==", "requires": { "@cypress/request": "^2.88.6", "@cypress/xvfb": "^1.2.4", diff --git a/package.json b/package.json index d894aa52c..25c015f8c 100644 --- a/package.json +++ b/package.json @@ -58,7 +58,7 @@ "bytes32": "0.0.3", "commander": "8.1.0", "cross-zip": "4.0.0", - "cypress": "8.3.1", + "cypress": "8.4.0", "cypress-wait-until": "1.7.1", "eslint": "7.32.0", "eslint-config-prettier": "8.3.0", From b0a38290b89ebe22a0e4677595fb873fc59c42b8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 14 Sep 2021 17:06:41 +0000 Subject: [PATCH 3/4] chore(deps): bump synthetix-js from 2.46.0 to 2.48.0 Bumps [synthetix-js](https://github.com/Synthetixio/synthetix-js) from 2.46.0 to 2.48.0. - [Release notes](https://github.com/Synthetixio/synthetix-js/releases) - [Commits](https://github.com/Synthetixio/synthetix-js/compare/v2.46.0...v2.48.0) --- updated-dependencies: - dependency-name: synthetix-js dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- package-lock.json | 73 +++++++++++++++++++---------------------------- package.json | 2 +- 2 files changed, 31 insertions(+), 44 deletions(-) diff --git a/package-lock.json b/package-lock.json index 84931716c..9a3c1e490 100644 --- a/package-lock.json +++ b/package-lock.json @@ -47,7 +47,7 @@ "puppeteer-core": "10.2.0", "serve": "12.0.0", "start-server-and-test": "1.13.1", - "synthetix-js": "2.46.0" + "synthetix-js": "2.48.0" }, "bin": { "synpress": "synpress.js" @@ -14028,6 +14028,14 @@ "node": ">= 0.6" } }, + "node_modules/mimic-fn": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz", + "integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==", + "engines": { + "node": ">=4" + } + }, "node_modules/mimic-response": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-1.0.1.tgz", @@ -19476,9 +19484,9 @@ } }, "node_modules/synthetix-js": { - "version": "2.46.0", - "resolved": "https://registry.npmjs.org/synthetix-js/-/synthetix-js-2.46.0.tgz", - "integrity": "sha512-tfH9HnAHlGoGWEN+XDXxb3bNRqAa4bw8FEKY1va+sgnq4hu3vBpKXemPcgF8Hya5xEY/lmshTBuLe6n2UBPxNw==", + "version": "2.48.0", + "resolved": "https://registry.npmjs.org/synthetix-js/-/synthetix-js-2.48.0.tgz", + "integrity": "sha512-pP5s0ywFFeu8HG9C7mqxvhl2DUOOQgGB3UKaGXBqhMEIv1buZacyRqgMJz9qyqHBQquX07xgYFE2hLj38f1c0g==", "dependencies": { "@ledgerhq/hw-app-eth": "4.74.2", "@ledgerhq/hw-transport": "4.74.2", @@ -19490,7 +19498,7 @@ "ethers": "4.0.44", "hdkey": "1.1.1", "lodash": "4.17.15", - "synthetix": "2.46.0", + "synthetix": "2.48.0", "trezor-connect": "8.1.8", "walletlink": "2.0.2" } @@ -19569,14 +19577,6 @@ "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=" }, - "node_modules/synthetix-js/node_modules/commander": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-5.1.0.tgz", - "integrity": "sha512-P0CysNDQ7rtVw4QIQtm+MRxV66vKFSvlsQvGYXZWR3qFU0jlMKHZZZgw8e+8DSah4UDKMqnknRDQz+xuQXQ/Zg==", - "engines": { - "node": ">= 6" - } - }, "node_modules/synthetix-js/node_modules/elliptic": { "version": "6.5.2", "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.2.tgz", @@ -19706,14 +19706,6 @@ "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==" }, - "node_modules/synthetix-js/node_modules/mimic-fn": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz", - "integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==", - "engines": { - "node": ">=4" - } - }, "node_modules/synthetix-js/node_modules/mute-stream": { "version": "0.0.7", "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.7.tgz", @@ -19806,12 +19798,12 @@ } }, "node_modules/synthetix-js/node_modules/synthetix": { - "version": "2.46.0", - "resolved": "https://registry.npmjs.org/synthetix/-/synthetix-2.46.0.tgz", - "integrity": "sha512-KRtzXRvGn0ur9sXmdwQEqs5xSO2HgNA8if3iiUMBASjMDFnAiRWA/CoqctSuoqZwn6mrFYuynzL2gnHrnTNfOA==", + "version": "2.48.0", + "resolved": "https://registry.npmjs.org/synthetix/-/synthetix-2.48.0.tgz", + "integrity": "sha512-0321vuc7dMqRk/4zQlV0RWlINEc3Op+LPy9AGyOIlPAbjS9C5nBQ0efLOa7TtXh6Q/Ja+ApCUxXUHj7Sg6gwRA==", "dependencies": { "abi-decoder": "2.3.0", - "commander": "5.1.0", + "commander": "8.1.0", "inquirer": "^6.5.2", "inquirer-list-search-prompt": "^1.0.2", "js-levenshtein": "^1.1.6", @@ -34272,6 +34264,11 @@ "mime-db": "1.49.0" } }, + "mimic-fn": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz", + "integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==" + }, "mimic-response": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-1.0.1.tgz", @@ -38581,9 +38578,9 @@ } }, "synthetix-js": { - "version": "2.46.0", - "resolved": "https://registry.npmjs.org/synthetix-js/-/synthetix-js-2.46.0.tgz", - "integrity": "sha512-tfH9HnAHlGoGWEN+XDXxb3bNRqAa4bw8FEKY1va+sgnq4hu3vBpKXemPcgF8Hya5xEY/lmshTBuLe6n2UBPxNw==", + "version": "2.48.0", + "resolved": "https://registry.npmjs.org/synthetix-js/-/synthetix-js-2.48.0.tgz", + "integrity": "sha512-pP5s0ywFFeu8HG9C7mqxvhl2DUOOQgGB3UKaGXBqhMEIv1buZacyRqgMJz9qyqHBQquX07xgYFE2hLj38f1c0g==", "requires": { "@ledgerhq/hw-app-eth": "4.74.2", "@ledgerhq/hw-transport": "4.74.2", @@ -38595,7 +38592,7 @@ "ethers": "4.0.44", "hdkey": "1.1.1", "lodash": "4.17.15", - "synthetix": "2.46.0", + "synthetix": "2.48.0", "trezor-connect": "8.1.8", "walletlink": "2.0.2" }, @@ -38659,11 +38656,6 @@ "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=" }, - "commander": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-5.1.0.tgz", - "integrity": "sha512-P0CysNDQ7rtVw4QIQtm+MRxV66vKFSvlsQvGYXZWR3qFU0jlMKHZZZgw8e+8DSah4UDKMqnknRDQz+xuQXQ/Zg==" - }, "elliptic": { "version": "6.5.2", "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.2.tgz", @@ -38772,11 +38764,6 @@ "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==" }, - "mimic-fn": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz", - "integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==" - }, "mute-stream": { "version": "0.0.7", "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.7.tgz", @@ -38850,12 +38837,12 @@ } }, "synthetix": { - "version": "2.46.0", - "resolved": "https://registry.npmjs.org/synthetix/-/synthetix-2.46.0.tgz", - "integrity": "sha512-KRtzXRvGn0ur9sXmdwQEqs5xSO2HgNA8if3iiUMBASjMDFnAiRWA/CoqctSuoqZwn6mrFYuynzL2gnHrnTNfOA==", + "version": "2.48.0", + "resolved": "https://registry.npmjs.org/synthetix/-/synthetix-2.48.0.tgz", + "integrity": "sha512-0321vuc7dMqRk/4zQlV0RWlINEc3Op+LPy9AGyOIlPAbjS9C5nBQ0efLOa7TtXh6Q/Ja+ApCUxXUHj7Sg6gwRA==", "requires": { "abi-decoder": "2.3.0", - "commander": "5.1.0", + "commander": "8.1.0", "inquirer": "^6.5.2", "inquirer-list-search-prompt": "^1.0.2", "js-levenshtein": "^1.1.6", diff --git a/package.json b/package.json index d894aa52c..1f940f612 100644 --- a/package.json +++ b/package.json @@ -79,7 +79,7 @@ "puppeteer-core": "10.2.0", "serve": "12.0.0", "start-server-and-test": "1.13.1", - "synthetix-js": "2.46.0" + "synthetix-js": "2.48.0" }, "devDependencies": { "@microsoft/eslint-formatter-sarif": "2.1.5", From 5a7937075b89e81328615607967844d952a9fe27 Mon Sep 17 00:00:00 2001 From: Vignesh Hirudayakanth Date: Fri, 17 Sep 2021 02:46:16 -0700 Subject: [PATCH 4/4] Adding metamask signature commands. --- commands/metamask.js | 19 +++++++++++++++++++ pages/metamask/notification-page.js | 7 +++++++ plugins/index.js | 8 ++++++++ support/commands.js | 8 ++++++++ support/index.d.ts | 12 ++++++++++++ 5 files changed, 54 insertions(+) diff --git a/commands/metamask.js b/commands/metamask.js index 5a6821547..412d5dee1 100644 --- a/commands/metamask.js +++ b/commands/metamask.js @@ -16,6 +16,7 @@ const { notificationPageElements, permissionsPageElements, confirmPageElements, + signaturePageElements, } = require('../pages/metamask/notification-page'); const { settingsPageElements, @@ -290,6 +291,24 @@ module.exports = { await puppeteer.waitFor(mainPageElements.walletOverview); return true; }, + confirmSignatureRequest: async () => { + const notificationPage = await puppeteer.switchToMetamaskNotification(); + await puppeteer.waitAndClick( + signaturePageElements.confirmSignatureRequestButton, + notificationPage, + ); + await puppeteer.metamaskWindow().waitForTimeout(3000); + return true; + }, + rejectSignatureRequest: async () => { + const notificationPage = await puppeteer.switchToMetamaskNotification(); + await puppeteer.waitAndClick( + signaturePageElements.rejectSignatureRequestButton, + notificationPage, + ); + await puppeteer.metamaskWindow().waitForTimeout(3000); + return true; + }, confirmPermissionToSpend: async () => { const notificationPage = await puppeteer.switchToMetamaskNotification(); await puppeteer.waitAndClick( diff --git a/pages/metamask/notification-page.js b/pages/metamask/notification-page.js index 4995230ac..9e48d195a 100644 --- a/pages/metamask/notification-page.js +++ b/pages/metamask/notification-page.js @@ -9,6 +9,13 @@ module.exports.notificationPageElements = { rejectToSpendButton, }; +const confirmSignatureRequestButton = `${notificationPage} .request-signature__footer__sign-button`; +const rejectSignatureRequestButton = `${notificationPage} .request-signature__footer__cancel-button`; +module.exports.signaturePageElements = { + confirmSignatureRequestButton, + rejectSignatureRequestButton, +}; + const permissionsPage = '.permissions-connect'; const connectButton = `${permissionsPage} .permission-approval-container__footers button:nth-child(2)`; module.exports.permissionsPageElements = { diff --git a/plugins/index.js b/plugins/index.js index df477de9e..bcda294c7 100644 --- a/plugins/index.js +++ b/plugins/index.js @@ -123,6 +123,14 @@ module.exports = (on, config) => { const disconnected = await metamask.disconnectWalletFromAllDapps(); return disconnected; }, + confirmMetamaskSignatureRequest: async () => { + const confirmed = await metamask.confirmSignatureRequest(); + return confirmed; + }, + rejectMetamaskSignatureRequest: async () => { + const rejected = await metamask.rejectSignatureRequest(); + return rejected; + }, confirmMetamaskPermissionToSpend: async () => { const confirmed = await metamask.confirmPermissionToSpend(); return confirmed; diff --git a/support/commands.js b/support/commands.js index 8794aae5f..94c8950e6 100644 --- a/support/commands.js +++ b/support/commands.js @@ -62,6 +62,14 @@ Cypress.Commands.add('disconnectMetamaskWalletFromAllDapps', () => { return cy.task('disconnectMetamaskWalletFromAllDapps'); }); +Cypress.Commands.add('confirmMetamaskSignatureRequest', () => { + return cy.task('confirmMetamaskSignatureRequest'); +}); + +Cypress.Commands.add('rejectMetamaskSignatureRequest', () => { + return cy.task('rejectMetamaskSignatureRequest'); +}); + Cypress.Commands.add('confirmMetamaskPermissionToSpend', () => { return cy.task('confirmMetamaskPermissionToSpend'); }); diff --git a/support/index.d.ts b/support/index.d.ts index afaffc600..e1dbae690 100644 --- a/support/index.d.ts +++ b/support/index.d.ts @@ -106,6 +106,18 @@ declare namespace Cypress { * cy.disconnectMetamaskWalletFromAllDapps() */ disconnectMetamaskWalletFromAllDapps(): Chainable; + /** + * Confirm metamask permission to sign message + * @example + * cy.confirmMetamaskSignatureRequest() + */ + confirmMetamaskSignatureRequest(): Chainable; + /** + * Reject metamask permission to sign message + * @example + * cy.rejectMetamaskSignatureRequest() + */ + rejectMetamaskSignatureRequest(): Chainable; /** * Confirm metamask permission to spend asset * @example