Skip to content

Refactor: Leverage EvmBaseAdapter for Ledger app gating across all EVM chain adapters #11478

@coderabbitai

Description

@coderabbitai

Context

In PR #11450, Ledger app verification was added to the Sui chain adapter by manually calling verifyLedgerAppOpen in multiple methods (getAddress, signTransaction, signAndBroadcastTransaction).

For chain adapters that extend EvmBaseAdapter, this creates code duplication. We should leverage OOP principles to move the Ledger app gating logic to the base adapter implementation.

Objective

Move Ledger app-gating logic to EvmBaseAdapter so that:

  • Child adapters automatically inherit the gating behavior
  • Child adapters can extend with their own logic as needed
  • Code duplication is eliminated across second-class EVM chain adapters

Proposed Changes

  1. Add verifyLedgerAppOpen calls to the base implementation in EvmBaseAdapter for:

    • getAddress
    • signTransaction
    • signAndBroadcastTransaction
  2. Remove duplicate verifyLedgerAppOpen calls from child adapter implementations that extend EvmBaseAdapter

  3. Ensure child adapters can still extend with their own logic when needed

Effort Estimate

Approximately 1 hour

References

Requested by: @gomesalexandre

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions