Skip to content

chore(js-ts): Type signatureRequest reducer and remove any from RootState#978

Open
devin-ai-integration[bot] wants to merge 1 commit into
mainfrom
chore/js-ts-signature-request-reducer-318
Open

chore(js-ts): Type signatureRequest reducer and remove any from RootState#978
devin-ai-integration[bot] wants to merge 1 commit into
mainfrom
chore/js-ts-signature-request-reducer-318

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented Jun 23, 2026

Copy link
Copy Markdown

Summary

Part of Workstream 4 (type Redux reducers, eliminate any from RootState). The signatureRequest reducer and action were already TypeScript, so this only exports the state interface and wires it into RootState:

// app/reducers/signatureRequest/index.ts
export interface SignatureRequestState { securityAlertResponse?: SecurityAlertResponse; }

// app/reducers/index.ts
- signatureRequest: any;   // + eslint-disable
+ signatureRequest: SignatureRequestState;

Cascade (errors previously hidden by any)

The reducer state stores the BlockaidBanner SecurityAlertResponse (enum reason/result_type, features: (string | Record)[]), which is not assignable to the transaction-controller SecurityAlertResponse (features: string[]) that selectSignatureSecurityAlertResponse declares and its consumers rely on (it's ??-merged with transactionMetadata.securityAlertResponse). These two types genuinely diverge, so the selector now casts at that boundary to preserve its existing public contract:

): { securityAlertResponse: SecurityAlertResponse /* tx-controller */ } =>
  rootState.signatureRequest as unknown as { securityAlertResponse: SecurityAlertResponse };

Test fixtures that put a securityAlertResponse into the now-typed signatureRequest slot are reconciled by typing the shared securityAlertResponse helper in confirm-data-helpers.ts as the BlockaidBanner shape (fixes security-alerts, confirm-component, useSignatureMetrics, useSecurityAlertResponse, signature-blockaid-banner tests transitively). TypedSign/index.test.tsx's inline fixture and initial-root-state.ts (signatureRequest: {}) are adjusted directly.

Behavior is unchanged — types only.

Validation

  • yarn tsc — 0 errors
  • yarn lint — 0 errors (warnings only)
  • yarn jest on the affected selector/hook/component tests — 33 tests pass

Link to Devin session: https://app.devin.ai/sessions/150060d9c6a14a1b9ee04e5a407b3f8b
Requested by: @WesternConcrete


Devin Review

Status Commit
⚪ Not started

Run Devin Review

Open in Devin Review (Staging)

Export the SignatureRequestState interface from the signatureRequest reducer
and use it in RootState instead of any. Fix cascading type errors surfaced in
the security-alerts selector and test fixtures previously hidden by any.

Co-Authored-By: Wes Convery <2wconvery@gmail.com>
@devin-ai-integration

Copy link
Copy Markdown
Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants