Skip to content

Commit

Permalink
account for paritytech#2856
Browse files Browse the repository at this point in the history
  • Loading branch information
Lederstrumpf committed Jan 11, 2024
1 parent 3904ce5 commit 35b302d
Showing 1 changed file with 18 additions and 6 deletions.
24 changes: 18 additions & 6 deletions substrate/bin/node/runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2702,8 +2702,8 @@ impl_runtime_apis! {
}
}

#[api_version(3)]
impl sp_consensus_beefy::BeefyApi<Block, BeefyId> for Runtime {
#[api_version(4)]
impl sp_consensus_beefy::BeefyApi<Block, BeefyId, Hash> for Runtime {
fn beefy_genesis() -> Option<BlockNumber> {
Beefy::genesis_block()
}
Expand All @@ -2712,8 +2712,8 @@ impl_runtime_apis! {
Beefy::validator_set()
}

fn submit_report_equivocation_unsigned_extrinsic(
equivocation_proof: sp_consensus_beefy::EquivocationProof<
fn submit_report_vote_equivocation_unsigned_extrinsic(
vote_equivocation_proof: sp_consensus_beefy::VoteEquivocationProof<
BlockNumber,
BeefyId,
BeefySignature,
Expand All @@ -2722,12 +2722,24 @@ impl_runtime_apis! {
) -> Option<()> {
let key_owner_proof = key_owner_proof.decode()?;

Beefy::submit_unsigned_equivocation_report(
equivocation_proof,
Beefy::submit_unsigned_vote_equivocation_report(
vote_equivocation_proof,
key_owner_proof,
)
}

fn submit_report_fork_equivocation_unsigned_extrinsic(
fork_equivocation_proof: sp_consensus_beefy::ForkEquivocationProof<BlockNumber, BeefyId, BeefySignature, Header, Hash>,
key_owner_proofs: Vec<sp_consensus_beefy::OpaqueKeyOwnershipProof>,
) -> Option<()> {
let key_owner_proofs = key_owner_proofs.iter().cloned().map(|p| p.decode()).collect::<Option<Vec<_>>>()?;

Beefy::submit_unsigned_fork_equivocation_report(
fork_equivocation_proof,
key_owner_proofs,
)
}

fn generate_key_ownership_proof(
_set_id: sp_consensus_beefy::ValidatorSetId,
authority_id: BeefyId,
Expand Down

0 comments on commit 35b302d

Please sign in to comment.