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
-
Add verifyLedgerAppOpen calls to the base implementation in EvmBaseAdapter for:
getAddress
signTransaction
signAndBroadcastTransaction
-
Remove duplicate verifyLedgerAppOpen calls from child adapter implementations that extend EvmBaseAdapter
-
Ensure child adapters can still extend with their own logic when needed
Effort Estimate
Approximately 1 hour
References
Requested by: @gomesalexandre