@@ -25,7 +25,7 @@ use runtime_primitives::bft::Justification;
25
25
/// Local client abstraction for the network.
26
26
pub trait Client < Block : BlockT > : Send + Sync {
27
27
/// Import a new block. Parent is supposed to be existing in the blockchain.
28
- fn import ( & self , is_best : bool , header : Block :: Header , justification : Justification < Block :: Hash > , body : Option < Vec < Block :: Extrinsic > > ) -> Result < ImportResult , Error > ;
28
+ fn import ( & self , origin : BlockOrigin , header : Block :: Header , justification : Justification < Block :: Hash > , body : Option < Vec < Block :: Extrinsic > > ) -> Result < ImportResult , Error > ;
29
29
30
30
/// Get blockchain info.
31
31
fn info ( & self ) -> Result < ClientInfo < Block > , Error > ;
@@ -54,10 +54,9 @@ impl<B, E, Block> Client<Block> for SubstrateClient<B, E, Block> where
54
54
E : CallExecutor < Block > + Send + Sync + ' static ,
55
55
Block : BlockT ,
56
56
{
57
- fn import ( & self , is_best : bool , header : Block :: Header , justification : Justification < Block :: Hash > , body : Option < Vec < Block :: Extrinsic > > ) -> Result < ImportResult , Error > {
57
+ fn import ( & self , origin : BlockOrigin , header : Block :: Header , justification : Justification < Block :: Hash > , body : Option < Vec < Block :: Extrinsic > > ) -> Result < ImportResult , Error > {
58
58
// TODO: defer justification check.
59
59
let justified_header = self . check_justification ( header, justification. into ( ) ) ?;
60
- let origin = if is_best { BlockOrigin :: NetworkBroadcast } else { BlockOrigin :: NetworkInitialSync } ;
61
60
( self as & SubstrateClient < B , E , Block > ) . import_block ( origin, justified_header, body)
62
61
}
63
62
0 commit comments