This commit is contained in:
debris
2017-08-31 11:35:41 +02:00
parent f0e8abb07b
commit 7849fff41e
43 changed files with 130 additions and 95 deletions

View File

@@ -38,7 +38,7 @@ use ethcore::filter::Filter as EthcoreFilter;
use ethcore::transaction::{Action, SignedTransaction, Transaction as EthTransaction};
use ethsync::LightSync;
use rlp::UntrustedRlp;
use util::sha3::{SHA3_NULL_RLP, SHA3_EMPTY_LIST_RLP};
use hash::{KECCAK_NULL_RLP, KECCAK_EMPTY_LIST_RLP};
use util::{RwLock, Mutex, U256};
use futures::{future, Future, BoxFuture, IntoFuture};
@@ -295,7 +295,7 @@ impl Eth for EthClient {
let (sync, on_demand) = (self.sync.clone(), self.on_demand.clone());
self.fetcher().header(BlockId::Hash(hash.into())).and_then(move |hdr| {
if hdr.transactions_root() == SHA3_NULL_RLP {
if hdr.transactions_root() == KECCAK_NULL_RLP {
future::ok(Some(U256::from(0).into())).boxed()
} else {
sync.with_context(|ctx| on_demand.request(ctx, request::Body(hdr.into())))
@@ -311,7 +311,7 @@ impl Eth for EthClient {
let (sync, on_demand) = (self.sync.clone(), self.on_demand.clone());
self.fetcher().header(num.into()).and_then(move |hdr| {
if hdr.transactions_root() == SHA3_NULL_RLP {
if hdr.transactions_root() == KECCAK_NULL_RLP {
future::ok(Some(U256::from(0).into())).boxed()
} else {
sync.with_context(|ctx| on_demand.request(ctx, request::Body(hdr.into())))
@@ -327,7 +327,7 @@ impl Eth for EthClient {
let (sync, on_demand) = (self.sync.clone(), self.on_demand.clone());
self.fetcher().header(BlockId::Hash(hash.into())).and_then(move |hdr| {
if hdr.uncles_hash() == SHA3_EMPTY_LIST_RLP {
if hdr.uncles_hash() == KECCAK_EMPTY_LIST_RLP {
future::ok(Some(U256::from(0).into())).boxed()
} else {
sync.with_context(|ctx| on_demand.request(ctx, request::Body(hdr.into())))
@@ -343,7 +343,7 @@ impl Eth for EthClient {
let (sync, on_demand) = (self.sync.clone(), self.on_demand.clone());
self.fetcher().header(num.into()).and_then(move |hdr| {
if hdr.uncles_hash() == SHA3_EMPTY_LIST_RLP {
if hdr.uncles_hash() == KECCAK_EMPTY_LIST_RLP {
future::ok(Some(U256::from(0).into())).boxed()
} else {
sync.with_context(|ctx| on_demand.request(ctx, request::Body(hdr.into())))

View File

@@ -23,7 +23,7 @@ use std::sync::Arc;
use ethsync::ManageNetwork;
use fetch::Fetch;
use futures::{BoxFuture, Future};
use util::sha3;
use hash::keccak_buffer;
use jsonrpc_core::Error;
use v1::helpers::dapps::DappsService;
@@ -129,7 +129,7 @@ impl<F: Fetch> ParitySet for ParitySetClient<F> {
result
.map_err(errors::fetch)
.and_then(|response| {
sha3(&mut io::BufReader::new(response)).map_err(errors::fetch)
keccak_buffer(&mut io::BufReader::new(response)).map_err(errors::fetch)
})
.map(Into::into)
}))