Import queue API revamp (#2856)

* ImportQueue methods are now mut

* Link methods are now mut

* Remove Arc from BasicSyncQueue

* Fix tests

* Remove BasicSyncQueue

* Change the import queue API

* Add buffered_link

* Remove obsolete tests

* Comments and style improvement pass

* Fix grandpa and comment cleanup

* Update core/consensus/common/src/import_queue.rs

Co-Authored-By: André Silva <andre.beat@gmail.com>
This commit is contained in:
Pierre Krieger
2019-06-19 03:50:48 +02:00
committed by DemiMarie-parity
parent de6d541c74
commit 7efc504d59
9 changed files with 566 additions and 858 deletions
@@ -76,7 +76,7 @@ impl<B, E, Block: BlockT<Hash=H256>, RA, PRA, SC> JustificationImport<Block>
{
type Error = ConsensusError;
fn on_start(&self, link: &dyn consensus_common::import_queue::Link<Block>) {
fn on_start(&self, link: &mut dyn consensus_common::import_queue::Link<Block>) {
let chain_info = self.inner.info().chain;
// request justifications for all pending changes for which change blocks have already been imported
@@ -144,7 +144,7 @@ impl<B, E, Block: BlockT<Hash=H256>, RA> FinalityProofImport<Block>
{
type Error = ConsensusError;
fn on_start(&self, link: &dyn consensus_common::import_queue::Link<Block>) {
fn on_start(&self, link: &mut dyn consensus_common::import_queue::Link<Block>) {
let chain_info = self.client.info().chain;
let data = self.data.read();
@@ -572,7 +572,7 @@ pub mod tests {
{
type Error = ConsensusError;
fn on_start(&self, link: &dyn consensus_common::import_queue::Link<Block>) {
fn on_start(&self, link: &mut dyn consensus_common::import_queue::Link<Block>) {
self.0.on_start(link)
}