optimize justification before submit (#1887)

* optimize justification before submit

* fmt

* spelling

* clippy

* fmt again

* aaand compilation

* clippy
This commit is contained in:
Svyatoslav Nikolsky
2023-02-20 11:57:54 +03:00
committed by Bastian Köcher
parent bb078b8226
commit 1d6e8a9a26
7 changed files with 290 additions and 8 deletions
+3 -2
View File
@@ -18,7 +18,7 @@
#![cfg_attr(not(feature = "std"), no_std)]
use bp_header_chain::justification::GrandpaJustification;
use bp_header_chain::justification::{required_justification_precommits, GrandpaJustification};
use codec::Encode;
use sp_finality_grandpa::{AuthorityId, AuthoritySignature, AuthorityWeight, SetId};
use sp_runtime::traits::{Header as HeaderT, One, Zero};
@@ -57,11 +57,12 @@ pub struct JustificationGeneratorParams<H> {
impl<H: HeaderT> Default for JustificationGeneratorParams<H> {
fn default() -> Self {
let required_signatures = required_justification_precommits(test_keyring().len() as _);
Self {
header: test_header(One::one()),
round: TEST_GRANDPA_ROUND,
set_id: TEST_GRANDPA_SET_ID,
authorities: test_keyring(),
authorities: test_keyring().into_iter().take(required_signatures as _).collect(),
ancestors: 2,
forks: 1,
}