Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

generate test vectors for expected hardware wallet UI output #4948

Open
wants to merge 27 commits into
base: main
Choose a base branch
from

Conversation

redshiftzero
Copy link
Member

@redshiftzero redshiftzero commented Dec 2, 2024

Describe your changes

Work towards generating screens for hardware wallet UI output from our EffectHash transaction plans added in #4879

Caveats:

  • Sometimes the correct behavior is that the Ledger should refuse to sign. For example, if both of the inputs to a swap are non-zero. In that situation, the output includes the string PANIC [X/X] : LEDGER SHOULD REFUSE TO SIGN along with the reason, e.g. PANIC [X/X] : LEDGER SHOULD REFUSE TO SIGN (return address in Ics20Withdrawal not controlled by user).
  • The supported action types: Spend, Output, Ics20Withdrawal, Swap, ActionDutchAuctionEnd, ActionDutchAuctionSchedule, ActionDutchAuctionWithdraw, PositionWithdraw, PositionClose, PositionOpen, DelegatorVote, UndelegateClaim, Delegate, Undelegate. For other actions, there will be no output for those actions.

Issue ticket number and link

Closes #4947

Checklist before requesting a review

  • I have added guiding text to explain how a reviewer should test these changes.

  • If this code contains consensus-breaking changes, I have added the "consensus-breaking" label. Otherwise, I declare my belief that there are not consensus-breaking changes, for the following reason:

    This is a testing tool only

Previously, we were generating the addresses randomly. This is good
for some cases but there are situations where we have different
expected behavior if the address is controlled by the user:
1. In an `Ics20Withdrawal`, we want a return address controlled
by the user, else fail to sign.
2. In a `Swap`, the claim address should be controlled by the
user, else fail to sign.
Tier 1 actions are: Spend, Output, Swap, Ics20Withdrawal
Note there is NO output for the other actions yet.
@redshiftzero redshiftzero changed the title wip: generate test vectors for expected hardware wallet UI output generate test vectors for expected hardware wallet UI output Dec 17, 2024
@redshiftzero redshiftzero marked this pull request as ready for review December 17, 2024 22:13
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.

extend TransactionPlan/EffectHash test vectors to also include expected hardware wallet UI output
1 participant