feat: add insertMany to repository API (Batch accounts 2/5)#609
Open
gantunesr wants to merge 4 commits into
Open
feat: add insertMany to repository API (Batch accounts 2/5)#609gantunesr wants to merge 4 commits into
insertMany to repository API (Batch accounts 2/5)#609gantunesr wants to merge 4 commits into
Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 8e646ab. Configure here.
insertMany repository APIs (Batch accounts 2/5)
insertMany repository APIs (Batch accounts 2/5)insertMany to repository API (Batch accounts 2/5)
16a6861 to
4670591
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Stack part 2 of 5 split from #601. Adds repository-level batch lookup and insert APIs, nullable account tombstones, and derivation-path index repair. This does not expose keyring_createAccounts yet.
Note
Medium Risk
Touches snap persistent state and account repository behavior (batch writes and derivation-path index repair), which could affect account discovery or persistence if edge cases are missed. Changes are localized but involve data-shape tweaks (
accountstombstones) and new staged-changeset semantics.Overview
Adds repository-level batching:
BitcoinAccountRepositorynow supportsgetByDerivationPaths(single read per namespace, returns results in input order) andinsertMany(writesaccountsandderivationPathsin two bulk updates).Introduces tombstone-aware state by allowing
SnapState.accountsvalues to benull, and adds derivation-path index repair when lookups fall back to scanningaccounts.Extends
BitcoinAccountwithhasStaged()and updatesBdkAccountAdapterto preserve/merge stagedChangeSets so batch insertion can validate staged data without consuming it; adds corresponding unit tests and updates the changelog.Reviewed by Cursor Bugbot for commit 4670591. Bugbot is set up for automated code reviews on this repo. Configure here.