Introduce block authorship soft deadline (#9663)

* Soft limit.

* Add soft deadline tests.

* cargo +nightly fmt --all

* Fix sc-service test.

* Improving tests
This commit is contained in:
Tomasz Drwięga
2021-10-04 16:30:46 +02:00
committed by GitHub
parent 374fb6a921
commit 8ae18720e6
6 changed files with 231 additions and 25 deletions
@@ -89,9 +89,20 @@ impl Keyring {
pub fn public(self) -> Public {
self.pair().public()
}
pub fn to_seed(self) -> String {
format!("//{}", self)
}
/// Create a crypto `Pair` from a numeric value.
pub fn numeric(idx: usize) -> Pair {
Pair::from_string(&format!("//{}", idx), None).expect("numeric values are known good; qed")
}
/// Get account id of a `numeric` account.
pub fn numeric_id(idx: usize) -> AccountId32 {
(*Self::numeric(idx).public().as_array_ref()).into()
}
}
impl From<Keyring> for &'static str {