bloom refactor (#7475)

* ethereum-types refactor in progress

* ethereum-types refactor in progress

* ethereum-types refactor in progress

* ethereum-types refactor in progress

* ethereum-types refactor finished

* cleanup bloom mess

* simplify usage of Bloom in few places

* removed obsolete util/src/lib.rs

* removed commented out code

* ethereum-types 0.1.4

* updated ethereum-types and tiny-keccak
This commit is contained in:
Marek Kotewicz
2018-01-14 22:43:28 +01:00
committed by GitHub
parent e7f36665bb
commit 668d910c44
65 changed files with 2023 additions and 519 deletions

View File

@@ -21,7 +21,7 @@ use futures::Future;
use native_contracts::ValidatorSet as Provider;
use hash::keccak;
use ethereum_types::{H160, H256, U256, Address};
use ethereum_types::{H160, H256, U256, Address, Bloom};
use parking_lot::{Mutex, RwLock};
use bytes::Bytes;
@@ -30,7 +30,6 @@ use unexpected::Mismatch;
use rlp::{UntrustedRlp, RlpStream};
use kvdb::DBValue;
use basic_types::LogBloom;
use client::EngineClient;
use machine::{AuxiliaryData, Call, EthereumMachine, AuxiliaryRequest};
use header::Header;
@@ -238,7 +237,7 @@ impl ValidatorSafeContract {
// produce the same bloom.
//
// The log data is an array of all new validator addresses.
fn expected_bloom(&self, header: &Header) -> LogBloom {
fn expected_bloom(&self, header: &Header) -> Bloom {
let topics = vec![*EVENT_NAME_HASH, *header.parent_hash()];
debug!(target: "engine", "Expected topics for header {}: {:?}",
@@ -253,7 +252,7 @@ impl ValidatorSafeContract {
// check receipts for log event. bloom should be `expected_bloom` for the
// header the receipts correspond to.
fn extract_from_event(&self, bloom: LogBloom, header: &Header, receipts: &[Receipt]) -> Option<SimpleList> {
fn extract_from_event(&self, bloom: Bloom, header: &Header, receipts: &[Receipt]) -> Option<SimpleList> {
let check_log = |log: &LogEntry| {
log.address == self.address &&
log.topics.len() == 2 &&