fix(platform-wallet): fix flaky Base58 identifier length assertion#3245
Conversation
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>
📝 WalkthroughWalkthroughA 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
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
📝 Coding Plan
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. Comment |
|
✅ 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:
|
|
Self Reviewed |
Issue being fixed or feature implemented
test_identifier_operationsinplatform-wallet-ffiintermittently 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: 44atcomprehensive_tests.rs:529.What was done?
assert_eq!(id_str.len(), 44)to accept either 43 or 44 characters, matching the actual Base58 encoding behaviorHow Has This Been Tested?
Breaking Changes
None.
Checklist:
🤖 Generated with Claude Code
Summary by CodeRabbit