Merge pull request #418 from ethcore/jsonrpc2

bloomfilter
This commit is contained in:
Gav Wood
2016-02-26 13:08:41 +01:00
26 changed files with 3338 additions and 553 deletions

View File

@@ -207,7 +207,7 @@ impl<K, V> RangeCollection<K, V> for Vec<(K, Vec<V>)> where K: Ord + PartialEq +
}
#[test]
#[allow(cyclomatic_complexity)]
#[cfg_attr(feature="dev", allow(cyclomatic_complexity))]
fn test_range() {
use std::cmp::{Ordering};

View File

@@ -23,6 +23,8 @@ use io::SyncIo;
use chain::{ChainSync};
use ethcore::receipt::Receipt;
use ethcore::transaction::LocalizedTransaction;
use ethcore::filter::Filter;
use ethcore::log_entry::LocalizedLogEntry;
pub struct TestBlockChainClient {
pub blocks: RwLock<HashMap<H256, Bytes>>,
@@ -111,6 +113,14 @@ impl BlockChainClient for TestBlockChainClient {
unimplemented!();
}
fn blocks_with_bloom(&self, _bloom: &H2048, _from_block: BlockId, _to_block: BlockId) -> Option<Vec<BlockNumber>> {
unimplemented!();
}
fn logs(&self, filter: Filter) -> Vec<LocalizedLogEntry> {
unimplemented!();
}
fn block_header(&self, id: BlockId) -> Option<Bytes> {
self.block_hash(id).and_then(|hash| self.blocks.read().unwrap().get(&hash).map(|r| Rlp::new(r).at(0).as_raw().to_vec()))
}