fix(drive): replace expect/unwrap with error propagation in production code#3203
Conversation
…n code Replace `.expect()` calls in fetch_compacted_nullifiers and verify_compacted_nullifier_changes with proper `map_err` + `?` error propagation where the function returns Result. Retain `.expect()` only inside `find_map` closures (returns Option) where error propagation isn't possible, with safety comments. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
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: "1875cda69634f772229711862dbec2f3e6e2f02843bc1dc1f113cd6add762ae2"
)Xcode manual integration:
|
Issue being fixed or feature implemented
Production code in
fetch_compacted_nullifiersandverify_compacted_nullifier_changesused.expect()which would panic on invalid data instead of returning errors.What was done?
Replaced
.expect()calls withmap_err+?error propagation in functions that returnResult. Retained.expect()only insidefind_mapclosures where?isn't available, with safety comments explaining the preceding length guard.How Has This Been Tested?
cargo check -p drive— compiles cleanlyBreaking Changes
None.
Checklist: