Skip to content

fix(wallets): fix logic in validUntil behavior - #191

Merged
Shvandre merged 1 commit into
mainfrom
fix-valid-uintil
Jun 1, 2026
Merged

fix(wallets): fix logic in validUntil behavior#191
Shvandre merged 1 commit into
mainfrom
fix-valid-uintil

Conversation

@Shvandre

@Shvandre Shvandre commented Jun 1, 2026

Copy link
Copy Markdown
Collaborator

Summary by CodeRabbit

Bug Fixes

  • Standardized wallet transfer signing by ensuring timeout values are consistently processed across all transaction versions. The signing process now reliably applies provided timeouts or generates appropriate defaults, completely removing conditional logic that previously created inconsistent signing payload formats, thereby improving transaction consistency, compatibility, and overall reliability across all wallet operations.

@coderabbitai

coderabbitai Bot commented Jun 1, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 0c3814f8-1b5b-4100-91d1-ad05ed19424d

📥 Commits

Reviewing files that changed from the base of the PR and between f4adbd0 and c186c3a.

📒 Files selected for processing (1)
  • src/wallets/signing/createWalletTransfer.ts

📝 Walkthrough

Walkthrough

Timeout field encoding is standardized across five wallet transfer signing-message constructors (V2–V5R1) to always store a 32-bit timeout value. The previous conditional logic that wrote all-ones bits when seqno === 0 is removed, ensuring consistent signing payload format regardless of sequence number.

Changes

Wallet Transfer Timeout Encoding Consistency

Layer / File(s) Summary
Consistent timeout field encoding across wallet transfer versions
src/wallets/signing/createWalletTransfer.ts
Timeout field encoding in createWalletTransferV2, createWalletTransferV3, createWalletTransferV4, createWalletTransferV5Beta, and createWalletTransferV5R1 is updated to always write a 32-bit timeout value (defaulting to Math.floor(Date.now() / 1e3) + 60 when absent), replacing the prior conditional seqno === 0 bit-mask behavior.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 Five versions, one timeout they share,
No more zeros hiding in the air,
Consistent bits now dance in line,
Signing payloads, clean and fine!
The wallet hops along with glee. ✨

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Title check ⚠️ Warning The title references 'validUntil behavior' but the changes implement 'timeout' field logic in wallet transfer signing messages, not validUntil functionality. Update the title to accurately reflect the changes, such as 'fix(wallets): ensure consistent timeout field in wallet transfer signing' or similar.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix-valid-uintil

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@Shvandre
Shvandre merged commit 7f4d586 into main Jun 1, 2026
3 checks passed
@Shvandre
Shvandre deleted the fix-valid-uintil branch June 1, 2026 19:57
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