Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
polkadot-sdk
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
parity
Mirrored projects
polkadot-sdk
Commits
7bea0c01
Commit
7bea0c01
authored
2 years ago
by
Serban Iorga
Committed by
GitHub
2 years ago
Browse files
Options
Downloads
Patches
Plain Diff
BEEFY: impl TypeInfo for SignedCommitment (#12382)
parent
6137c870
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
substrate/primitives/beefy/src/commitment.rs
+4
-3
4 additions, 3 deletions
substrate/primitives/beefy/src/commitment.rs
with
4 additions
and
3 deletions
substrate/primitives/beefy/src/commitment.rs
+
4
−
3
View file @
7bea0c01
...
...
@@ -16,6 +16,7 @@
// limitations under the License.
use
codec
::{
Decode
,
Encode
,
Error
,
Input
};
use
scale_info
::
TypeInfo
;
use
sp_std
::{
cmp
,
prelude
::
*
};
use
crate
::
ValidatorSetId
;
...
...
@@ -39,7 +40,7 @@ pub mod known_payload_ids {
/// Identifiers MUST be sorted by the [`BeefyPayloadId`] to allow efficient lookup of expected
/// value. Duplicated identifiers are disallowed. It's okay for different implementations to only
/// support a subset of possible values.
#[derive(Decode,
Encode,
Debug,
PartialEq,
Eq,
Clone,
Ord,
PartialOrd,
Hash)]
#[derive(Decode,
Encode,
Debug,
PartialEq,
Eq,
Clone,
Ord,
PartialOrd,
Hash
,
TypeInfo
)]
pub
struct
Payload
(
Vec
<
(
BeefyPayloadId
,
Vec
<
u8
>
)
>
);
impl
Payload
{
...
...
@@ -80,7 +81,7 @@ impl Payload {
/// height [block_number](Commitment::block_number).
/// GRANDPA validators collect signatures on commitments and a stream of such signed commitments
/// (see [SignedCommitment]) forms the BEEFY protocol.
#[derive(Clone,
Debug,
PartialEq,
Eq,
Encode,
Decode)]
#[derive(Clone,
Debug,
PartialEq,
Eq,
Encode,
Decode
,
TypeInfo
)]
pub
struct
Commitment
<
TBlockNumber
>
{
/// A collection of payloads to be signed, see [`Payload`] for details.
///
...
...
@@ -138,7 +139,7 @@ where
/// Note that SCALE-encoding of the structure is optimized for size efficiency over the wire,
/// please take a look at custom [`Encode`] and [`Decode`] implementations and
/// `CompactSignedCommitment` struct.
#[derive(Clone,
Debug,
PartialEq,
Eq)]
#[derive(Clone,
Debug,
PartialEq,
Eq
,
TypeInfo
)]
pub
struct
SignedCommitment
<
TBlockNumber
,
TSignature
>
{
/// The commitment signatures are collected for.
pub
commitment
:
Commitment
<
TBlockNumber
>
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment