refactor(key-wallet-ffi): remove and replaced FFIExtendedPublicKey with FFIExtendedPubKey#646
Conversation
📝 WalkthroughWalkthroughThe changes rename the opaque FFI type Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 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 docstrings
🧪 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 |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## v0.42-dev #646 +/- ##
=============================================
- Coverage 68.08% 67.99% -0.09%
=============================================
Files 318 318
Lines 67800 67806 +6
=============================================
- Hits 46164 46108 -56
- Misses 21636 21698 +62
|
|
@ZocoLini conflicts |
|
This PR has merge conflicts with the base branch. Please rebase or merge the base branch into your branch to resolve them. |
f024521 to
10a7c7d
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
key-wallet-ffi/src/keys.rs (1)
641-643: Use the new constructor here as well.This is the one remaining direct
FFIExtendedPubKeystruct literal after addingfrom_inner(), so wrapper construction is still split across call sites.♻️ Suggested cleanup
- Box::into_raw(Box::new(FFIExtendedPubKey { - inner: extended_public_key, - })) + Box::into_raw(Box::new(FFIExtendedPubKey::from_inner(extended_public_key)))🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@key-wallet-ffi/src/keys.rs` around lines 641 - 643, Replace the direct struct literal construction of FFIExtendedPubKey with the new constructor: instead of creating FFIExtendedPubKey { inner: extended_public_key } wrap the inner value using FFIExtendedPubKey::from_inner(extended_public_key) and then Box::into_raw(Box::new(...)) as before so all call sites uniformly use from_inner; update the occurrence that currently returns Box::into_raw(Box::new(FFIExtendedPubKey { inner: extended_public_key })) to use FFIExtendedPubKey::from_inner.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@key-wallet-ffi/src/keys.rs`:
- Around line 25-27: You renamed the exported opaque handle from
FFIExtendedPublicKey to FFIExtendedPubKey which is a breaking FFI change;
restore source-compatibility by adding a temporary compatibility alias named
FFIExtendedPublicKey that maps to the new struct (FFIExtendedPubKey) or, if you
intend to break the API, update the crate's public docs and CHANGELOG with
explicit migration guidance referencing both FFIExtendedPubKey and the former
FFIExtendedPublicKey so consumers know to update their bindings; apply the same
alias/documentation approach for the other affected symbols mentioned in the
review (lines referenced).
---
Nitpick comments:
In `@key-wallet-ffi/src/keys.rs`:
- Around line 641-643: Replace the direct struct literal construction of
FFIExtendedPubKey with the new constructor: instead of creating
FFIExtendedPubKey { inner: extended_public_key } wrap the inner value using
FFIExtendedPubKey::from_inner(extended_public_key) and then
Box::into_raw(Box::new(...)) as before so all call sites uniformly use
from_inner; update the occurrence that currently returns
Box::into_raw(Box::new(FFIExtendedPubKey { inner: extended_public_key })) to use
FFIExtendedPubKey::from_inner.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 6622f978-c8cb-462b-a3db-ac432ae7b07b
📒 Files selected for processing (4)
key-wallet-ffi/FFI_API.mdkey-wallet-ffi/cbindgen.tomlkey-wallet-ffi/src/derivation.rskey-wallet-ffi/src/keys.rs
Same issue I am fixing in PR #645 but with a different structure
Summary by CodeRabbit