Skip to content

Commit 52b0346

Browse files
committed
Use methodNotSupported instead of resourceNotFound when no middleware is configured for EIP-7715 methods.
1 parent 44280d9 commit 52b0346

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

src/methods/wallet-request-execution-permissions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ export async function walletRequestExecutionPermissions(
7676
},
7777
): Promise<void> {
7878
if (!processRequestExecutionPermissions) {
79-
throw rpcErrors.resourceNotFound(
79+
throw rpcErrors.methodNotSupported(
8080
'wallet_requestExecutionPermissions - no middleware configured',
8181
);
8282
}

src/methods/wallet-revoke-execution-permission.test.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,9 @@ describe('wallet_revokeExecutionPermission', () => {
5858
it('throws if no hook', async () => {
5959
await expect(
6060
walletRevokeExecutionPermission(request, response, {}),
61-
).rejects.toThrow('Resource not found.');
61+
).rejects.toThrow(
62+
'wallet_revokeExecutionPermission - no middleware configured',
63+
);
6264
});
6365

6466
it('throws if no params', async () => {

src/methods/wallet-revoke-execution-permission.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,9 @@ export async function walletRevokeExecutionPermission(
3939
},
4040
): Promise<void> {
4141
if (!processRevokeExecutionPermission) {
42-
throw rpcErrors.resourceNotFound();
42+
throw rpcErrors.methodNotSupported(
43+
'wallet_revokeExecutionPermission - no middleware configured',
44+
);
4345
}
4446

4547
const { params } = req;

0 commit comments

Comments
 (0)