Ensure that para_head hash matches the actual head (#3808)

* Ensure that `para_head` hash matches the actual head

This ensures that the `para_head` hash in the `CandidateDescriptor`
matches the actual `head` in the candidate commitments.

* Enable the code for `no_std`

* Formatting
This commit is contained in:
Bastian Köcher
2021-09-07 15:07:37 +02:00
committed by GitHub
parent d918d64c48
commit c318bebb4a
2 changed files with 46 additions and 1 deletions
-1
View File
@@ -45,7 +45,6 @@ pub use polkadot_core_primitives::BlockNumber as RelayChainBlockNumber;
#[cfg_attr(feature = "std", derive(Serialize, Deserialize, Default, Hash, MallocSizeOf))]
pub struct HeadData(#[cfg_attr(feature = "std", serde(with = "bytes"))] pub Vec<u8>);
#[cfg(feature = "std")]
impl HeadData {
/// Returns the hash of this head data.
pub fn hash(&self) -> Hash {