Skip to content

Commit 3556c3c

Browse files
fix(simulation): Unintentionally narrow type for onKeyringRequest helper (#3109)
Fixes an unnecessarily narrow type for `onKeyringRequest` that makes it seem like the request cannot produce interfaces.
1 parent f4662e9 commit 3556c3c

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

packages/snaps-simulation/src/helpers.ts

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -141,9 +141,7 @@ export type SnapHelpers = {
141141
* @param keyringRequest - Keyring request.
142142
* @returns The response.
143143
*/
144-
onKeyringRequest(
145-
keyringRequest: KeyringOptions,
146-
): Promise<SnapResponseWithoutInterface>;
144+
onKeyringRequest(keyringRequest: KeyringOptions): SnapRequest;
147145

148146
/**
149147
* Get the response from the Snap's `onInstall` handler.
@@ -270,12 +268,10 @@ export function getHelpers({
270268
});
271269
};
272270

273-
const onKeyringRequest = async (
274-
request: KeyringOptions,
275-
): Promise<SnapResponseWithoutInterface> => {
271+
const onKeyringRequest = (request: KeyringOptions) => {
276272
log('Sending keyring request %o.', request);
277273

278-
const response = await handleRequest({
274+
return handleRequest({
279275
snapId,
280276
store,
281277
executionService,
@@ -284,8 +280,6 @@ export function getHelpers({
284280
handler: HandlerType.OnKeyringRequest,
285281
request,
286282
});
287-
288-
return response;
289283
};
290284

291285
return {

0 commit comments

Comments
 (0)