diff --git a/wallets/metamask/src/metamask.ts b/wallets/metamask/src/metamask.ts index f8514405a..14f7b1213 100644 --- a/wallets/metamask/src/metamask.ts +++ b/wallets/metamask/src/metamask.ts @@ -169,15 +169,7 @@ export class MetaMask { // ---- EXPERIMENTAL FEATURES ---- - public readonly experimental = { - confirmTransactionAndWaitForMining: async (options?: { gasSetting?: GasSetting }) => - await this.confirmTransactionAndWaitForMining(options), - // Note: `txIndex` starts from 0. - openTransactionDetails: async (txIndex: number) => await this.openTransactionDetails(txIndex), - closeTransactionDetails: async () => await this.closeTransactionDetails() - } - - private async confirmTransactionAndWaitForMining(options?: { gasSetting?: GasSetting }) { + async confirmTransactionAndWaitForMining(options?: { gasSetting?: GasSetting }) { if (!this.extensionId) { throw NO_EXTENSION_ID_ERROR } @@ -185,11 +177,12 @@ export class MetaMask { await this.notificationPage.confirmTransactionAndWaitForMining(this.extensionId, options) } - private async openTransactionDetails(txIndex: number) { + // Note: `txIndex` starts from 0. + async openTransactionDetails(txIndex: number) { await this.homePage.openTransactionDetails(txIndex) } - private async closeTransactionDetails() { + async closeTransactionDetails() { await this.homePage.closeTransactionDetails() } } diff --git a/wallets/metamask/test/e2e/metamask/closeTransactionDetails.spec.ts b/wallets/metamask/test/e2e/metamask/closeTransactionDetails.spec.ts index 57f54c771..7cd7c16a4 100644 --- a/wallets/metamask/test/e2e/metamask/closeTransactionDetails.spec.ts +++ b/wallets/metamask/test/e2e/metamask/closeTransactionDetails.spec.ts @@ -8,11 +8,11 @@ test('should close transaction details', async ({ page, metamask, metamaskPage, await connectToAnvil() await page.locator('#sendEIP1559Button').click() - await metamask.experimental.confirmTransactionAndWaitForMining() + await metamask.confirmTransactionAndWaitForMining() - await metamask.experimental.openTransactionDetails(0) + await metamask.openTransactionDetails(0) - await metamask.experimental.closeTransactionDetails() + await metamask.closeTransactionDetails() await expect(metamaskPage.locator(metamask.homePage.selectors.popover.closeButton)).toBeHidden() }) diff --git a/wallets/metamask/test/e2e/metamask/confirmTransactionAndWaitForMining.spec.ts b/wallets/metamask/test/e2e/metamask/confirmTransactionAndWaitForMining.spec.ts index e08452511..c0b4b6890 100644 --- a/wallets/metamask/test/e2e/metamask/confirmTransactionAndWaitForMining.spec.ts +++ b/wallets/metamask/test/e2e/metamask/confirmTransactionAndWaitForMining.spec.ts @@ -12,7 +12,7 @@ test.skip('should confirm contract deployment and wait for mining', async ({ pag await expect(page.locator('#tokenAddresses')).toBeEmpty() await page.locator('#createToken').click() - await metamask.experimental.confirmTransactionAndWaitForMining() + await metamask.confirmTransactionAndWaitForMining() await expect(page.locator('#tokenAddresses')).toContainText(/^0x/) }) @@ -22,7 +22,7 @@ test.skip('should confirm legacy transaction and wait for mining', async ({ page await page.locator('#sendButton').click() - await metamask.experimental.confirmTransactionAndWaitForMining() + await metamask.confirmTransactionAndWaitForMining() }) test.skip('should confirm EIP-1559 transaction and wait for mining', async ({ page, metamask, connectToAnvil }) => { @@ -30,7 +30,7 @@ test.skip('should confirm EIP-1559 transaction and wait for mining', async ({ pa await page.locator('#sendEIP1559Button').click() - await metamask.experimental.confirmTransactionAndWaitForMining() + await metamask.confirmTransactionAndWaitForMining() }) test.skip('should work correctly when calling sequentially', async ({ page, metamask, connectToAnvil }) => { @@ -40,11 +40,11 @@ test.skip('should work correctly when calling sequentially', async ({ page, meta await connectToAnvil() await page.locator('#sendEIP1559Button').click() - await metamask.experimental.confirmTransactionAndWaitForMining() + await metamask.confirmTransactionAndWaitForMining() await page.locator('#sendEIP1559Button').click() - await metamask.experimental.confirmTransactionAndWaitForMining() + await metamask.confirmTransactionAndWaitForMining() await page.locator('#sendEIP1559Button').click() - await metamask.experimental.confirmTransactionAndWaitForMining() + await metamask.confirmTransactionAndWaitForMining() }) diff --git a/wallets/metamask/test/e2e/metamask/openTransactionDetails.spec.ts b/wallets/metamask/test/e2e/metamask/openTransactionDetails.spec.ts index 7b0dece03..12a9ffebe 100644 --- a/wallets/metamask/test/e2e/metamask/openTransactionDetails.spec.ts +++ b/wallets/metamask/test/e2e/metamask/openTransactionDetails.spec.ts @@ -8,15 +8,15 @@ test('should open transaction details', async ({ page, metamask, metamaskPage, c await connectToAnvil() await page.locator('#sendEIP1559Button').click() - await metamask.experimental.confirmTransactionAndWaitForMining() + await metamask.confirmTransactionAndWaitForMining() - await metamask.experimental.openTransactionDetails(0) + await metamask.openTransactionDetails(0) await expect(metamaskPage.locator(metamask.homePage.selectors.popover.closeButton)).toBeVisible() }) test('should throw an error if the passed transaction index is out of bounds', async ({ metamask }) => { - await expect(metamask.experimental.openTransactionDetails(0)).rejects.toThrowError( + await expect(metamask.openTransactionDetails(0)).rejects.toThrowError( '[OpenTransactionDetails] Transaction with index 0 is not visible. There are only 0 transactions visible.' ) })