Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Commit

Permalink
Use patched version of primitive-types with new codec trait impls
Browse files Browse the repository at this point in the history
The in-tree version of `max-encoded-len` implements `MaxEncodedLen`
manually for the hash primitive types re-exported in `sp_core`,
whereas the added API in `parity-scale-codec` does not (for a good
reason).
Instead, adapt the existing `codec` implementation in `primitive-types`
directly to additionally implement the trait directly there.
  • Loading branch information
Xanewok committed Jun 21, 2021
1 parent 409ea8f commit fe797ff
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 22 deletions.
53 changes: 34 additions & 19 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,14 @@ branch = "igor-max-encoded-len"
git = "https://github.com/paritytech/parity-scale-codec"
branch = "igor-max-encoded-len"
version = "2.2.0"
[patch.crates-io.primitive-types]
git = "https://github.com/paritytech/parity-common"
branch = "igor-prim-types-new-codec"
version = "0.9.1"
[patch.crates-io.impl-codec]
git = "https://github.com/paritytech/parity-common"
branch = "igor-prim-types-new-codec"
version = "0.6.0"

# The list of dependencies below (which can be both direct and indirect dependencies) are crates
# that are suspected to be CPU-intensive, and that are unlikely to require debugging (as some of
Expand Down
2 changes: 1 addition & 1 deletion primitives/arithmetic/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ sp-debug-derive = { version = "3.0.0", default-features = false, path = "../debu
rand = "0.7.2"
criterion = "0.3"
serde_json = "1.0"
primitive-types = "0.9.0"
primitive-types = "0.9.1"

[features]
default = ["std"]
Expand Down
2 changes: 1 addition & 1 deletion primitives/arithmetic/fuzzer/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ targets = ["x86_64-unknown-linux-gnu"]
[dependencies]
sp-arithmetic = { version = "3.0.0", path = ".." }
honggfuzz = "0.5.49"
primitive-types = "0.9.0"
primitive-types = "0.9.1"
num-bigint = "0.2"
num-traits = "0.2"

Expand Down
2 changes: 1 addition & 1 deletion primitives/core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ codec = { package = "parity-scale-codec", version = "2.0.0", default-features =
log = { version = "0.4.11", default-features = false }
serde = { version = "1.0.101", optional = true, features = ["derive"] }
byteorder = { version = "1.3.2", default-features = false }
primitive-types = { version = "0.9.0", default-features = false, features = ["codec"] }
primitive-types = { version = "0.9.1", default-features = false, features = ["codec"] }
impl-serde = { version = "0.3.0", optional = true }
wasmi = { version = "0.9.0", optional = true }
hash-db = { version = "0.15.2", default-features = false }
Expand Down

0 comments on commit fe797ff

Please sign in to comment.