Skip to content

Commit 16ad0c0

Browse files
fix(platform-wallet): fix flaky Base58 identifier length assertion (#3245)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 981ff4b commit 16ad0c0

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

‎packages/rs-platform-wallet-ffi/tests/comprehensive_tests.rs‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -526,7 +526,12 @@ fn test_identifier_operations() {
526526
assert!(!id_string.is_null());
527527

528528
let id_str = std::ffi::CStr::from_ptr(id_string).to_str().unwrap();
529-
assert_eq!(id_str.len(), 44); // Base58-encoded identifier is 44 chars
529+
// Base58-encoded 32-byte identifier is 43-44 chars (variable length encoding)
530+
assert!(
531+
id_str.len() == 43 || id_str.len() == 44,
532+
"Expected Base58 identifier length 43-44, got {}",
533+
id_str.len()
534+
);
530535

531536
// Convert back from string
532537
let mut id2 = IdentifierBytes { bytes: [0u8; 32] };

0 commit comments

Comments
 (0)