Update parity-scale-codec to 2.0 (#7994)

* update cargo.toml

* use 2.0 in mmmr
This commit is contained in:
Guillaume Thiolliere
2021-01-29 13:22:45 +01:00
committed by GitHub
parent bea4a6524d
commit f48296e9ad
179 changed files with 316 additions and 383 deletions
+2 -2
View File
@@ -15,7 +15,7 @@ targets = ["x86_64-unknown-linux-gnu"]
[dependencies]
codec = { package = "parity-scale-codec", version = "1.3.6", default-features = false, features = ["derive"] }
codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false, features = ["derive"] }
integer-sqrt = "0.1.2"
num-traits = { version = "0.2.8", default-features = false }
sp-std = { version = "2.0.0", default-features = false, path = "../std" }
@@ -26,7 +26,7 @@ sp-debug-derive = { version = "2.0.0", default-features = false, path = "../debu
rand = "0.7.2"
criterion = "0.3"
serde_json = "1.0"
primitive-types = "0.8.0"
primitive-types = "0.9.0"
[features]
default = ["std"]
@@ -16,7 +16,7 @@ targets = ["x86_64-unknown-linux-gnu"]
[dependencies]
sp-arithmetic = { version = "2.0.0", path = ".." }
honggfuzz = "0.5.49"
primitive-types = "0.8.0"
primitive-types = "0.9.0"
num-bigint = "0.2"
num-traits = "0.2"
@@ -338,9 +338,9 @@ macro_rules! implement_per_thing {
fn encode_as(&self) -> &Self::As {
&self.0
}
fn decode_from(x: Self::As) -> Self {
fn decode_from(x: Self::As) -> Result<Self, codec::Error> {
// Saturates if `x` is more than `$max` internally.
Self::from_parts(x)
Ok(Self::from_parts(x))
}
}