diff --git a/consensus/src/lib.rs b/consensus/src/lib.rs
index a791ff36ca..1f382aee87 100644
--- a/consensus/src/lib.rs
+++ b/consensus/src/lib.rs
@@ -14,8 +14,10 @@
// You should have received a copy of the GNU General Public License
// along with Cumulus. If not, see .
-use substrate_client::{backend::Backend, Client, BlockchainEvents};
-use substrate_client::error::{Error as ClientError, Result as ClientResult};
+use substrate_client::{backend::Backend, CallExecutor, Client, BlockchainEvents};
+use substrate_client::error::{Error as ClientError, Result as ClientResult, ErrorKind as ClientErrorKind};
+use substrate_primitives::{Blake2Hasher, H256};
+use sr_primitives::generic::BlockId;
use sr_primitives::traits::{Block as BlockT, Header as HeaderT, ProvideRuntimeApi};
use polkadot_primitives::{BlockNumber as PBlockNumber, Hash as PHash, parachain::Id as ParaId};
@@ -119,4 +121,26 @@ pub fn follow_polkadot<'a, L: 'a, P: 'a>(para_id: ParaId, local: Arc, polkado
follow_best.join(follow_finalized)
.map_err(|e| warn!("Could not follow relay-chain: {:?}", e))
.map(|((), ())| ())
+}
+
+impl LocalClient for Client where
+ B: Backend,
+ E: CallExecutor,
+ Block: BlockT,
+{
+ type Block = Block;
+
+ fn mark_best(&self, _hash: ::Hash) -> ClientResult {
+ Ok(true) // TODO: https://github.com/paritytech/substrate/pull/1489
+ }
+
+ fn finalize(&self, hash: ::Hash) -> ClientResult {
+ match self.finalize_block(BlockId::hash(hash), None, true) {
+ Ok(()) => Ok(true),
+ Err(e) => match e.kind() {
+ ClientErrorKind::UnknownBlock(_) => Ok(false),
+ _ => Err(e),
+ }
+ }
+ }
}
\ No newline at end of file