fn register_finality_tracker_inherent_data_provider<B, E, Block: BlockT<Hash=H256>, RA>(
	client: Arc<Client<B, E, Block, RA>>,
	inherent_data_providers: &InherentDataProviders,
) -> Result<(), consensus_common::Error> where
	B: Backend<Block, Blake2Hasher> + 'static,
	E: CallExecutor<Block, Blake2Hasher> + Send + Sync + 'static,
	RA: Send + Sync + 'static,
{
	if !inherent_data_providers.has_provider(&srml_finality_tracker::INHERENT_IDENTIFIER) {
		inherent_data_providers
			.register_provider(srml_finality_tracker::InherentDataProvider::new(move || {
				match client.backend().blockchain().info() {
					Err(e) => Err(std::borrow::Cow::Owned(e.to_string())),
					Ok(info) => {
						telemetry!(CONSENSUS_INFO; "afg.finalized";
							"finalized_number" => ?info.finalized_number,
							"finalized_hash" => ?info.finalized_hash,
						);
						Ok(info.finalized_number)
					},
				}
			}))
			.map_err(|err| consensus_common::ErrorKind::InherentData(err.into()).into())
	} else {
		Ok(())
	}
}
/// Register the finality tracker inherent data provider (which is used by
/// GRANDPA), if not registered already.
Register the finality tracker inherent data provider (which is used by
GRANDPA), if not registered already.
Register the finality tracker inherent data provider ( which is used by GRANDPA ) if not registered already .
fn register_finality_tracker_inherent_data_provider<B, E, Block: BlockT<Hash=H256>, RA>(
	client: Arc<Client<B, E, Block, RA>>,
	inherent_data_providers: &InherentDataProviders,
) -> Result<(), consensus_common::Error> where
	B: Backend<Block, Blake2Hasher> + 'static,
	E: CallExecutor<Block, Blake2Hasher> + Send + Sync + 'static,
	RA: Send + Sync + 'static,
{
	if !inherent_data_providers.has_provider(&srml_finality_tracker::INHERENT_IDENTIFIER) {
		inherent_data_providers
			.register_provider(srml_finality_tracker::InherentDataProvider::new(move || {
				match client.backend().blockchain().info() {
					Err(e) => Err(std::borrow::Cow::Owned(e.to_string())),
					Ok(info) => {
						telemetry!(CONSENSUS_INFO; "afg.finalized";
							"finalized_number" => ?info.finalized_number,
							"finalized_hash" => ?info.finalized_hash,
						);
						Ok(info.finalized_number)
					},
				}
			}))
			.map_err(|err| consensus_common::ErrorKind::InherentData(err.into()).into())
	} else {
		Ok(())
	}
}
fn register_finality_tracker_inherent_data_provider < B , E , Block : BlockT < Hash = H256 > , RA > ( client : Arc < Client < B , E , Block , RA > > , inherent_data_providers : & InherentDataProviders , ) -> Result < ( ) , consensus_common :: Error > where B : Backend < Block , Blake2Hasher > + ' static , E : CallExecutor < Block , Blake2Hasher > + Send + Sync + ' static , RA : Send + Sync + ' static , { if ! inherent_data_providers . has_provider ( & srml_finality_tracker :: INHERENT_IDENTIFIER ) { inherent_data_providers . register_provider ( srml_finality_tracker :: InherentDataProvider :: new ( move | | { match client . backend ( ) . blockchain ( ) . info ( ) { Err ( e ) => Err ( std :: borrow :: Cow :: Owned ( e . to_string ( ) ) ) , Ok ( info ) => { telemetry ! ( CONSENSUS_INFO " " " " info finalized_number " " info finalized_hash ) ; Ok ( info . finalized_number ) } , } } ) ) . map_err ( | err | consensus_common :: ErrorKind :: InherentData ( err . into ( ) ) . into ( ) ) } else { Ok ( ( ) ) } }
Register the finality tracker inherent data provider (which is used by
GRANDPA), if not registered already.
Register the finality tracker inherent data provider ( which is used by GRANDPA ) if not registered already .
client
Arc<Client<B, E, Block, RA>>
inherent_data_providers
&InherentDataProviders
client
Arc<Client<B, E, Block, RA>>
inherent_data_providers
&InherentDataProviders