fix: Increase the maximum input receiving limit of alephium and optimize t…#140
fix: Increase the maximum input receiving limit of alephium and optimize t…#140guowei0105 merged 1 commit intoOneKeyHQ:masterfrom
Conversation
WalkthroughThe changes improve error reporting for Alephium transaction decoding. When decoding fails due to too many inputs, the code now sends a specific error message with the maximum allowed inputs. The maximum number of allowed inputs is also increased from 8 to 16. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant Device
User->>Device: Request to sign Alephium transaction
Device->>Device: Decode transaction
alt Decoding fails due to too many inputs
Device->>User: Failure message (too many inputs, max is 16)
else Decoding fails for other reasons
Device->>User: Failure message (Failed to decode transaction)
else Decoding succeeds
Device->>User: Continue signing process
end
✨ Finishing Touches
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge Base: Disabled due to data retention organization setting
📒 Files selected for processing (2)
legacy/firmware/alephium.c(3 hunks)legacy/firmware/alephium/alph_decode.h(1 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (1)
legacy/firmware/alephium.c (1)
legacy/firmware/fsm.h (1)
fsm_sendFailure(71-71)
⏰ Context from checks skipped due to timeout of 90000ms (3)
- GitHub Check: Style check
- GitHub Check: Gen check
- GitHub Check: Defs check
🔇 Additional comments (3)
legacy/firmware/alephium/alph_decode.h (1)
13-13: LGTM! Sensible limit increase.Doubling the input limit from 8 to 16 aligns with the PR objectives. The change is clean and simple.
legacy/firmware/alephium.c (2)
50-61: Excellent error message improvement!The specific error message for too many inputs is much more helpful than the generic failure. Good use of
snprintfwith proper buffer bounds.
137-147: Consistent error handling pattern applied.Same improvement as in
alephium_sign_tx. The pattern is identical, which ensures consistent user experience across different code paths.
…he error messag
Summary by CodeRabbit