rpc & sync recompile
This commit is contained in:
parent
8fc03e2dc2
commit
ef8dd23254
1
Cargo.lock
generated
1
Cargo.lock
generated
@ -342,6 +342,7 @@ dependencies = [
|
|||||||
"ethash 1.3.0",
|
"ethash 1.3.0",
|
||||||
"ethcore 1.3.0",
|
"ethcore 1.3.0",
|
||||||
"ethcore-devtools 1.3.0",
|
"ethcore-devtools 1.3.0",
|
||||||
|
"ethcore-ipc 1.3.0",
|
||||||
"ethcore-util 1.3.0",
|
"ethcore-util 1.3.0",
|
||||||
"ethjson 0.1.0",
|
"ethjson 0.1.0",
|
||||||
"ethsync 1.3.0",
|
"ethsync 1.3.0",
|
||||||
|
@ -25,6 +25,7 @@ transient-hashmap = "0.1"
|
|||||||
serde_macros = { version = "0.7.0", optional = true }
|
serde_macros = { version = "0.7.0", optional = true }
|
||||||
clippy = { version = "0.0.77", optional = true}
|
clippy = { version = "0.0.77", optional = true}
|
||||||
json-ipc-server = { git = "https://github.com/ethcore/json-ipc-server.git" }
|
json-ipc-server = { git = "https://github.com/ethcore/json-ipc-server.git" }
|
||||||
|
ethcore-ipc = { path = "../ipc/rpc" }
|
||||||
|
|
||||||
[build-dependencies]
|
[build-dependencies]
|
||||||
serde_codegen = { version = "0.7.0", optional = true }
|
serde_codegen = { version = "0.7.0", optional = true }
|
||||||
|
@ -32,6 +32,7 @@ extern crate ethcore;
|
|||||||
extern crate ethsync;
|
extern crate ethsync;
|
||||||
extern crate transient_hashmap;
|
extern crate transient_hashmap;
|
||||||
extern crate json_ipc_server as ipc;
|
extern crate json_ipc_server as ipc;
|
||||||
|
extern crate ethcore_ipc;
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
extern crate ethjson;
|
extern crate ethjson;
|
||||||
|
@ -435,12 +435,12 @@ impl<C, S, M, EM> Eth for EthClient<C, S, M, EM> where
|
|||||||
|
|
||||||
fn uncle_by_block_hash_and_index(&self, params: Params) -> Result<Value, Error> {
|
fn uncle_by_block_hash_and_index(&self, params: Params) -> Result<Value, Error> {
|
||||||
from_params::<(H256, Index)>(params)
|
from_params::<(H256, Index)>(params)
|
||||||
.and_then(|(hash, index)| self.uncle(UncleID(BlockID::Hash(hash), index.value())))
|
.and_then(|(hash, index)| self.uncle(UncleID { block: BlockID::Hash(hash), position: index.value() }))
|
||||||
}
|
}
|
||||||
|
|
||||||
fn uncle_by_block_number_and_index(&self, params: Params) -> Result<Value, Error> {
|
fn uncle_by_block_number_and_index(&self, params: Params) -> Result<Value, Error> {
|
||||||
from_params::<(BlockNumber, Index)>(params)
|
from_params::<(BlockNumber, Index)>(params)
|
||||||
.and_then(|(number, index)| self.uncle(UncleID(number.into(), index.value())))
|
.and_then(|(number, index)| self.uncle(UncleID { block: number.into(), position: index.value() }))
|
||||||
}
|
}
|
||||||
|
|
||||||
fn compilers(&self, params: Params) -> Result<Value, Error> {
|
fn compilers(&self, params: Params) -> Result<Value, Error> {
|
||||||
|
@ -85,7 +85,7 @@ impl Into<EthFilter> for Filter {
|
|||||||
VariadicValue::Single(t) => Some(vec![t]),
|
VariadicValue::Single(t) => Some(vec![t]),
|
||||||
VariadicValue::Multiple(t) => Some(t)
|
VariadicValue::Multiple(t) => Some(t)
|
||||||
}).filter_map(|m| m).collect()).into_iter();
|
}).filter_map(|m| m).collect()).into_iter();
|
||||||
[iter.next(), iter.next(), iter.next(), iter.next()]
|
vec![iter.next(), iter.next(), iter.next(), iter.next()]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -162,7 +162,7 @@ pub enum Diff<T> where T: Serialize {
|
|||||||
Changed(ChangedType<T>),
|
Changed(ChangedType<T>),
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<T, U> From<account_diff::Diff<T>> for Diff<U> where T: Eq, U: Serialize + From<T> {
|
impl<T, U> From<account_diff::Diff<T>> for Diff<U> where T: Eq + ::ethcore_ipc::BinaryConvertable, U: Serialize + From<T> {
|
||||||
fn from(c: account_diff::Diff<T>) -> Self {
|
fn from(c: account_diff::Diff<T>) -> Self {
|
||||||
match c {
|
match c {
|
||||||
account_diff::Diff::Same => Diff::Same,
|
account_diff::Diff::Same => Diff::Same,
|
||||||
@ -205,7 +205,7 @@ impl Serialize for StateDiff {
|
|||||||
|
|
||||||
impl From<state_diff::StateDiff> for StateDiff {
|
impl From<state_diff::StateDiff> for StateDiff {
|
||||||
fn from(c: state_diff::StateDiff) -> Self {
|
fn from(c: state_diff::StateDiff) -> Self {
|
||||||
StateDiff(c.0.into_iter().map(|(k, v)| (k, v.into())).collect())
|
StateDiff(c.raw.into_iter().map(|(k, v)| (k, v.into())).collect())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -93,7 +93,7 @@ use util::*;
|
|||||||
use std::mem::{replace};
|
use std::mem::{replace};
|
||||||
use ethcore::views::{HeaderView, BlockView};
|
use ethcore::views::{HeaderView, BlockView};
|
||||||
use ethcore::header::{BlockNumber, Header as BlockHeader};
|
use ethcore::header::{BlockNumber, Header as BlockHeader};
|
||||||
use ethcore::client::{BlockChainClient, BlockStatus, BlockID, BlockChainInfo};
|
use ethcore::client::{BlockChainClient, BlockStatus, BlockID, BlockChainInfo, BlockImportError};
|
||||||
use ethcore::error::*;
|
use ethcore::error::*;
|
||||||
use ethcore::block::Block;
|
use ethcore::block::Block;
|
||||||
use io::SyncIo;
|
use io::SyncIo;
|
||||||
@ -544,10 +544,10 @@ impl ChainSync {
|
|||||||
peer.latest_number = Some(header.number());
|
peer.latest_number = Some(header.number());
|
||||||
}
|
}
|
||||||
match io.chain().import_block(block_rlp.as_raw().to_vec()) {
|
match io.chain().import_block(block_rlp.as_raw().to_vec()) {
|
||||||
Err(Error::Import(ImportError::AlreadyInChain)) => {
|
Err(BlockImportError::Import(ImportError::AlreadyInChain)) => {
|
||||||
trace!(target: "sync", "New block already in chain {:?}", h);
|
trace!(target: "sync", "New block already in chain {:?}", h);
|
||||||
},
|
},
|
||||||
Err(Error::Import(ImportError::AlreadyQueued)) => {
|
Err(BlockImportError::Import(ImportError::AlreadyQueued)) => {
|
||||||
trace!(target: "sync", "New block already queued {:?}", h);
|
trace!(target: "sync", "New block already queued {:?}", h);
|
||||||
},
|
},
|
||||||
Ok(_) => {
|
Ok(_) => {
|
||||||
@ -557,7 +557,7 @@ impl ChainSync {
|
|||||||
}
|
}
|
||||||
trace!(target: "sync", "New block queued {:?} ({})", h, header.number);
|
trace!(target: "sync", "New block queued {:?} ({})", h, header.number);
|
||||||
},
|
},
|
||||||
Err(Error::Block(BlockError::UnknownParent(p))) => {
|
Err(BlockImportError::Block(BlockError::UnknownParent(p))) => {
|
||||||
unknown = true;
|
unknown = true;
|
||||||
trace!(target: "sync", "New block with unknown parent ({:?}) {:?}", p, h);
|
trace!(target: "sync", "New block with unknown parent ({:?}) {:?}", p, h);
|
||||||
},
|
},
|
||||||
@ -841,11 +841,11 @@ impl ChainSync {
|
|||||||
}
|
}
|
||||||
|
|
||||||
match io.chain().import_block(block) {
|
match io.chain().import_block(block) {
|
||||||
Err(Error::Import(ImportError::AlreadyInChain)) => {
|
Err(BlockImportError::Import(ImportError::AlreadyInChain)) => {
|
||||||
trace!(target: "sync", "Block already in chain {:?}", h);
|
trace!(target: "sync", "Block already in chain {:?}", h);
|
||||||
self.block_imported(&h, number, &parent);
|
self.block_imported(&h, number, &parent);
|
||||||
},
|
},
|
||||||
Err(Error::Import(ImportError::AlreadyQueued)) => {
|
Err(BlockImportError::Import(ImportError::AlreadyQueued)) => {
|
||||||
trace!(target: "sync", "Block already queued {:?}", h);
|
trace!(target: "sync", "Block already queued {:?}", h);
|
||||||
self.block_imported(&h, number, &parent);
|
self.block_imported(&h, number, &parent);
|
||||||
},
|
},
|
||||||
@ -854,7 +854,7 @@ impl ChainSync {
|
|||||||
imported.insert(h.clone());
|
imported.insert(h.clone());
|
||||||
self.block_imported(&h, number, &parent);
|
self.block_imported(&h, number, &parent);
|
||||||
},
|
},
|
||||||
Err(Error::Block(BlockError::UnknownParent(_))) if self.state == SyncState::NewBlocks => {
|
Err(BlockImportError::Block(BlockError::UnknownParent(_))) if self.state == SyncState::NewBlocks => {
|
||||||
trace!(target: "sync", "Unknown new block parent, restarting sync");
|
trace!(target: "sync", "Unknown new block parent, restarting sync");
|
||||||
break;
|
break;
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user