Feat/kaspa tx parse#839
Merged
Merged
Conversation
- Sync protobuf messages from firmware e6ffa3157: prev-tx request flow (KaspaTxAckPrevMeta/PrevInput/PrevOutput, KASPA_TX_PREV_META, prev_tx_id on KaspaTxRequest) and required-field tightening. - Add optional refTxs param; answer device prev-tx requests from it and reject them clearly when the referenced tx is missing, instead of silently answering with current-tx data. - Pin TonSignData.timestamp to UintType via protobuf-patches so clean regenerations keep the published type (hand-edited in #778).
Absent optional message-type fields are not own properties of the protobufjs-decoded instance, so messageToJSON recursed into undefined and threw a raw TypeError. Surfaced by the Kaspa streaming flow: the device's first KaspaTxRequest legitimately carries no signature yet. Decode them to null, mirroring the optional primitive-field convention.
Streaming input verification needs the referenced previous transactions; without refTxs the session would die on the device's first prev-tx request. Send the plain legacy packet instead when blind signing is available. A streaming-only tx (payload/gas or no scripts) still streams — its only chance — and fails clearly if prev txs are requested. Also condense comments and drop a redundant test case.
Replace `output.script ?? ''` (would silently hash an empty script into the sighash) and `input.output.script!` (crashes with an opaque TypeError) with explicit guards that throw CallMethodInvalidParameter. The supportsLegacy gate already guarantees scripts are present before serialize runs, so this never triggers today; it hardens the invariant against future gate changes.
ByteZhang1024
enabled auto-merge (squash)
July 16, 2026 12:06
wabicai
approved these changes
Jul 16, 2026
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.
No description provided.