Use strong types in runtime for parachain heads and validation code (#964)

* use stronger types for HeadData and ValidationCode in runtime

* fix weird debug compile error

* fix runtime build

* update invocations invalidation.rs

* fix tests
This commit is contained in:
Robert Habermeier
2020-04-13 04:24:25 -04:00
committed by GitHub
parent 31dc9acf89
commit a5034dbe98
16 changed files with 240 additions and 227 deletions
+2 -2
View File
@@ -214,7 +214,7 @@ pub struct CandidateCommitments {
/// The root of a block's erasure encoding Merkle tree.
pub erasure_root: Hash,
/// New validation code.
pub new_validation_code: Option<Vec<u8>>,
pub new_validation_code: Option<ValidationCode>,
}
/// Get a collator signature payload on a relay-parent, block-data combo.
@@ -672,7 +672,7 @@ sp_api::decl_runtime_apis! {
/// Get the local validation data for a particular parachain.
fn local_validation_data(id: Id) -> Option<LocalValidationData>;
/// Get the given parachain's head code blob.
fn parachain_code(id: Id) -> Option<Vec<u8>>;
fn parachain_code(id: Id) -> Option<ValidationCode>;
/// Extract the abridged head that was set in the extrinsics.
fn get_heads(extrinsics: Vec<<Block as BlockT>::Extrinsic>)
-> Option<Vec<AbridgedCandidateReceipt>>;