mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-22 23:11:08 +00:00
Fix code duplication in tests (#1575)
This commit is contained in:
committed by
GitHub
parent
756347ab24
commit
d81a2e2fa9
@@ -159,6 +159,11 @@ pub fn dummy_pvd(parent_head: HeadData, relay_parent_number: u32) -> PersistedVa
|
||||
}
|
||||
}
|
||||
|
||||
/// Creates a meaningless signature
|
||||
pub fn dummy_signature() -> polkadot_primitives::ValidatorSignature {
|
||||
sp_core::crypto::UncheckedFrom::unchecked_from([1u8; 64])
|
||||
}
|
||||
|
||||
/// Create a meaningless candidate, returning its receipt and PVD.
|
||||
pub fn make_candidate(
|
||||
relay_parent_hash: Hash,
|
||||
@@ -244,6 +249,11 @@ pub fn resign_candidate_descriptor_with_collator<H: AsRef<[u8]>>(
|
||||
descriptor.signature = signature;
|
||||
}
|
||||
|
||||
/// Extracts validators's public keus (`ValidatorId`) from `Sr25519Keyring`
|
||||
pub fn validator_pubkeys(val_ids: &[Sr25519Keyring]) -> Vec<ValidatorId> {
|
||||
val_ids.iter().map(|v| v.public().into()).collect()
|
||||
}
|
||||
|
||||
/// Builder for `CandidateReceipt`.
|
||||
pub struct TestCandidateBuilder {
|
||||
pub para_id: ParaId,
|
||||
@@ -298,7 +308,3 @@ impl rand::RngCore for AlwaysZeroRng {
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
pub fn dummy_signature() -> polkadot_primitives::ValidatorSignature {
|
||||
sp_core::crypto::UncheckedFrom::unchecked_from([1u8; 64])
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user