-
Notifications
You must be signed in to change notification settings - Fork 284
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(core-state): wallet repository clone instantiation #4009
Merged
air1one
merged 8 commits into
develop
from
fix/core-state/wallet-repository-clone-instantiation
Sep 11, 2020
Merged
fix(core-state): wallet repository clone instantiation #4009
air1one
merged 8 commits into
develop
from
fix/core-state/wallet-repository-clone-instantiation
Sep 11, 2020
Conversation
This file contains 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
Codecov Report
@@ Coverage Diff @@
## develop #4009 +/- ##
===========================================
+ Coverage 96.84% 98.60% +1.75%
===========================================
Files 631 631
Lines 14588 14591 +3
Branches 1732 1735 +3
===========================================
+ Hits 14128 14387 +259
+ Misses 370 114 -256
Partials 90 90
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
air1one
approved these changes
Sep 11, 2020
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.
Summary
Clone of wallet repository was instantiated incorrectly:
This error was actually made by me back in the days when I had little understanding of its internals. The issue is with the wallet index
clone
method:It performs deep clone and as result cloned wallet repository will contain separate but identical wallet copies in all of its indexes:
Fixed
initialize
by taking every wallet from"addresses"
index (it's analogous to primary key) and then cloning and re-indexing them. This slows down initialization. If wallet indexes were storing address as value instead of wallet reference, then it would be possible to clone them and avoid re-indexing.Now also throwing error when attempting to index
state=blockchain
wallet into it. Previouslyindex
automatically cloned wallet which meant that caller was left with wallet reference that wasn't actually indexed. Now caller is required to clone wallet himself if he has to transfer wallet between wallet repositories.Checklist