mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 17:31:03 +00:00
Put parachain head hash into CandidateDescriptor (#2310)
* Put parachain head hash into `CandidateDescriptor` * Update guide * Add some checks
This commit is contained in:
@@ -38,6 +38,15 @@ pub use polkadot_core_primitives::BlockNumber as RelayChainBlockNumber;
|
||||
#[cfg_attr(feature = "std", derive(Serialize, Deserialize, Default, Hash))]
|
||||
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 {
|
||||
use sp_runtime::traits::Hash;
|
||||
sp_runtime::traits::BlakeTwo256::hash(&self.0)
|
||||
}
|
||||
}
|
||||
|
||||
/// Parachain validation code.
|
||||
#[derive(Default, PartialEq, Eq, Clone, Encode, Decode, RuntimeDebug, derive_more::From)]
|
||||
#[cfg_attr(feature = "std", derive(Serialize, Deserialize, Hash))]
|
||||
|
||||
Reference in New Issue
Block a user