Keep all enacted blocks notify in order (#8524)

* Keep all enacted blocks notify in order

* Collect is unnecessary

* Update ChainNotify to use ChainRouteType

* Fix all ethcore fn defs

* Wrap the type within ChainRoute

* Fix private-tx and sync api

* Fix secret_store API

* Fix updater API

* Fix rpc api

* Fix informant api

* Eagerly cache enacted/retracted and remove contain_enacted/retracted

* Fix indent

* tests: should use full expr form for struct constructor

* Use into_enacted_retracted to further avoid copy

* typo: not a function

* rpc/tests: ChainRoute -> ChainRoute::new
This commit is contained in:
Wei Tang
2018-05-07 18:58:25 +08:00
committed by André Silva
parent f99a47a995
commit 3ba4fe2b47
15 changed files with 158 additions and 98 deletions

View File

@@ -17,7 +17,7 @@
//! Watcher for snapshot-related chain events.
use parking_lot::Mutex;
use client::{BlockInfo, Client, ChainNotify, ClientIoMessage};
use client::{BlockInfo, Client, ChainNotify, ChainRoute, ClientIoMessage};
use ids::BlockId;
use io::IoChannel;
@@ -103,8 +103,7 @@ impl ChainNotify for Watcher {
&self,
imported: Vec<H256>,
_: Vec<H256>,
_: Vec<H256>,
_: Vec<H256>,
_: ChainRoute,
_: Vec<H256>,
_: Vec<Bytes>,
_duration: Duration)
@@ -131,7 +130,7 @@ impl ChainNotify for Watcher {
mod tests {
use super::{Broadcast, Oracle, Watcher};
use client::ChainNotify;
use client::{ChainNotify, ChainRoute};
use ethereum_types::{H256, U256};
@@ -174,8 +173,7 @@ mod tests {
watcher.new_blocks(
hashes,
vec![],
vec![],
vec![],
ChainRoute::default(),
vec![],
vec![],
DURATION_ZERO,