Skip to content

Commit 23bbc8d

Browse files
authored
Merge branch 'main' into sign_msg_section_design_fix
2 parents e230347 + a31d808 commit 23bbc8d

File tree

5 files changed

+101
-61
lines changed

5 files changed

+101
-61
lines changed

test/e2e/page-objects/pages/test-dapp.ts

+20
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,26 @@ class TestDapp {
321321
});
322322
}
323323

324+
/**
325+
* Verifies the accounts connected to the test dapp.
326+
*
327+
* @param connectedAccounts - The expected connected accounts separated by a comma. If no accounts are connected we can omit the param.
328+
*/
329+
async check_connectedAccounts(connectedAccounts: string = '') {
330+
console.log('Verify connected accounts');
331+
if (connectedAccounts) {
332+
await this.driver.waitForSelector({
333+
css: this.connectedAccount,
334+
text: connectedAccounts,
335+
});
336+
} else {
337+
await this.driver.waitForSelector({
338+
css: this.connectedAccount,
339+
text: ' ',
340+
});
341+
}
342+
}
343+
324344
/**
325345
* Verify the failed personal sign signature.
326346
*

test/e2e/tests/request-queuing/sendTx-revokePermissions.spec.js

-58
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
import { loginWithBalanceValidation } from '../../page-objects/flows/login.flow';
2+
import TestDapp from '../../page-objects/pages/test-dapp';
3+
import TransactionConfirmation from '../../page-objects/pages/confirmations/redesign/transaction-confirmation';
4+
import { Ganache } from '../../seeder/ganache';
5+
import { Driver } from '../../webdriver/driver';
6+
import { DEFAULT_FIXTURE_ACCOUNT } from '../../constants';
7+
import FixtureBuilder from '../../fixture-builder';
8+
import {
9+
withFixtures,
10+
defaultGanacheOptions,
11+
WINDOW_TITLES,
12+
} from '../../helpers';
13+
14+
describe('Request Queuing', function () {
15+
// TODO: add a new spec which checks that after revoking and connecting again
16+
// a pending tx is still closed when using revokePermissions.
17+
// To be done once this bug is fixed: #29272
18+
it('should clear tx confirmation when revokePermission is called from origin dapp', async function () {
19+
await withFixtures(
20+
{
21+
dapp: true,
22+
fixtures: new FixtureBuilder()
23+
.withPermissionControllerConnectedToTestDapp()
24+
.withPreferencesControllerUseRequestQueueEnabled()
25+
.withSelectedNetworkControllerPerDomain()
26+
.build(),
27+
ganacheOptions: {
28+
...defaultGanacheOptions,
29+
},
30+
title: this.test?.fullTitle(),
31+
},
32+
async ({
33+
driver,
34+
ganacheServer,
35+
}: {
36+
driver: Driver;
37+
ganacheServer?: Ganache;
38+
}) => {
39+
await loginWithBalanceValidation(driver, ganacheServer);
40+
41+
// Open test dapp
42+
const testDapp = new TestDapp(driver);
43+
await testDapp.openTestDappPage();
44+
await testDapp.check_connectedAccounts(
45+
DEFAULT_FIXTURE_ACCOUNT.toLowerCase(),
46+
);
47+
48+
// Trigger a tx
49+
await testDapp.clickSimpleSendButton();
50+
await driver.switchToWindowWithTitle(WINDOW_TITLES.Dialog);
51+
52+
const transactionConfirmation = new TransactionConfirmation(driver);
53+
await transactionConfirmation.check_dappInitiatedHeadingTitle();
54+
55+
// wallet_revokePermissions request
56+
const revokePermissionsRequest = JSON.stringify({
57+
jsonrpc: '2.0',
58+
method: 'wallet_revokePermissions',
59+
params: [
60+
{
61+
eth_accounts: {},
62+
},
63+
],
64+
});
65+
await driver.switchToWindowWithTitle(WINDOW_TITLES.TestDApp);
66+
await driver.executeScript(
67+
`return window.ethereum.request(${revokePermissionsRequest})`,
68+
);
69+
70+
// Should have cleared the tx confirmation
71+
await driver.waitUntilXWindowHandles(2);
72+
73+
// Cleared eth_accounts account label
74+
await testDapp.check_connectedAccounts();
75+
},
76+
);
77+
});
78+
});

ui/pages/confirmations/components/advanced-gas-fee-popover/advanced-gas-fee-gas-limit/advanced-gas-fee-gas-limit.test.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ describe('AdvancedGasFeeGasLimit', () => {
101101
),
102102
).toBeInTheDocument();
103103
fireEvent.change(document.getElementsByTagName('input')[0], {
104-
target: { value: 8000000 },
104+
target: { value: 80000000 },
105105
});
106106
expect(
107107
screen.queryByText(
@@ -154,7 +154,7 @@ describe('AdvancedGasFeeGasLimit', () => {
154154
);
155155
expect(
156156
screen.queryByText(
157-
`Gas limit must be greater than 29999 and less than 7920050`,
157+
`Gas limit must be greater than 29999 and less than 30000000`,
158158
),
159159
).toBeInTheDocument();
160160
});

ui/pages/confirmations/send/send.constants.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { EtherDenomination } from '../../../../shared/constants/common';
55
const MIN_GAS_PRICE_DEC = '0';
66
const MIN_GAS_PRICE_HEX = parseInt(MIN_GAS_PRICE_DEC, 10).toString(16);
77
const MIN_GAS_LIMIT_DEC = new Numeric('21000', 10);
8-
const MAX_GAS_LIMIT_DEC = '7920027';
8+
const MAX_GAS_LIMIT_DEC = '30000000';
99

1010
const HIGH_FEE_WARNING_MULTIPLIER = 1.5;
1111
const MIN_GAS_PRICE_GWEI = new Numeric(

0 commit comments

Comments
 (0)