mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 14:01:02 +00:00
Move grandpa crates to consensus folder (#13458)
* Move grandpa under consensus dir * Rename grandpa folder * Finish grandpa renaming * Minor tweaks * Cargo fmt * Adjust path to chain spec
This commit is contained in:
@@ -30,8 +30,8 @@ use frame_support::{
|
||||
},
|
||||
};
|
||||
use pallet_session::historical as pallet_session_historical;
|
||||
use sp_consensus_grandpa::{RoundNumber, SetId, GRANDPA_ENGINE_ID};
|
||||
use sp_core::{crypto::KeyTypeId, H256};
|
||||
use sp_finality_grandpa::{RoundNumber, SetId, GRANDPA_ENGINE_ID};
|
||||
use sp_keyring::Ed25519Keyring;
|
||||
use sp_runtime::{
|
||||
curve::PiecewiseLinear,
|
||||
@@ -354,12 +354,12 @@ pub fn generate_equivocation_proof(
|
||||
set_id: SetId,
|
||||
vote1: (RoundNumber, H256, u64, &Ed25519Keyring),
|
||||
vote2: (RoundNumber, H256, u64, &Ed25519Keyring),
|
||||
) -> sp_finality_grandpa::EquivocationProof<H256, u64> {
|
||||
) -> sp_consensus_grandpa::EquivocationProof<H256, u64> {
|
||||
let signed_prevote = |round, hash, number, keyring: &Ed25519Keyring| {
|
||||
let prevote = finality_grandpa::Prevote { target_hash: hash, target_number: number };
|
||||
|
||||
let prevote_msg = finality_grandpa::Message::Prevote(prevote.clone());
|
||||
let payload = sp_finality_grandpa::localized_payload(round, set_id, &prevote_msg);
|
||||
let payload = sp_consensus_grandpa::localized_payload(round, set_id, &prevote_msg);
|
||||
let signed = keyring.sign(&payload).into();
|
||||
(prevote, signed)
|
||||
};
|
||||
@@ -367,9 +367,9 @@ pub fn generate_equivocation_proof(
|
||||
let (prevote1, signed1) = signed_prevote(vote1.0, vote1.1, vote1.2, vote1.3);
|
||||
let (prevote2, signed2) = signed_prevote(vote2.0, vote2.1, vote2.2, vote2.3);
|
||||
|
||||
sp_finality_grandpa::EquivocationProof::new(
|
||||
sp_consensus_grandpa::EquivocationProof::new(
|
||||
set_id,
|
||||
sp_finality_grandpa::Equivocation::Prevote(finality_grandpa::Equivocation {
|
||||
sp_consensus_grandpa::Equivocation::Prevote(finality_grandpa::Equivocation {
|
||||
round_number: vote1.0,
|
||||
identity: vote1.3.public().into(),
|
||||
first: (prevote1, signed1),
|
||||
|
||||
Reference in New Issue
Block a user