Repository navigation
WalletAppKit: remove internal use of NetworkParameters, deprecate params() - #4360
Draft
msgilligan wants to merge 5 commits into
Draft
msgilligan wants to merge 5 commits into
msgilligan wants to merge 5 commits into
Conversation
This provides a factory for genesis blocks that does not require a caller to have a NetworkParameters instance. Block is the logical home for this method, because: 1. Genesis blocks are instances of `Block` and factories that provide well-known constant instances of a type make sense to place there. 2. We already have several `createGenesis()` static factories in `Block` (immediately below this new method) 3. We can't put it in `Network` because `Block` and other dependencies are in `o.b.core` not `o.b.base`.
In some classes (CheckpointManager, SPVBlockStore, and MemoryFullPrunedBlockStore) the use of Block.getGenesis() removes the last internal dependency on NetworkParameters and allows the constructor taking NetworkParameters to be replaced with one that takes Network. In FetchBlocks, PrivateKeys, and BlockFileLoaderBitcoindTest NetworkParameters is completely removed. In other classes use of Block.getGenesis() takes us closer to removing NetworkParameters, but there are other uses that must be updated first.
Existing SPVBlockStore constructors that take NetworkParameters are deprecated. Note that the RestoreFromSeed example is now able to completely remove imports of NetworkParameters and subclasses. BlockImporter can drop NetworkParameters once the MemoryFullPrunedBlockStore constructors are updated to take Network. This is a step towards our goal of (typical) applications using only (Bitcoin)Network in API calls. This also opens the possibility of migrating genesis block parameters out of network parameters.
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.
This is a child of: