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
d6c5acc1
Unverified
Commit
d6c5acc1
authored
Apr 01, 2020
by
Bastian Köcher
Committed by
GitHub
Apr 01, 2020
Browse files
Make sure that Parachain heads are updated (#945)
Updating the heads was accidentally removed in some other pr.
parent
d4f0a74b
Pipeline
#85856
canceled with stages
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
runtime/common/src/parachains.rs
View file @
d6c5acc1
...
...
@@ -640,6 +640,7 @@ impl<T: Trait> Module<T> {
for
head
in
heads
.iter
()
{
let
id
=
head
.parachain_index
();
Heads
::
insert
(
id
,
&
head
.candidate.head_data
.0
);
// Queue up upwards messages (from parachains to relay chain).
Self
::
queue_upward_messages
(
...
...
@@ -1579,10 +1580,13 @@ mod tests {
// creates a template candidate which pins to correct relay-chain state.
fn
raw_candidate
(
para_id
:
ParaId
)
->
CandidateReceipt
{
let
mut
head_data
=
Parachains
::
parachain_head
(
&
para_id
)
.unwrap
();
head_data
.extend
(
para_id
.encode
());
CandidateReceipt
{
parachain_index
:
para_id
,
relay_parent
:
System
::
parent_hash
(),
head_data
:
Default
::
default
(
),
head_data
:
HeadData
(
head_data
),
collator
:
Default
::
default
(),
signature
:
Default
::
default
(),
pov_block_hash
:
Default
::
default
(),
...
...
@@ -2131,6 +2135,9 @@ mod tests {
set_heads
(
vec!
[
candidate_a
.clone
(),
candidate_b
.clone
()]),
Origin
::
NONE
,
));
assert_eq!
(
Heads
::
get
(
&
ParaId
::
from
(
0
))
.map
(
HeadData
),
Some
(
candidate_a
.candidate.head_data
));
assert_eq!
(
Heads
::
get
(
&
ParaId
::
from
(
1
))
.map
(
HeadData
),
Some
(
candidate_b
.candidate.head_data
));
});
}
...
...
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