Stop being generic over the message (#3186)

This commit is contained in:
Pierre Krieger
2019-07-29 09:29:06 +02:00
committed by Bastian Köcher
parent 9370a4a6b6
commit 8c919e031b
7 changed files with 108 additions and 125 deletions
@@ -125,7 +125,6 @@ pub struct RemoteReadResponse {
/// Generic types.
pub mod generic {
use crate::custom_proto::CustomMessage;
use parity_codec::{Encode, Decode};
use runtime_primitives::Justification;
use crate::config::Roles;
@@ -210,18 +209,6 @@ pub mod generic {
ChainSpecific(Vec<u8>),
}
impl<Header, Hash, Number, Extrinsic> CustomMessage for Message<Header, Hash, Number, Extrinsic>
where Self: Decode + Encode
{
fn into_bytes(self) -> Vec<u8> {
self.encode()
}
fn from_bytes(bytes: &[u8]) -> Result<Self, ()> {
Decode::decode(&mut &bytes[..]).ok_or(())
}
}
/// Status sent on connection.
#[derive(Debug, PartialEq, Eq, Clone, Encode, Decode)]
pub struct Status<Hash, Number> {