Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.

Commit 427fd09

Browse files
authored
BEEFY: impl TypeInfo for SignedCommitment (#12382)
1 parent e7f994d commit 427fd09

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

primitives/beefy/src/commitment.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
// limitations under the License.
1717

1818
use codec::{Decode, Encode, Error, Input};
19+
use scale_info::TypeInfo;
1920
use sp_std::{cmp, prelude::*};
2021

2122
use crate::ValidatorSetId;
@@ -39,7 +40,7 @@ pub mod known_payload_ids {
3940
/// Identifiers MUST be sorted by the [`BeefyPayloadId`] to allow efficient lookup of expected
4041
/// value. Duplicated identifiers are disallowed. It's okay for different implementations to only
4142
/// support a subset of possible values.
42-
#[derive(Decode, Encode, Debug, PartialEq, Eq, Clone, Ord, PartialOrd, Hash)]
43+
#[derive(Decode, Encode, Debug, PartialEq, Eq, Clone, Ord, PartialOrd, Hash, TypeInfo)]
4344
pub struct Payload(Vec<(BeefyPayloadId, Vec<u8>)>);
4445

4546
impl Payload {
@@ -80,7 +81,7 @@ impl Payload {
8081
/// height [block_number](Commitment::block_number).
8182
/// GRANDPA validators collect signatures on commitments and a stream of such signed commitments
8283
/// (see [SignedCommitment]) forms the BEEFY protocol.
83-
#[derive(Clone, Debug, PartialEq, Eq, Encode, Decode)]
84+
#[derive(Clone, Debug, PartialEq, Eq, Encode, Decode, TypeInfo)]
8485
pub struct Commitment<TBlockNumber> {
8586
/// A collection of payloads to be signed, see [`Payload`] for details.
8687
///
@@ -138,7 +139,7 @@ where
138139
/// Note that SCALE-encoding of the structure is optimized for size efficiency over the wire,
139140
/// please take a look at custom [`Encode`] and [`Decode`] implementations and
140141
/// `CompactSignedCommitment` struct.
141-
#[derive(Clone, Debug, PartialEq, Eq)]
142+
#[derive(Clone, Debug, PartialEq, Eq, TypeInfo)]
142143
pub struct SignedCommitment<TBlockNumber, TSignature> {
143144
/// The commitment signatures are collected for.
144145
pub commitment: Commitment<TBlockNumber>,

0 commit comments

Comments
 (0)