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:
Davide Galassi
2023-02-27 17:15:08 +01:00
committed by GitHub
parent 91c595bc78
commit 40c36c0c8a
62 changed files with 356 additions and 356 deletions
+10 -12
View File
@@ -52,9 +52,6 @@ use frame_system::{
pub use node_primitives::{AccountId, Signature};
use node_primitives::{AccountIndex, Balance, BlockNumber, Hash, Index, Moment};
use pallet_election_provider_multi_phase::SolutionAccuracyOf;
use pallet_grandpa::{
fg_primitives, AuthorityId as GrandpaId, AuthorityList as GrandpaAuthorityList,
};
use pallet_im_online::sr25519::AuthorityId as ImOnlineId;
use pallet_nfts::PalletFeatures;
use pallet_nis::WithMaximumOf;
@@ -63,6 +60,7 @@ pub use pallet_transaction_payment::{CurrencyAdapter, Multiplier, TargetedFeeAdj
use pallet_transaction_payment::{FeeDetails, RuntimeDispatchInfo};
use sp_api::impl_runtime_apis;
use sp_authority_discovery::AuthorityId as AuthorityDiscoveryId;
use sp_consensus_grandpa::AuthorityId as GrandpaId;
use sp_core::{crypto::KeyTypeId, OpaqueMetadata};
use sp_inherents::{CheckInherentsResult, InherentData};
use sp_runtime::{
@@ -1957,21 +1955,21 @@ impl_runtime_apis! {
}
}
impl fg_primitives::GrandpaApi<Block> for Runtime {
fn grandpa_authorities() -> GrandpaAuthorityList {
impl sp_consensus_grandpa::GrandpaApi<Block> for Runtime {
fn grandpa_authorities() -> sp_consensus_grandpa::AuthorityList {
Grandpa::grandpa_authorities()
}
fn current_set_id() -> fg_primitives::SetId {
fn current_set_id() -> sp_consensus_grandpa::SetId {
Grandpa::current_set_id()
}
fn submit_report_equivocation_unsigned_extrinsic(
equivocation_proof: fg_primitives::EquivocationProof<
equivocation_proof: sp_consensus_grandpa::EquivocationProof<
<Block as BlockT>::Hash,
NumberFor<Block>,
>,
key_owner_proof: fg_primitives::OpaqueKeyOwnershipProof,
key_owner_proof: sp_consensus_grandpa::OpaqueKeyOwnershipProof,
) -> Option<()> {
let key_owner_proof = key_owner_proof.decode()?;
@@ -1982,14 +1980,14 @@ impl_runtime_apis! {
}
fn generate_key_ownership_proof(
_set_id: fg_primitives::SetId,
_set_id: sp_consensus_grandpa::SetId,
authority_id: GrandpaId,
) -> Option<fg_primitives::OpaqueKeyOwnershipProof> {
) -> Option<sp_consensus_grandpa::OpaqueKeyOwnershipProof> {
use codec::Encode;
Historical::prove((fg_primitives::KEY_TYPE, authority_id))
Historical::prove((sp_consensus_grandpa::KEY_TYPE, authority_id))
.map(|p| p.encode())
.map(fg_primitives::OpaqueKeyOwnershipProof::new)
.map(sp_consensus_grandpa::OpaqueKeyOwnershipProof::new)
}
}