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.
Proposed changes
This PR provides an immutable storage in the form of the new package
core-storage
. This package makes use of https://facebook.github.io/immutable-js/ under the hood so everything that can be done by immutable.js can be done with core-storage.core-storage
only is a wrapper around immutable.js in order to make it possible to have a shared instance for in-memory information that all plugins and core itself can access at any time without having to worry about the data in it getting modified without being told to do so.We could use this storage for peers, wallets, blockchain state, blocks and many more things were we need the certainty that the data stays how it was stored.
The usage is pretty simple, an example would be the wallet manager. Below example demonstrates how we replace POJOs with the immutable storage provided by
core-storage
.Lays the groundwork to work on #818, #851, #850.
This PR only provides the storage. Integration into core plugins will be done after this is merged.
Types of changes
Checklist