feat: add Asset Lock derivation path subfeatures 4 and 5#454
feat: add Asset Lock derivation path subfeatures 4 and 5#454xdustinface merged 3 commits intov0.42-devfrom
Conversation
Add two new DIP-9 derivation path subfeatures under feature 5 (Identity Keys): - Subfeature 4: Asset Lock Address Topup Funding (m/9h/coinType/5h/4h/index) - Subfeature 5: Asset Lock Shielded Address Topup Funding (m/9h/coinType/5h/5h/index) These subfeatures provide deterministic HD derivation paths for asset lock transactions used to fund identity operations via address-based and shielded address-based topup mechanisms, replacing the previous OsRng approach. Changes across 16 files: - dip9.rs: new constants, path definitions, DerivationPathReference variants - bip32.rs: new derivation path constructors and tests - account_type.rs: new AccountType variants and derivation logic - account_collection.rs: storage fields and accessors - managed_account_type.rs: mutable wrappers with AddressPool - managed_account_collection.rs: managed account storage - managed_account/mod.rs: address pool accessors and gap limits - transaction_router/mod.rs: AccountTypeToCheck variants, AssetLock routing - account_checker.rs: CoreAccountTypeMatch variants, address checking - wallet/helper.rs: special purpose account creation - key-wallet-ffi: FFIAccountType variants 14/15, match arms in all FFI modules - integration_test.rs: updated account count assertion (10 to 12) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📝 WalkthroughWalkthroughThis pull request adds two new account types—AssetLockAddressTopUp and AssetLockShieldedAddressTopUp—throughout the FFI, core account types, managed account collections, derivation paths, wallet creation flows, and transaction checking, with corresponding enum, struct, and conversion updates. Changes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~50 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)
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 |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
key-wallet-ffi/src/types.rs (1)
179-182: FFI enum discriminants 14 and 15 are correctly assigned and don't conflict with existing values.The source ordering places these variants between
IdentityInvitation = 6andProviderVotingKeys = 7, which is slightly unusual but functionally correct since explicit discriminant values are used. Consider reordering the source to match ascending discriminant order for readability, but this is purely cosmetic.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@key-wallet-ffi/src/types.rs` around lines 179 - 182, The enum variants AssetLockAddressTopUp (14) and AssetLockShieldedAddressTopUp (15) are correctly assigned and non-conflicting, but their source placement between IdentityInvitation and ProviderVotingKeys is out of discriminant order; reorder the declarations so variants follow ascending discriminant order (e.g., move AssetLockAddressTopUp and AssetLockShieldedAddressTopUp to appear after ProviderVotingKeys or rearrange surrounding variants) to improve readability while keeping their explicit discriminant values unchanged.
🤖 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/src/account/account_type.rs`:
- Around line 56-61: Doc comments for the enum variants AssetLockAddressTopUp
and AssetLockShieldedAddressTopUp mention "Identity..." which is inconsistent
with the variant names; update the comments to say "Asset-lock..." (or "Asset
lock") so they read e.g. "Asset-lock address top-up funding (subfeature 4)" and
"Asset-lock shielded address top-up funding (subfeature 5)", keeping the
existing BIP32 paths unchanged and preserving punctuation/formatting in
account_type.rs.
---
Nitpick comments:
In `@key-wallet-ffi/src/types.rs`:
- Around line 179-182: The enum variants AssetLockAddressTopUp (14) and
AssetLockShieldedAddressTopUp (15) are correctly assigned and non-conflicting,
but their source placement between IdentityInvitation and ProviderVotingKeys is
out of discriminant order; reorder the declarations so variants follow ascending
discriminant order (e.g., move AssetLockAddressTopUp and
AssetLockShieldedAddressTopUp to appear after ProviderVotingKeys or rearrange
surrounding variants) to improve readability while keeping their explicit
discriminant values unchanged.
Move AssetLockAddressTopUp (14) and AssetLockShieldedAddressTopUp (15) after PlatformPayment (13) so the enum variants are in sequential order. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Summary
m/9'/coinType'/5'/4'/index')m/9'/coinType'/5'/5'/index')Changes (16 files)
key-wallet
dip9.rs: New constants, path definitions, DerivationPathReference variants (17, 18)bip32.rs: New path constructors with testsaccount_type.rs: New AccountType variants (AssetLockAddressTopUp, AssetLockShieldedAddressTopUp)account_collection.rs: Storage fields and accessorsmanaged_account_type.rs: Mutable wrappers with AddressPoolmanaged_account_collection.rs: Managed account storage and creationmanaged_account/mod.rs: Address pool accessors and gap limitstransaction_router/mod.rs: AccountTypeToCheck variants, AssetLock routingaccount_checker.rs: CoreAccountTypeMatch variants and address checkingwallet/helper.rs: Added to create_special_purpose_accountskey-wallet-ffi
types.rs: FFIAccountType variants 14 and 15address_pool.rs,managed_account.rs,transaction_checking.rs: Match armskey-wallet-manager
integration_test.rs: Updated account count assertion (10 -> 12)Test plan
Generated with Claude Code
Summary by CodeRabbit