Replace primitives_types with uint #2350
Merged
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.
Motivation
We need to use the recent
zcash_primitives
inlibrustzcash
for ZIP-244/221 support. However, they have updated their dependencies to usebitvec
0.22, while we use 0.17. Due to a package conflict issue withfunty
, we must then update all dependencies that usebitvec
.One of those is
primitive-types
, however it hasn't been updated to usebitvec
0.22, and was due to being replaced in #829 anyway. That issue proposes replacing it withbigint
, however that package has a different API and it will take some time to adapt to it.Until we do that, we can use
uint
instead (whichprimitives-types
also uses and therefore does not require any big changes in our code). This will unblock further work on thelibrustzcash
update and we can eventually usebigint
instead per #829.Specifications
N/A
Designs
N/A
Solution
Use
uint
to define aU256
type which is essentially the same as the one defined inprimitive-types
.Note that this does not prevent the packages conflicts by itself, we keep using
bitvec
0.17 here. That will be solved in a separated PR because thebitvec
upgrade is non-trivial and requires some code changes.Review
Anyone can review, it's a simple change.
This blocks further work on the
librustzcash
update which is necessary to merge ZIP-244 PRs.Reviewer Checklist
Follow Up Work
In #829 we'll change it again to use
bigint
in order to have the same dependency aslibrustzcash
.