|
|
@@ -1378,16 +1378,16 @@ pub fn cmz_core(
|
|
|
}
|
|
|
|
|
|
impl TryFrom<&[u8]> for ClientState {
|
|
|
- type Error = bincode::Error;
|
|
|
+ type Error = postcard::Error;
|
|
|
|
|
|
- fn try_from(bytes: &[u8]) -> bincode::Result<ClientState> {
|
|
|
- bincode::deserialize::<ClientState>(bytes)
|
|
|
+ fn try_from(bytes: &[u8]) -> postcard::Result<ClientState> {
|
|
|
+ postcard::from_bytes::<ClientState>(bytes)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
impl From<&ClientState> for Vec<u8> {
|
|
|
fn from(req: &ClientState) -> Vec<u8> {
|
|
|
- bincode::serialize(req).unwrap()
|
|
|
+ postcard::to_allocvec(req).unwrap()
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -1411,16 +1411,16 @@ pub fn cmz_core(
|
|
|
}
|
|
|
|
|
|
impl TryFrom<&[u8]> for Request {
|
|
|
- type Error = bincode::Error;
|
|
|
+ type Error = postcard::Error;
|
|
|
|
|
|
- fn try_from(bytes: &[u8]) -> bincode::Result<Request> {
|
|
|
- bincode::deserialize::<Request>(bytes)
|
|
|
+ fn try_from(bytes: &[u8]) -> postcard::Result<Request> {
|
|
|
+ postcard::from_bytes::<Request>(bytes)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
impl From<&Request> for Vec<u8> {
|
|
|
fn from(req: &Request) -> Vec<u8> {
|
|
|
- bincode::serialize(req).unwrap()
|
|
|
+ postcard::to_allocvec(req).unwrap()
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -1437,16 +1437,16 @@ pub fn cmz_core(
|
|
|
}
|
|
|
|
|
|
impl TryFrom<&[u8]> for Reply {
|
|
|
- type Error = bincode::Error;
|
|
|
+ type Error = postcard::Error;
|
|
|
|
|
|
- fn try_from(bytes: &[u8]) -> bincode::Result<Reply> {
|
|
|
- bincode::deserialize::<Reply>(bytes)
|
|
|
+ fn try_from(bytes: &[u8]) -> postcard::Result<Reply> {
|
|
|
+ postcard::from_bytes::<Reply>(bytes)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
impl From<&Reply> for Vec<u8> {
|
|
|
fn from(rep: &Reply) -> Vec<u8> {
|
|
|
- bincode::serialize(rep).unwrap()
|
|
|
+ postcard::to_allocvec(rep).unwrap()
|
|
|
}
|
|
|
}
|
|
|
|