runtime: update grandpa equivocation reporting api (#1407)

* runtime: update grandpa equivocation reporting api

* Bump

Co-authored-by: Gav Wood <gavin@parity.io>
This commit is contained in:
André Silva
2020-07-17 12:01:02 +01:00
committed by GitHub
parent 63a655afb0
commit 0a049e81de
5 changed files with 159 additions and 172 deletions
+4 -11
View File
@@ -560,12 +560,7 @@ impl grandpa::Trait for Runtime {
GrandpaId,
)>>::IdentificationTuple;
type HandleEquivocation = grandpa::EquivocationHandler<
Self::KeyOwnerIdentification,
primitives::v0::fisherman::FishermanAppCrypto,
Runtime,
Offences,
>;
type HandleEquivocation = grandpa::EquivocationHandler<Self::KeyOwnerIdentification, Offences>;
}
parameter_types! {
@@ -653,7 +648,6 @@ impl<LocalCall> system::offchain::CreateSignedTransaction<LocalCall> for Runtime
transaction_payment::ChargeTransactionPayment::<Runtime>::from(tip),
registrar::LimitParathreadCommits::<Runtime>::new(),
parachains::ValidateDoubleVoteReports::<Runtime>::new(),
grandpa::ValidateEquivocationReport::<Runtime>::new(),
);
let raw_payload = SignedPayload::new(call, extra).map_err(|e| {
debug::warn!("Unable to create signed payload: {:?}", e);
@@ -963,7 +957,7 @@ construct_runtime! {
Historical: session_historical::{Module},
Session: session::{Module, Call, Storage, Event, Config<T>},
FinalityTracker: finality_tracker::{Module, Call, Storage, Inherent},
Grandpa: grandpa::{Module, Call, Storage, Config, Event},
Grandpa: grandpa::{Module, Call, Storage, Config, Event, ValidateUnsigned},
ImOnline: im_online::{Module, Call, Storage, Event<T>, ValidateUnsigned, Config<T>},
AuthorityDiscovery: authority_discovery::{Module, Call, Config},
@@ -1032,7 +1026,6 @@ pub type SignedExtra = (
transaction_payment::ChargeTransactionPayment<Runtime>,
registrar::LimitParathreadCommits<Runtime>,
parachains::ValidateDoubleVoteReports<Runtime>,
grandpa::ValidateEquivocationReport<Runtime>,
);
/// Unchecked extrinsic type as expected by this runtime.
pub type UncheckedExtrinsic = generic::UncheckedExtrinsic<Address, Call, Signature, SignedExtra>;
@@ -1159,7 +1152,7 @@ sp_api::impl_runtime_apis! {
Grandpa::grandpa_authorities()
}
fn submit_report_equivocation_extrinsic(
fn submit_report_equivocation_unsigned_extrinsic(
equivocation_proof: fg_primitives::EquivocationProof<
<Block as BlockT>::Hash,
sp_runtime::traits::NumberFor<Block>,
@@ -1168,7 +1161,7 @@ sp_api::impl_runtime_apis! {
) -> Option<()> {
let key_owner_proof = key_owner_proof.decode()?;
Grandpa::submit_report_equivocation_extrinsic(
Grandpa::submit_unsigned_equivocation_report(
equivocation_proof,
key_owner_proof,
)