Make BEEFY payload extensible (#10307)

* make BEEFY payload extensible

* cargo fmt

* cargo fmt

* remove generic payload param in beefy-primitives

* cargo fmt

* Apply suggestions from code review

Co-authored-by: Tomasz Drwięga <tomusdrw@users.noreply.github.com>

* adds Paylaod Type

* remove hex

* fix tests

* Apply suggestions from code review

Co-authored-by: Tomasz Drwięga <tomusdrw@users.noreply.github.com>

* use binary_search_by to sort

* Payload::new()

* fix tests

* Apply suggestions from code review

Co-authored-by: Tomasz Drwięga <tomusdrw@users.noreply.github.com>

* fix tests

* cargo fmt

* fix get_decoded

* fix test

Co-authored-by: Tomasz Drwięga <tomusdrw@users.noreply.github.com>
This commit is contained in:
Seun Lanlege
2021-12-01 12:45:36 +01:00
committed by GitHub
parent db37fb04e8
commit a18749d315
9 changed files with 152 additions and 99 deletions
+5 -3
View File
@@ -35,7 +35,9 @@ mod commitment;
pub mod mmr;
pub mod witness;
pub use commitment::{Commitment, SignedCommitment, VersionedCommitment};
pub use commitment::{
known_payload_ids, BeefyPayloadId, Commitment, Payload, SignedCommitment, VersionedCommitment,
};
use codec::{Codec, Decode, Encode};
use scale_info::TypeInfo;
@@ -118,9 +120,9 @@ pub enum ConsensusLog<AuthorityId: Codec> {
/// A vote message is a direct vote created by a BEEFY node on every voting round
/// and is gossiped to its peers.
#[derive(Debug, Decode, Encode, TypeInfo)]
pub struct VoteMessage<Hash, Number, Id, Signature> {
pub struct VoteMessage<Number, Id, Signature> {
/// Commit to information extracted from a finalized block
pub commitment: Commitment<Number, Hash>,
pub commitment: Commitment<Number>,
/// Node authority id
pub id: Id,
/// Node signature