mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-01 03:07:56 +00:00
Get rid of test-helpers feature in sc-consensus-babe (#8486)
This is not really required and having a special `test-helpers` feature is a bad idea anyway.
This commit is contained in:
@@ -1647,41 +1647,3 @@ pub fn import_queue<Block: BlockT, Client, SelectChain, Inner, CAW>(
|
||||
registry,
|
||||
))
|
||||
}
|
||||
|
||||
/// BABE test helpers. Utility methods for manually authoring blocks.
|
||||
#[cfg(feature = "test-helpers")]
|
||||
pub mod test_helpers {
|
||||
use super::*;
|
||||
|
||||
/// Try to claim the given slot and return a `BabePreDigest` if
|
||||
/// successful.
|
||||
pub fn claim_slot<B, C>(
|
||||
slot: Slot,
|
||||
parent: &B::Header,
|
||||
client: &C,
|
||||
keystore: SyncCryptoStorePtr,
|
||||
link: &BabeLink<B>,
|
||||
) -> Option<PreDigest> where
|
||||
B: BlockT,
|
||||
C: ProvideRuntimeApi<B> +
|
||||
ProvideCache<B> +
|
||||
HeaderBackend<B> +
|
||||
HeaderMetadata<B, Error = ClientError>,
|
||||
C::Api: BabeApi<B>,
|
||||
{
|
||||
let epoch_changes = link.epoch_changes.lock();
|
||||
let epoch = epoch_changes.epoch_data_for_child_of(
|
||||
descendent_query(client),
|
||||
&parent.hash(),
|
||||
parent.number().clone(),
|
||||
slot,
|
||||
|slot| Epoch::genesis(&link.config, slot),
|
||||
).unwrap().unwrap();
|
||||
|
||||
authorship::claim_slot(
|
||||
slot,
|
||||
&epoch,
|
||||
&keystore,
|
||||
).map(|(digest, _)| digest)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user