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
8a814450
Commit
8a814450
authored
5 years ago
by
thiolliere
Browse files
Options
Downloads
Patches
Plain Diff
allow empty data
parent
77868bf7
Branches
Branches containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
cumulus/network/src/lib.rs
+7
-0
7 additions, 0 deletions
cumulus/network/src/lib.rs
with
7 additions
and
0 deletions
cumulus/network/src/lib.rs
+
7
−
0
View file @
8a814450
...
...
@@ -35,6 +35,8 @@ use std::marker::PhantomData;
/// valid parachain-block candidate.
/// Data encoding is just `GossipMessage`, the relay-chain validator candidate statement message is
/// the justification.
///
/// Note: if no justification is provided the annouce is considered valid.
pub
struct
JustifiedBlockAnnounceValidator
<
B
>
{
authorities
:
Vec
<
ValidatorId
>
,
phantom
:
PhantomData
<
B
>
,
...
...
@@ -53,6 +55,11 @@ impl<B: BlockT> BlockAnnounceValidator<B> for JustifiedBlockAnnounceValidator<B>
fn
validate
(
&
mut
self
,
header
:
&
B
::
Header
,
mut
data
:
&
[
u8
])
->
Result
<
Validation
,
Box
<
dyn
std
::
error
::
Error
+
Send
>>
{
// If no data is provided the announce is valid.
if
data
.is_empty
()
{
return
Ok
(
Validation
::
Success
)
}
// Check data is a gossip message.
let
gossip_message
=
GossipMessage
::
decode
(
&
mut
data
)
.map_err
(|
_
|
Box
::
new
(
ClientError
::
BadJustification
(
...
...
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