Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
parity
Mirrored projects
polkadot
Commits
ba0efca4
Unverified
Commit
ba0efca4
authored
Mar 21, 2020
by
Bastian Köcher
Committed by
GitHub
Mar 21, 2020
Browse files
Make sure that the `start_collator` future implements `Send` (#915)
Co-authored-by:
Gav Wood
<
gavin@parity.io
>
parent
8b9791dc
Pipeline
#84019
failed with stages
in 9 minutes and 3 seconds
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
collator/src/lib.rs
View file @
ba0efca4
...
...
@@ -343,7 +343,8 @@ where
P
::
ParachainContext
:
Send
+
'static
,
<
P
::
ParachainContext
as
ParachainContext
>
::
ProduceCandidate
:
Send
,
{
match
(
config
.expect_chain_spec
()
.is_kusama
(),
config
.roles
)
{
let
is_kusama
=
config
.expect_chain_spec
()
.is_kusama
();
match
(
is_kusama
,
config
.roles
)
{
(
_
,
Roles
::
LIGHT
)
=>
return
Err
(
polkadot_service
::
Error
::
Other
(
"light nodes are unsupported as collator"
.into
())
)
.into
(),
...
...
@@ -435,4 +436,32 @@ mod tests {
))
}
}
struct
BuildDummyParachainContext
;
impl
BuildParachainContext
for
BuildDummyParachainContext
{
type
ParachainContext
=
DummyParachainContext
;
fn
build
<
B
,
E
,
R
,
SP
,
Extrinsic
>
(
self
,
_
:
Arc
<
PolkadotClient
<
B
,
E
,
R
>>
,
_
:
SP
,
_
:
impl
Network
+
Clone
+
'static
,
)
->
Result
<
Self
::
ParachainContext
,
()
>
{
Ok
(
DummyParachainContext
)
}
}
// Make sure that the future returned by `start_collator` implementes `Send`.
#[test]
fn
start_collator_is_send
()
{
fn
check_send
<
T
:
Send
>
(
_
:
T
)
{}
check_send
(
start_collator
(
BuildDummyParachainContext
,
0
.into
(),
Arc
::
new
(
CollatorPair
::
generate
()
.0
),
Default
::
default
(),
));
}
}
Write
Preview
Supports
Markdown
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!
Cancel
Please
register
or
sign in
to comment