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
+1 -1
View File
@@ -13,7 +13,7 @@ readme = "README.md"
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"] }
serde = { version = "1.0.101", optional = true, features = ["derive"] }
sp-std = { version = "2.0.0", default-features = false, path = "../../primitives/std" }
sp-core = { version = "2.0.0", default-features = false, path = "../../primitives/core" }
+4 -4
View File
@@ -53,7 +53,7 @@ pub enum DecodeDifferent<B, O> where B: 'static, O: 'static {
}
impl<B, O> Encode for DecodeDifferent<B, O> where B: Encode + 'static, O: Encode + 'static {
fn encode_to<W: Output>(&self, dest: &mut W) {
fn encode_to<W: Output + ?Sized>(&self, dest: &mut W) {
match self {
DecodeDifferent::Encode(b) => b.encode_to(dest),
DecodeDifferent::Decoded(o) => o.encode_to(dest),
@@ -139,7 +139,7 @@ pub struct FunctionArgumentMetadata {
pub struct FnEncode<E>(pub fn() -> E) where E: Encode + 'static;
impl<E: Encode> Encode for FnEncode<E> {
fn encode_to<W: Output>(&self, dest: &mut W) {
fn encode_to<W: Output + ?Sized>(&self, dest: &mut W) {
self.0().encode_to(dest);
}
}
@@ -238,7 +238,7 @@ pub struct DefaultByteGetter(pub &'static dyn DefaultByte);
pub type ByteGetter = DecodeDifferent<DefaultByteGetter, Vec<u8>>;
impl Encode for DefaultByteGetter {
fn encode_to<W: Output>(&self, dest: &mut W) {
fn encode_to<W: Output + ?Sized>(&self, dest: &mut W) {
self.0.default_byte().encode_to(dest)
}
}
@@ -374,7 +374,7 @@ pub enum RuntimeMetadata {
pub enum RuntimeMetadataDeprecated { }
impl Encode for RuntimeMetadataDeprecated {
fn encode_to<W: Output>(&self, _dest: &mut W) {}
fn encode_to<W: Output + ?Sized>(&self, _dest: &mut W) {}
}
impl codec::EncodeLike for RuntimeMetadataDeprecated {}