Skip to content

Commit

Permalink
fix: Revert "fix: remove submitRequest from dapp permission" (#26293)
Browse files Browse the repository at this point in the history
  • Loading branch information
Gudahtt authored and dawnseeker8 committed Aug 12, 2024
1 parent 174731a commit be5ca01
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ describe('keyringSnapPermissionsBuilder', () => {
KeyringRpcMethod.GetRequest,
KeyringRpcMethod.ApproveRequest,
KeyringRpcMethod.RejectRequest,
KeyringRpcMethod.SubmitRequest,
]);
});

Expand Down
2 changes: 1 addition & 1 deletion app/scripts/lib/snap-keyring/keyring-snaps-permissions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ const METAMASK_ALLOWED_METHODS: string[] = [

/**
* List of keyring methods a dapp can call.
* !NOTE: DO NOT INCLUDE `KeyringRpcMethod.SubmitRequest` IN THIS LIST.
*/
const WEBSITE_ALLOWED_METHODS: string[] = [
KeyringRpcMethod.ListAccounts,
Expand All @@ -47,6 +46,7 @@ const WEBSITE_ALLOWED_METHODS: string[] = [
KeyringRpcMethod.GetRequest,
KeyringRpcMethod.ApproveRequest,
KeyringRpcMethod.RejectRequest,
KeyringRpcMethod.SubmitRequest,
];

/**
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export const BUNDLER_URL = 'http://localhost:3000/rpc';

/* URL of the 4337 account snap site. */
export const ERC_4337_ACCOUNT_SNAP_URL =
'https://metamask.github.io/snap-account-abstraction-keyring/0.4.0/';
'https://metamask.github.io/snap-account-abstraction-keyring/0.2.2/';

/* Salt used to generate the 4337 account. */
export const ERC_4337_ACCOUNT_SALT = '0x1';
Expand Down
32 changes: 9 additions & 23 deletions test/e2e/flask/user-operations.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,38 +76,24 @@ async function setSnapConfig(
entrypoint,
simpleAccountFactory,
paymaster,
paymasterSK,
}: {
bundlerUrl: string;
entrypoint: string;
simpleAccountFactory: string;
paymaster?: string;
paymasterSK?: string;
},
) {
await driver.switchToWindowWithTitle('Account Abstraction Snap');
await driver.clickElement('[data-testid="chain-select"]');
await driver.clickElement('[data-testid="chain-id-1337"]');
await driver.fill('[data-testid="bundlerUrl"]', bundlerUrl);
await driver.fill('[data-testid="entryPoint"]', entrypoint);
await driver.fill(
'[data-testid="simpleAccountFactory"]',
const data = JSON.stringify({
bundlerUrl,
entryPoint: entrypoint,
simpleAccountFactory,
);
if (paymaster) {
await driver.fill(
'[data-testid="customVerifyingPaymasterAddress"]',
paymaster,
);
}
if (paymasterSK) {
await driver.fill(
'[data-testid="customVerifyingPaymasterSK"]',
paymasterSK,
);
}
customVerifyingPaymasterAddress: paymaster,
});

await driver.clickElement({ text: 'Set Chain Config', tag: 'button' });
await driver.switchToWindowWithTitle('Account Abstraction Snap');
await driver.clickElement({ text: 'Set Chain Config' });
await driver.fill('#set-chain-config-chain-config-object', data);
await driver.clickElement({ text: 'Set Chain Configs', tag: 'button' });
}

async function createSwap(driver: Driver) {
Expand Down

0 comments on commit be5ca01

Please sign in to comment.