Skip to content

Commit

Permalink
fix(simulation): Unintentionally narrow type for onKeyringRequest h…
Browse files Browse the repository at this point in the history
…elper (#3109)

Fixes an unnecessarily narrow type for `onKeyringRequest` that makes it
seem like the request cannot produce interfaces.
  • Loading branch information
FrederikBolding authored Feb 14, 2025
1 parent f4662e9 commit 3556c3c
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions packages/snaps-simulation/src/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,7 @@ export type SnapHelpers = {
* @param keyringRequest - Keyring request.
* @returns The response.
*/
onKeyringRequest(
keyringRequest: KeyringOptions,
): Promise<SnapResponseWithoutInterface>;
onKeyringRequest(keyringRequest: KeyringOptions): SnapRequest;

/**
* Get the response from the Snap's `onInstall` handler.
Expand Down Expand Up @@ -270,12 +268,10 @@ export function getHelpers({
});
};

const onKeyringRequest = async (
request: KeyringOptions,
): Promise<SnapResponseWithoutInterface> => {
const onKeyringRequest = (request: KeyringOptions) => {
log('Sending keyring request %o.', request);

const response = await handleRequest({
return handleRequest({
snapId,
store,
executionService,
Expand All @@ -284,8 +280,6 @@ export function getHelpers({
handler: HandlerType.OnKeyringRequest,
request,
});

return response;
};

return {
Expand Down

0 comments on commit 3556c3c

Please sign in to comment.