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.
In order to make use of
dcrutil/v2
, a new major version of thedatabase
module is required becausedatabase/v1
accepts and returns types fromdcrutil/v1
in its API.Since a new major version is required, this also takes the opportunity break the tight coupling with
dcrutil
by introducing a newBlockSerializer
interface and accepting it instead of*dcrutil.Block
in the database interface API.Consequently, this introduces
database/v2
which addresses the aforementioned items. A series of individual commits is provided to make the review process easier. Each commit message more thoroughly describes its purpose, but primarily they consist of the following:database
moduledatabase
override so building the software will still produce binaries based on thev1
module until thev2
module is fully releasedBlockSerializer
interface that is limited specifically to ability to obtain the hash and serialization of a block and update theStoreBlock
method that previously accepted*dcrutil.Block
to use the new interface insteaddcrutil/[email protected]
v2
dbtool
utility to importdatabase/v2
Finally, it should also be noted that this only introduces the new module and does not update anything to make use of it yet, so building the software will still produce binaries based on the
v1
module.