Merge branch 'master' into new-jsonrpc

This commit is contained in:
Tomasz Drwięga
2017-03-21 09:35:50 +01:00
70 changed files with 859 additions and 848 deletions

View File

@@ -23,7 +23,7 @@
use ethcore::ids::BlockId;
use util::{Bytes, H256, U256, HashDB, MemoryDB};
use util::trie::{self, TrieMut, TrieDBMut, Trie, TrieDB, Recorder};
use rlp::{Stream, RlpStream, UntrustedRlp, View};
use rlp::{RlpStream, UntrustedRlp, View};
// encode a key.
macro_rules! key {

View File

@@ -24,7 +24,7 @@ use ethcore::receipt::Receipt;
use io::TimerToken;
use network::{NetworkProtocolHandler, NetworkContext, PeerId};
use rlp::{RlpStream, Stream, UntrustedRlp, View};
use rlp::{RlpStream, UntrustedRlp, View};
use util::hash::H256;
use util::{Bytes, DBValue, Mutex, RwLock, U256};
use time::{Duration, SteadyTime};

View File

@@ -105,7 +105,7 @@ impl Default for CostTable {
}
}
impl RlpEncodable for CostTable {
impl Encodable for CostTable {
fn rlp_append(&self, s: &mut RlpStream) {
fn append_cost(s: &mut RlpStream, msg_id: u8, cost: &Cost) {
s.begin_list(3)

View File

@@ -16,7 +16,7 @@
//! Peer status and capabilities.
use rlp::{DecoderError, RlpDecodable, RlpEncodable, RlpStream, Stream, UntrustedRlp, View};
use rlp::{DecoderError, RlpDecodable, Encodable, RlpStream, UntrustedRlp, View};
use util::{H256, U256};
use super::request_credits::FlowParams;
@@ -126,7 +126,7 @@ impl<'a> Parser<'a> {
}
// Helper for encoding a key-value pair
fn encode_pair<T: RlpEncodable>(key: Key, val: &T) -> Vec<u8> {
fn encode_pair<T: Encodable>(key: Key, val: &T) -> Vec<u8> {
let mut s = RlpStream::new_list(2);
s.append(&key.as_str()).append(val);
s.out()
@@ -374,7 +374,7 @@ mod tests {
use super::*;
use super::super::request_credits::FlowParams;
use util::{U256, H256};
use rlp::{RlpStream, Stream ,UntrustedRlp, View};
use rlp::{RlpStream, UntrustedRlp, View};
#[test]
fn full_handshake() {

View File

@@ -33,7 +33,7 @@ use ethcore::executed::{Executed, ExecutionError};
use futures::{Async, Poll, Future};
use futures::sync::oneshot::{self, Sender, Receiver};
use network::PeerId;
use rlp::{RlpStream, Stream};
use rlp::RlpStream;
use util::{Bytes, DBValue, RwLock, Mutex, U256};
use util::sha3::{SHA3_NULL_RLP, SHA3_EMPTY_LIST_RLP};

View File

@@ -26,7 +26,7 @@ use ethcore::receipt::Receipt;
use ethcore::state::{self, ProvedExecution};
use ethcore::transaction::SignedTransaction;
use rlp::{RlpStream, Stream, UntrustedRlp, View};
use rlp::{RlpStream, UntrustedRlp, View};
use util::{Address, Bytes, DBValue, HashDB, H256, U256};
use util::memorydb::MemoryDB;
use util::sha3::Hashable;
@@ -323,7 +323,7 @@ mod tests {
#[test]
fn check_body() {
use rlp::{RlpStream, Stream};
use rlp::RlpStream;
let header = Header::new();
let mut body_stream = RlpStream::new_list(2);
@@ -360,7 +360,7 @@ mod tests {
#[test]
fn check_state_proof() {
use rlp::{RlpStream, Stream};
use rlp::RlpStream;
let mut root = H256::default();
let mut db = MemoryDB::new();

View File

@@ -128,7 +128,7 @@ pub trait Provider: Send + Sync {
///
/// Returns a vector of RLP-encoded lists satisfying the requests.
fn proofs(&self, req: request::StateProofs) -> Vec<Bytes> {
use rlp::{RlpStream, Stream};
use rlp::RlpStream;
let mut results = Vec::with_capacity(req.requests.len());
@@ -166,7 +166,7 @@ pub trait Provider: Send + Sync {
/// The first element is a block header and the second a merkle proof of
/// the header in a requested CHT.
fn header_proofs(&self, req: request::HeaderProofs) -> Vec<Bytes> {
use rlp::{self, RlpStream, Stream};
use rlp::{self, RlpStream};
req.requests.into_iter()
.map(|req| self.header_proof(req))