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
@@ -656,7 +656,7 @@ impl<B: BlockT, H: ExHashT> Protocol<B, H> {
"Couldn't decode packet sent by {}: {:?}: {}",
who,
data,
err.what(),
err,
);
self.peerset_handle.report_peer(who, rep::BAD_MESSAGE);
return CustomMessageOutcome::None;
@@ -1737,7 +1737,7 @@ impl<B: BlockT, H: ExHashT> NetworkBehaviour for Protocol<B, H> {
"Couldn't decode handshake sent by {}: {:?}: {} & {}",
peer_id,
received_handshake,
err.what(),
err,
err2,
);
self.peerset_handle.report_peer(peer_id, rep::BAD_MESSAGE);
@@ -95,7 +95,7 @@ impl BlockAttributes {
}
impl Encode for BlockAttributes {
fn encode_to<T: Output>(&self, dest: &mut T) {
fn encode_to<T: Output + ?Sized>(&self, dest: &mut T) {
dest.push_byte(self.bits())
}
}
@@ -198,7 +198,7 @@ pub mod generic {
}
impl codec::Encode for Roles {
fn encode_to<T: codec::Output>(&self, dest: &mut T) {
fn encode_to<T: codec::Output + ?Sized>(&self, dest: &mut T) {
dest.push_byte(self.bits())
}
}
@@ -282,7 +282,7 @@ pub mod generic {
/// Batch of consensus protocol messages.
// NOTE: index is incremented by 2 due to finality proof related
// messages that were removed.
#[codec(index = "17")]
#[codec(index = 17)]
ConsensusBatch(Vec<ConsensusMessage>),
}
@@ -402,7 +402,7 @@ pub mod generic {
// This assumes that the packet contains nothing but the announcement message.
// TODO: Get rid of it once protocol v4 is common.
impl<H: Encode> Encode for BlockAnnounce<H> {
fn encode_to<T: Output>(&self, dest: &mut T) {
fn encode_to<T: Output + ?Sized>(&self, dest: &mut T) {
self.header.encode_to(dest);
if let Some(state) = &self.state {
state.encode_to(dest);