fix: resolve timestamp heuristic, event sequence gap, network passphrase validation, and Module49 progress bugs (#544, #543, #542, #546) - #592
Open
Sweet-Kid wants to merge 6 commits into
Conversation
…digit-count heuristic The old threshold (value < 1e12 ⇒ seconds) misclassified pre-2001 millisecond timestamps and post-33658 second timestamps. Use digit count instead: 10 digits ⇒ seconds, 13 ⇒ ms.
…faces Events without a topics[2] sequence slot will carry undefined for sequence, matching the updated dispatchEvent return behavior.
…quence topic dispatchEvent previously returned 0n for events without topics[2], which caused spurious onGap calls and reset lastSequence to 0n. Now returns undefined so the poll loop's sequence !== undefined guard works correctly.
…Transaction objects KeypairWalletAdapter.signTransaction previously ignored opts.networkPassphrase when given a Transaction object, allowing a testnet-signed transaction to be validly signed for mainnet. Now asserts tx.networkPassphrase matches the caller's opts.networkPassphrase before signing (when both are defined).
…gress/normalizeProgress Module49.processSingleItem reimplemented progress logic (returning 0.5 for open-ended streams) instead of using the shared utils.streamProgress and normalizeProgress. This duplicated Module48's pre-conduit-protocol#433 bug and diverged from the canonical NaN→0.5 mapping. Now delegates to the shared functions like Module48.
…defined for missing sequence The clawback event in the test has only 2 topics (no topics[2] sequence slot), so sequence is now undefined instead of 0n.
|
@Sweet-Kid Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
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.
PR Description
Bug Fixes
asTimestampseconds-vs-ms heuristic (< 1e12) misclassifies pre-2001 millisecond timestamps #544 — asTimestamp seconds-vs-ms heuristic misclassifies pre-2001 millisecond timestampscloses Bug:
dispatchEventreturns0n(notundefined) for events missing the sequence topic, causing spuriousonGapcalls #543 — dispatchEvent returns 0n for events missing the sequence topiccloses Bug:
KeypairWalletAdapter.signTransaction(Transaction, opts)ignoresopts.networkPassphraseand never verifies the tx's network #542 — KeypairWalletAdapter.signTransaction ignores opts.networkPassphrasecloses Enhancement:
Module49is an undocumented fourth copy of the Module26/36/48 engine and reintroduces the #433 open-ended-progress bug #546 — Module49 reimplements progress calculation, reintroduces Bug: Module48.processSingleItem() reimplements streamProgress() and reintroduces the pre-#181 open-ended-progress bug #433 bug