Downgrade bincode to 0.8.
This commit is contained in:
parent
839a54b01f
commit
07d4f544d7
|
@ -31,15 +31,15 @@ colored = "*"
|
||||||
itertools = "*"
|
itertools = "*"
|
||||||
pairing = "*"
|
pairing = "*"
|
||||||
rand = "0.4.2"
|
rand = "0.4.2"
|
||||||
serde = "*"
|
serde = "1"
|
||||||
serde_bytes = "*"
|
serde_bytes = "*"
|
||||||
serde_derive = "*"
|
serde_derive = "1"
|
||||||
signifix = "*"
|
signifix = "*"
|
||||||
futures = "0.1"
|
futures = "0.1"
|
||||||
tokio = "0.1.7"
|
tokio = "0.1.7"
|
||||||
tokio-codec = "*"
|
tokio-codec = "*"
|
||||||
tokio-io = "*"
|
tokio-io = "*"
|
||||||
bincode = "*"
|
bincode = "0.8"
|
||||||
tokio-serde = "*"
|
tokio-serde = "*"
|
||||||
tokio-serde-bincode = "*"
|
tokio-serde-bincode = "*"
|
||||||
bytes = "*"
|
bytes = "*"
|
||||||
|
@ -52,7 +52,8 @@ clear_on_drop = "*"
|
||||||
version = "*"
|
version = "*"
|
||||||
git = "https://github.com/c0gent/hbbft"
|
git = "https://github.com/c0gent/hbbft"
|
||||||
# git = "https://github.com/poanetwork/hbbft"
|
# git = "https://github.com/poanetwork/hbbft"
|
||||||
branch = "master"
|
branch = "c0gent-supertraits"
|
||||||
|
# branch = "master"
|
||||||
# branch = "afck-qhb-single"
|
# branch = "afck-qhb-single"
|
||||||
# branch = "afck-agreement"
|
# branch = "afck-agreement"
|
||||||
# path = "../hbbft"
|
# path = "../hbbft"
|
||||||
|
|
21
src/lib.rs
21
src/lib.rs
|
@ -1,6 +1,6 @@
|
||||||
#![feature(alloc_system, allocator_api)]
|
// #![feature(alloc_system, allocator_api)]
|
||||||
|
// extern crate alloc_system;
|
||||||
|
|
||||||
extern crate alloc_system;
|
|
||||||
extern crate clap;
|
extern crate clap;
|
||||||
extern crate env_logger;
|
extern crate env_logger;
|
||||||
#[macro_use] extern crate log;
|
#[macro_use] extern crate log;
|
||||||
|
@ -28,10 +28,10 @@ extern crate parking_lot;
|
||||||
extern crate clear_on_drop;
|
extern crate clear_on_drop;
|
||||||
extern crate hbbft;
|
extern crate hbbft;
|
||||||
|
|
||||||
use alloc_system::System;
|
// use alloc_system::System;
|
||||||
|
|
||||||
#[global_allocator]
|
// #[global_allocator]
|
||||||
static A: System = System;
|
// static A: System = System;
|
||||||
|
|
||||||
// pub mod network;
|
// pub mod network;
|
||||||
pub mod hydrabadger;
|
pub mod hydrabadger;
|
||||||
|
@ -57,7 +57,7 @@ use tokio_io::codec::length_delimited::Framed;
|
||||||
use bytes::{BytesMut, Bytes};
|
use bytes::{BytesMut, Bytes};
|
||||||
use rand::{Rng, Rand};
|
use rand::{Rng, Rand};
|
||||||
use uuid::Uuid;
|
use uuid::Uuid;
|
||||||
use bincode::{serialize, deserialize};
|
// use bincode::{serialize, deserialize};
|
||||||
use hbbft::{
|
use hbbft::{
|
||||||
crypto::{PublicKey, PublicKeySet},
|
crypto::{PublicKey, PublicKeySet},
|
||||||
sync_key_gen::{Part, Ack},
|
sync_key_gen::{Part, Ack},
|
||||||
|
@ -307,7 +307,7 @@ impl Stream for WireMessages {
|
||||||
Some(frame) => {
|
Some(frame) => {
|
||||||
Ok(Async::Ready(Some(
|
Ok(Async::Ready(Some(
|
||||||
// deserialize_from(frame.reader()).map_err(Error::Serde)?
|
// deserialize_from(frame.reader()).map_err(Error::Serde)?
|
||||||
deserialize(&frame.freeze()).map_err(Error::Serde)?
|
bincode::deserialize(&frame.freeze()).map_err(Error::Serde)?
|
||||||
)))
|
)))
|
||||||
}
|
}
|
||||||
None => Ok(Async::Ready(None))
|
None => Ok(Async::Ready(None))
|
||||||
|
@ -322,7 +322,12 @@ impl Sink for WireMessages {
|
||||||
fn start_send(&mut self, item: Self::SinkItem) -> StartSend<Self::SinkItem, Self::SinkError> {
|
fn start_send(&mut self, item: Self::SinkItem) -> StartSend<Self::SinkItem, Self::SinkError> {
|
||||||
// TODO: Reuse buffer:
|
// TODO: Reuse buffer:
|
||||||
let mut serialized = BytesMut::new();
|
let mut serialized = BytesMut::new();
|
||||||
match serialize(&item) {
|
|
||||||
|
// Downgraded from bincode 1.0:
|
||||||
|
//
|
||||||
|
// Original: `bincode::serialize(&item)`
|
||||||
|
//
|
||||||
|
match bincode::serialize(&item, bincode::Bounded(1 << 20)) {
|
||||||
Ok(s) => serialized.extend_from_slice(&s),
|
Ok(s) => serialized.extend_from_slice(&s),
|
||||||
Err(err) => return Err(Error::Io(io::Error::new(io::ErrorKind::Other, err))),
|
Err(err) => return Err(Error::Io(io::Error::new(io::ErrorKind::Other, err))),
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue