Merge branch 'master' of github.com:ethcore/parity into net
This commit is contained in:
@@ -26,7 +26,7 @@ crossbeam = "0.2"
|
||||
slab = { git = "https://github.com/arkpar/slab.git" }
|
||||
sha3 = { path = "sha3" }
|
||||
serde = "0.6.7"
|
||||
clippy = "0.0.37"
|
||||
clippy = "0.0.41"
|
||||
json-tests = { path = "json-tests" }
|
||||
target_info = "0.1.0"
|
||||
igd = "0.4.2"
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
#![feature(test)]
|
||||
|
||||
extern crate test;
|
||||
extern crate rand;
|
||||
extern crate ethcore_util;
|
||||
#[macro_use]
|
||||
extern crate log;
|
||||
|
||||
@@ -74,7 +74,6 @@ impl From<::secp256k1::Error> for CryptoError {
|
||||
match e {
|
||||
::secp256k1::Error::InvalidMessage => CryptoError::InvalidMessage,
|
||||
::secp256k1::Error::InvalidPublicKey => CryptoError::InvalidPublic,
|
||||
::secp256k1::Error::InvalidSignature => CryptoError::InvalidSignature,
|
||||
::secp256k1::Error::InvalidSecretKey => CryptoError::InvalidSecret,
|
||||
_ => CryptoError::InvalidSignature,
|
||||
}
|
||||
|
||||
@@ -296,7 +296,7 @@ macro_rules! impl_hash {
|
||||
try!(write!(f, "{:02x}", i));
|
||||
}
|
||||
try!(write!(f, "…"));
|
||||
for i in &self.0[$size - 4..$size] {
|
||||
for i in &self.0[$size - 2..$size] {
|
||||
try!(write!(f, "{:02x}", i));
|
||||
}
|
||||
Ok(())
|
||||
@@ -647,7 +647,7 @@ mod tests {
|
||||
fn hash() {
|
||||
let h = H64([0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef]);
|
||||
assert_eq!(H64::from_str("0123456789abcdef").unwrap(), h);
|
||||
assert_eq!(format!("{}", h), "0123…89abcdef");
|
||||
assert_eq!(format!("{}", h), "0123…cdef");
|
||||
assert_eq!(format!("{:?}", h), "0123456789abcdef");
|
||||
assert_eq!(h.hex(), "0123456789abcdef");
|
||||
assert!(h == h);
|
||||
|
||||
@@ -211,7 +211,7 @@ impl Discovery {
|
||||
}
|
||||
|
||||
let mut ret:Vec<&NodeId> = Vec::new();
|
||||
for (_, nodes) in found {
|
||||
for nodes in found.values() {
|
||||
for n in nodes {
|
||||
if ret.len() < BUCKET_SIZE as usize /* && n->endpoint && n->endpoint.isAllowed() */ {
|
||||
ret.push(n);
|
||||
|
||||
@@ -325,7 +325,7 @@ impl Session {
|
||||
let mut rlp = RlpStream::new();
|
||||
rlp.append(&(PACKET_DISCONNECT as u32));
|
||||
rlp.begin_list(1);
|
||||
rlp.append(&(reason.clone() as u32));
|
||||
rlp.append(&(reason as u32));
|
||||
self.connection.send_packet(&rlp.out()).ok();
|
||||
NetworkError::Disconnect(reason)
|
||||
}
|
||||
|
||||
@@ -408,7 +408,7 @@ impl Decodable for Vec<u8> {
|
||||
fn decode<D>(decoder: &D) -> Result<Self, DecoderError> where D: Decoder {
|
||||
decoder.read_value(| bytes | {
|
||||
let mut res = vec![];
|
||||
res.extend(bytes);
|
||||
res.extend_from_slice(bytes);
|
||||
Ok(res)
|
||||
})
|
||||
}
|
||||
|
||||
@@ -293,7 +293,7 @@ impl<'a> Iterator for TrieDBIterator<'a> {
|
||||
|
||||
fn next(&mut self) -> Option<Self::Item> {
|
||||
let b = match self.trail.last_mut() {
|
||||
Some(ref mut b) => { b.increment(); b.clone() },
|
||||
Some(mut b) => { b.increment(); b.clone() },
|
||||
None => return None
|
||||
};
|
||||
match (b.status, b.node) {
|
||||
@@ -309,9 +309,8 @@ impl<'a> Iterator for TrieDBIterator<'a> {
|
||||
self.trail.pop();
|
||||
self.next()
|
||||
},
|
||||
(Status::At, Node::Leaf(_, v)) => Some((self.key(), v)),
|
||||
(Status::At, Node::Leaf(_, v)) | (Status::At, Node::Branch(_, Some(v))) => Some((self.key(), v)),
|
||||
(Status::At, Node::Extension(_, d)) => self.descend_next(d),
|
||||
(Status::At, Node::Branch(_, Some(v))) => Some((self.key(), v)),
|
||||
(Status::At, Node::Branch(_, _)) => self.next(),
|
||||
(Status::AtChild(i), Node::Branch(children, _)) if children[i].len() > 0 => {
|
||||
match i {
|
||||
|
||||
Reference in New Issue
Block a user