Skip to content

Conversation

@aussedatlo
Copy link
Contributor

@aussedatlo aussedatlo commented Dec 12, 2025

πŸ“ Description

Add nightly job to test erc7730 compatible dapps with cs-teser raw-file command

❓ Context

  • Feature:

βœ… Checklist

Pull Requests must pass CI checks and undergo code review. Set the PR as Draft if it is not yet ready for review.

  • Covered by automatic tests
  • Changeset is provided
  • Documentation is up-to-date
  • Impact of the changes:
    • list of the changes

🧐 Checklist for the PR Reviewers

  • The code aligns with the requirements described in the linked JIRA or GitHub issue.
  • The PR description clearly documents the changes made and explains any technical trade-offs or design decisions.
  • There are no undocumented trade-offs, technical debt, or maintainability issues.
  • The PR has been tested thoroughly, and any potential edge cases have been considered and handled.
  • Any new dependencies have been justified and documented.

Copilot AI review requested due to automatic review settings December 12, 2025 16:16
@aussedatlo aussedatlo requested a review from a team as a code owner December 12, 2025 16:16
@vercel
Copy link

vercel bot commented Dec 12, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
device-sdk-ts-sample Ready Ready Preview Comment Dec 12, 2025 4:18pm
1 Skipped Deployment
Project Deployment Preview Comments Updated (UTC)
doc-device-management-kit Ignored Ignored Dec 12, 2025 4:18pm

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a nightly GitHub Actions workflow to test ERC7730-compatible dapps using the clear-signing-tester's raw-file command. The changes include extensive test data for multiple DeFi protocols, improvements to error handling in the clear-signing-tester, and a new automated testing infrastructure.

Key changes:

  • New GitHub Actions workflow for nightly ERC7730 testing across multiple devices and protocols
  • Added test data files for 13+ protocols including 1inch, Aave, Lido, Uniswap, and others
  • Enhanced error state handling with blind signing acknowledgement capability
  • Reorganized test resources into core and erc7730 subdirectories

Reviewed changes

Copilot reviewed 45 out of 50 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
.github/workflows/erc7730_nightly.yml New workflow for nightly ERC7730 testing with matrix strategy for devices and providers
apps/clear-signing-tester/src/infrastructure/state-handlers/ErrorStateHandler.ts Added blind signing acknowledgement fallback in error handling
apps/clear-signing-tester/src/infrastructure/services/DefaultScreenAnalyzer.ts Implemented canAcknowledgeBlindSigning() method
apps/clear-signing-tester/src/domain/services/ScreenAnalyzer.ts Added interface method for blind signing acknowledgement
apps/clear-signing-tester/package.json Updated test scripts and added new test:erc7730 command
apps/clear-signing-tester/src/infrastructure/adapters/evm/EthersTransactionCrafter.ts Added debug logging for transaction data
packages/device-management-kit/src/internal/discovery/use-case/ConnectUseCase.ts Simplified error logging by removing detailed error data
apps/clear-signing-tester/src/infrastructure/adapters/speculos/SpeculosScreenReader.ts Simplified error logging in screen reading
apps/clear-signing-tester/ressources/erc7730/* Added comprehensive test data files for 13 protocols across multiple chains
apps/clear-signing-tester/ressources/core/* Moved and added core test data files
apps/clear-signing-tester/scripts/*.sh New utility scripts for fetching transaction data
apps/clear-signing-tester/scripts/test-full.mjs Removed file (test organization changed)

πŸ’‘ Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +89 to +91
exclude:
- include_provider:
provider: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.provider != '' && github.event.inputs.provider || 'NONE' }}
Copy link

Copilot AI Dec 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The matrix configuration has a potential issue. The exclude section attempts to exclude providers based on workflow dispatch input, but the logic uses a comparison that will exclude providers that don't match the input value. However, when no provider is specified (empty string), the comparison will match 'NONE' which won't exclude anything. Additionally, the matrix key include_provider should likely be flattened to use provider and chain directly as matrix dimensions for clearer configuration.

Copilot uses AI. Check for mistakes.
"test:raw:complete": "pnpm cli raw-file ./ressources/core/raw-complete.json",
"test:raw:multisig": "pnpm cli raw-file ./ressources/core/raw-multisig.json",
"test:typed-data:multisig": "pnpm cli typed-data-file ./ressources/core/typed-data-multisig.json",
"test:erc7730": "f() { p=$1; shift; c=''; if [ -n \"$1\" ] && [ \"${1#-}\" = \"$1\" ]; then c=\".$1\"; shift; fi; pnpm cli raw-file \"ressources/erc7730/$p/raw-$p$c.json\" \"$@\"; }; f"
Copy link

Copilot AI Dec 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The shell function in the test:erc7730 script is complex and difficult to understand. The logic for handling the optional chain parameter using shell parameter expansion makes it harder to maintain. Consider simplifying this or adding a comment explaining the parameter handling logic.

Suggested change
"test:erc7730": "f() { p=$1; shift; c=''; if [ -n \"$1\" ] && [ \"${1#-}\" = \"$1\" ]; then c=\".$1\"; shift; fi; pnpm cli raw-file \"ressources/erc7730/$p/raw-$p$c.json\" \"$@\"; }; f"
"test:erc7730": "# This function handles an optional 'chain' parameter: if the first argument after 'p' is not an option (does not start with '-'), it is treated as the chain and appended to the filename. Remaining arguments are passed to the CLI.\nf() { p=$1; shift; c=''; if [ -n \"$1\" ] && [ \"${1#-}\" = \"$1\" ]; then c=\".$1\"; shift; fi; pnpm cli raw-file \"ressources/erc7730/$p/raw-$p$c.json\" \"$@\"; }; f"

Copilot uses AI. Check for mistakes.
*/
async canAcknowledgeBlindSigning(): Promise<boolean> {
const data = await this.readScreenContent();
const acknowledgeTexts = ["reject"];
Copy link

Copilot AI Dec 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The acknowledgeTexts array only contains "reject", which seems incorrect for detecting blind signing acknowledgement. This appears to be looking for rejection text rather than acknowledgement text. This will cause the function to return true when it finds "reject" on screen, which is likely not the intended behavior for acknowledging blind signing.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants