mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-01 05:41:03 +00:00
grandpa: update to finality-grandpa v0.12.0 (#5853)
* grandpa: update to v0.12.0 * grandpa: fix tests * grandpa: better validation of authority set invariants * grandpa: avoid duplicating invalid authority list check * grandpa: add missing doc * grandpa: better validation of expect proofs * grandpa: fix test compilation * grandpa: fix tests * grandpa: add test for AuthoritySet invariants * grandpa: bump finality-grandpa to v0.12.0
This commit is contained in:
@@ -29,7 +29,7 @@ use std::{borrow::Cow, pin::Pin, task::{Context, Poll}};
|
||||
use crate::environment::SharedVoterSetState;
|
||||
use sp_finality_grandpa::{AuthorityList, GRANDPA_ENGINE_ID};
|
||||
use super::gossip::{self, GossipValidator};
|
||||
use super::{AuthorityId, VoterSet, Round, SetId};
|
||||
use super::{VoterSet, Round, SetId};
|
||||
|
||||
#[derive(Debug)]
|
||||
pub(crate) enum Event {
|
||||
@@ -142,11 +142,15 @@ fn voter_set_state() -> SharedVoterSetState<Block> {
|
||||
use crate::authorities::AuthoritySet;
|
||||
use crate::environment::VoterSetState;
|
||||
use finality_grandpa::round::State as RoundState;
|
||||
use sp_core::H256;
|
||||
use sp_core::{crypto::Public, H256};
|
||||
use sp_finality_grandpa::AuthorityId;
|
||||
|
||||
let state = RoundState::genesis((H256::zero(), 0));
|
||||
let base = state.prevote_ghost.unwrap();
|
||||
let voters = AuthoritySet::genesis(Vec::new());
|
||||
|
||||
let voters = vec![(AuthorityId::from_slice(&[1; 32]), 1)];
|
||||
let voters = AuthoritySet::genesis(voters).unwrap();
|
||||
|
||||
let set_state = VoterSetState::live(
|
||||
0,
|
||||
&voters,
|
||||
@@ -212,7 +216,7 @@ impl sc_network_gossip::ValidatorContext<Block> for NoopContext {
|
||||
fn good_commit_leads_to_relay() {
|
||||
let private = [Ed25519Keyring::Alice, Ed25519Keyring::Bob, Ed25519Keyring::Charlie];
|
||||
let public = make_ids(&private[..]);
|
||||
let voter_set = Arc::new(public.iter().cloned().collect::<VoterSet<AuthorityId>>());
|
||||
let voter_set = Arc::new(VoterSet::new(public.iter().cloned()).unwrap());
|
||||
|
||||
let round = 1;
|
||||
let set_id = 1;
|
||||
@@ -360,7 +364,7 @@ fn bad_commit_leads_to_report() {
|
||||
let _ = env_logger::try_init();
|
||||
let private = [Ed25519Keyring::Alice, Ed25519Keyring::Bob, Ed25519Keyring::Charlie];
|
||||
let public = make_ids(&private[..]);
|
||||
let voter_set = Arc::new(public.iter().cloned().collect::<VoterSet<AuthorityId>>());
|
||||
let voter_set = Arc::new(VoterSet::new(public.iter().cloned()).unwrap());
|
||||
|
||||
let round = 1;
|
||||
let set_id = 1;
|
||||
|
||||
Reference in New Issue
Block a user