Skip to content

fix(platform-wallet): fix flaky Base58 identifier length assertion#3245

Merged
QuantumExplorer merged 1 commit intov3.1-devfrom
fix/wallet-ffi-identifier-length-assertion
Mar 14, 2026
Merged

fix(platform-wallet): fix flaky Base58 identifier length assertion#3245
QuantumExplorer merged 1 commit intov3.1-devfrom
fix/wallet-ffi-identifier-length-assertion

Conversation

@QuantumExplorer
Copy link
Member

@QuantumExplorer QuantumExplorer commented Mar 13, 2026

Issue being fixed or feature implemented

test_identifier_operations in platform-wallet-ffi intermittently fails because it asserts that a Base58-encoded 32-byte identifier is exactly 44 characters. Base58 encoding produces variable-length output (43-44 chars for 32 bytes), so the test fails when the random identifier happens to encode to 43 chars.

Discovered during CI run of #3244 — shard 6 failed with assertion left == right failed: left: 43, right: 44 at comprehensive_tests.rs:529.

What was done?

  • Changed assert_eq!(id_str.len(), 44) to accept either 43 or 44 characters, matching the actual Base58 encoding behavior

How Has This Been Tested?

  • The fix is a test-only change — the assertion now matches the correct behavior of Base58 encoding

Breaking Changes

None.

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added or updated relevant unit/integration/functional/e2e tests
  • I have added "!" to the title and described breaking changes in the corresponding section if my code contains any
  • I have made corresponding changes to the documentation if needed

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Tests
    • Updated identifier validation tests to support flexible length requirements with improved error messaging.

Base58 encoding produces variable-length output (43-44 chars for a
32-byte identifier). The test incorrectly asserted exactly 44 chars,
causing intermittent failures when the encoding produced 43 chars.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@github-actions github-actions bot added this to the v3.1.0 milestone Mar 13, 2026
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 13, 2026

📝 Walkthrough

Walkthrough

A test assertion in the comprehensive test suite was modified to relax the Base58-encoded identifier length validation from exactly 44 characters to accepting either 43 or 44 characters, with an improved error message for clarity.

Changes

Cohort / File(s) Summary
Test Assertion Flexibility
packages/rs-platform-wallet-ffi/tests/comprehensive_tests.rs
Modified Base58-encoded identifier length assertion in test_identifier_operations from enforcing exactly 44 characters to allowing either 43 or 44 characters with a descriptive error message.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 A rabbit hops through tests with glee,
When identifiers dance wild and free,
No longer locked to forty-four—
Flexibility opens a wider door!
Hop-hop-hop, the tests now sing,
With room for one (or two) to spring! 🌟

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Title check ✅ Passed The title accurately describes the main change: fixing a flaky Base58 identifier length assertion in the platform-wallet test suite.

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

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/wallet-ffi-identifier-length-assertion
📝 Coding Plan
  • Generate coding plan for human review comments

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.

@github-actions
Copy link
Contributor

✅ DashSDKFFI.xcframework built for this PR.

SwiftPM (host the zip at a stable URL, then use):

.binaryTarget(
  name: "DashSDKFFI",
  url: "https://your.cdn.example/DashSDKFFI.xcframework.zip",
  checksum: "0b46b804af8948b0331f426cdb0ef54097b6359ebae14ec767bcf7e7156a3317"
)

Xcode manual integration:

  • Download 'DashSDKFFI.xcframework' artifact from the run link above.
  • Drag it into your app target (Frameworks, Libraries & Embedded Content) and set Embed & Sign.
  • If using the Swift wrapper package, point its binaryTarget to the xcframework location or add the package and place the xcframework at the expected path.

@QuantumExplorer QuantumExplorer changed the title fix(wallet-ffi): fix flaky Base58 identifier length assertion fix(platform-wallet): fix flaky Base58 identifier length assertion Mar 14, 2026
@QuantumExplorer
Copy link
Member Author

Self Reviewed

@QuantumExplorer QuantumExplorer merged commit 16ad0c0 into v3.1-dev Mar 14, 2026
15 of 19 checks passed
@QuantumExplorer QuantumExplorer deleted the fix/wallet-ffi-identifier-length-assertion branch March 14, 2026 09:00
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.

1 participant