mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-07-12 01:45:45 +00:00
Beefy: use VersionedFinalityProof instead of SignedCommitment (#11962)
* beefy: use VersionedFinalityProof instead of SignedCommitment. * Change the exposed RPC API to support versioned proofs. Co-authored-by: Adrian Catangiu <adrian@parity.io>
This commit is contained in:
@@ -21,19 +21,19 @@ use serde::{Deserialize, Serialize};
|
||||
|
||||
use sp_runtime::traits::Block as BlockT;
|
||||
|
||||
/// An encoded signed commitment proving that the given header has been finalized.
|
||||
/// An encoded finality proof proving that the given header has been finalized.
|
||||
/// The given bytes should be the SCALE-encoded representation of a
|
||||
/// `beefy_primitives::SignedCommitment`.
|
||||
/// `beefy_primitives::VersionedFinalityProof`.
|
||||
#[derive(Clone, Serialize, Deserialize)]
|
||||
pub struct EncodedSignedCommitment(sp_core::Bytes);
|
||||
pub struct EncodedVersionedFinalityProof(sp_core::Bytes);
|
||||
|
||||
impl EncodedSignedCommitment {
|
||||
impl EncodedVersionedFinalityProof {
|
||||
pub fn new<Block>(
|
||||
signed_commitment: beefy_gadget::justification::BeefySignedCommitment<Block>,
|
||||
finality_proof: beefy_gadget::justification::BeefyVersionedFinalityProof<Block>,
|
||||
) -> Self
|
||||
where
|
||||
Block: BlockT,
|
||||
{
|
||||
EncodedSignedCommitment(signed_commitment.encode().into())
|
||||
EncodedVersionedFinalityProof(finality_proof.encode().into())
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user