π¨ (clear-sign-tester) [DSDK-1062]: Make clear-sign-tester chain-agnostic#1374
Open
fAnselmi-Ledger wants to merge 3 commits intodevelopfrom
Open
π¨ (clear-sign-tester) [DSDK-1062]: Make clear-sign-tester chain-agnostic#1374fAnselmi-Ledger wants to merge 3 commits intodevelopfrom
fAnselmi-Ledger wants to merge 3 commits intodevelopfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
Contributor
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refactors the clear-signing-tester app to be chain-agnostic by splitting the signing abstractions, introducing a discriminated SignableInput union, and making orchestration/signing dispatch configurable via DI rather than hardcoded Ethereum assumptions.
Changes:
- Split
SigningServiceintoTransactionSigningServiceandTypedDataSigningService, and propagateSignableInputthrough the domain/application/infrastructure layers. - Replace
DeviceRepository.performSignTransaction()/performSignTypedData()with a singleperformSign()that dispatches byinput.kind. - Parameterize Speculos app loading via
SpeculosConfig.appNameand inject βsignable interactionsβ intoDefaultFlowOrchestrator.
Reviewed changes
Copilot reviewed 34 out of 34 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| apps/clear-signing-tester/src/infrastructure/state-handlers/StateHandler.ts | Updates handler input type to SignableInput. |
| apps/clear-signing-tester/src/infrastructure/state-handlers/SignTransactionStateHandler.ts | Updates handler signature to accept SignableInput. |
| apps/clear-signing-tester/src/infrastructure/state-handlers/OptOutStateHandler.ts | Updates handler signature to accept SignableInput. |
| apps/clear-signing-tester/src/infrastructure/state-handlers/ErrorStateHandler.ts | Updates handler signature to accept SignableInput. |
| apps/clear-signing-tester/src/infrastructure/state-handlers/CompleteStateHandler.ts | Updates handler signature to accept SignableInput. |
| apps/clear-signing-tester/src/infrastructure/services/DefaultSigningService.ts | Implements new signing interfaces; keeps concrete signer wiring. |
| apps/clear-signing-tester/src/infrastructure/services/DefaultFlowOrchestrator.ts | Accepts SignableInput and injects signable interactions set. |
| apps/clear-signing-tester/src/infrastructure/service-controllers/SpeculosServiceController.ts | Adds configurable app name resolution for Speculos app loading. |
| apps/clear-signing-tester/src/infrastructure/service-controllers/DMKServiceController.ts | Switches signing service injection to concrete DefaultSigningService. |
| apps/clear-signing-tester/src/infrastructure/repositories/TypedDataFileRepository.ts | Emits TypedData inputs with kind discriminant. |
| apps/clear-signing-tester/src/infrastructure/repositories/TransactionFileRepository.ts | Emits transaction inputs with kind discriminant. |
| apps/clear-signing-tester/src/infrastructure/repositories/SpeculosDeviceRepository.ts | Consolidates signing entrypoint to performSign() and dispatches by kind. |
| apps/clear-signing-tester/src/index.ts | Reorders/extends public exports to include signable models. |
| apps/clear-signing-tester/src/domain/types/TestStatus.ts | Updates TestResult.input to SignableInput. |
| apps/clear-signing-tester/src/domain/services/TypedDataSigningService.ts | Introduces typed-data signing interface. |
| apps/clear-signing-tester/src/domain/services/TransactionSigningService.ts | Introduces transaction signing interface + shared result type. |
| apps/clear-signing-tester/src/domain/services/SigningService.ts | Removes old combined signing interface. |
| apps/clear-signing-tester/src/domain/services/FlowOrchestrator.ts | Updates orchestrator to accept SignableInput and new result type import. |
| apps/clear-signing-tester/src/domain/repositories/DeviceRepository.ts | Replaces two sign methods with single performSign(SignableInput, ...). |
| apps/clear-signing-tester/src/domain/models/TypedDataInput.ts | Adds kind discriminant to typed data input. |
| apps/clear-signing-tester/src/domain/models/TransactionInput.ts | Adds kind discriminant to transaction input. |
| apps/clear-signing-tester/src/domain/models/SignableInputKind.ts | Adds enum discriminant for signable inputs. |
| apps/clear-signing-tester/src/domain/models/SignableInput.ts | Adds discriminated union type for signable inputs. |
| apps/clear-signing-tester/src/domain/models/config/SpeculosConfig.ts | Adds appName config option for selecting Ledger app to load. |
| apps/clear-signing-tester/src/di/types.ts | Adds DI tokens for split signing services + signable interactions set. |
| apps/clear-signing-tester/src/di/modules/infrastructureModuleFactory.ts | Rebinds signing services and provides signable interactions set via DI. |
| apps/clear-signing-tester/src/cli/EthereumTransactionTesterCli.ts | Adds kind when constructing signable inputs. |
| apps/clear-signing-tester/src/application/usecases/TestTypedDataUseCase.ts | Switches to deviceRepository.performSign(). |
| apps/clear-signing-tester/src/application/usecases/TestTransactionUseCase.ts | Switches to deviceRepository.performSign(). |
| apps/clear-signing-tester/src/application/usecases/TestContractUseCase.ts | Switches to performSign() and adds transaction kind discriminant. |
| apps/clear-signing-tester/src/application/usecases/TestBatchTypedDataFromFileUseCase.ts | Switches to performSign() in batch runner. |
| apps/clear-signing-tester/src/application/usecases/TestBatchTransactionFromFileUseCase.ts | Switches to performSign() in batch runner. |
| apps/clear-signing-tester/src/application/usecases/TestBatchFromFileUseCase.ts | Generalizes batch runner generic bound to SignableInput. |
| apps/clear-signing-tester/src/application/usecases/TestBatchContractFromFileUseCase.ts | Adds kind to synthesized TestResult.input rows. |
π‘ Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
apps/clear-signing-tester/src/infrastructure/services/DefaultSigningService.ts
Outdated
Show resolved
Hide resolved
apps/clear-signing-tester/src/infrastructure/services/DefaultSigningService.ts
Outdated
Show resolved
Hide resolved
apps/clear-signing-tester/src/infrastructure/service-controllers/SpeculosServiceController.ts
Show resolved
Hide resolved
apps/clear-signing-tester/src/infrastructure/repositories/SpeculosDeviceRepository.ts
Outdated
Show resolved
Hide resolved
apps/clear-signing-tester/src/infrastructure/service-controllers/DMKServiceController.ts
Show resolved
Hide resolved
8526fd9 to
ecd30f2
Compare
aussedatlo
reviewed
Mar 20, 2026
Contributor
aussedatlo
left a comment
There was a problem hiding this comment.
Don't forget to run nightly jobs to see if everything is working as intended
apps/clear-signing-tester/src/infrastructure/repositories/SpeculosDeviceRepository.ts
Outdated
Show resolved
Hide resolved
a4bce32 to
93d75d5
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
π Description
SigningServiceinterface intoTransactionSigningServiceandTypedDataSigningService, removing allSignerEthimports from the domain layer.SignableInputdiscriminated union so shared infrastructure handles any signing input generically.DeviceRepository.performSignTransaction()/performSignTypedData()with a singleperformSign()that dispatches by input kind.FlowOrchestratorconfigurable by injecting which user interactions trigger signing via DI, instead of hardcoding them.This is the first epic related to this study https://ledgerhq.atlassian.net/wiki/spaces/WXP/pages/6922174534/Solana+Signer+Support+for+Clear-Sign-Tester
β Context
β Checklist
Pull Requests must pass CI checks and undergo code review. Set the PR as Draft if it is not yet ready for review.
π§ Checklist for the PR Reviewers