mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-07 15:28:02 +00:00
Pass relay_storage_root into ValidationParams (#2245)
Prior this commit, a PVF wasn't able to access this property.
This commit is contained in:
@@ -439,6 +439,7 @@ fn validate_candidate_exhaustive<B: ValidationBackend, S: SpawnNamed + 'static>(
|
||||
parent_head: persisted_validation_data.parent_head.clone(),
|
||||
block_data: pov.block_data.clone(),
|
||||
relay_chain_height: persisted_validation_data.block_number,
|
||||
relay_storage_root: persisted_validation_data.relay_storage_root,
|
||||
dmq_mqc_head: persisted_validation_data.dmq_mqc_head,
|
||||
hrmp_mqc_heads: persisted_validation_data.hrmp_mqc_heads.clone(),
|
||||
};
|
||||
|
||||
@@ -254,6 +254,8 @@ pub struct ValidationParams {
|
||||
pub block_data: BlockData,
|
||||
/// The current relay-chain block number.
|
||||
pub relay_chain_height: RelayChainBlockNumber,
|
||||
/// The relay-chain block's storage root.
|
||||
pub relay_storage_root: Hash,
|
||||
/// The MQC head for the DMQ.
|
||||
///
|
||||
/// The DMQ MQC head will be used by the validation function to authorize the downward messages
|
||||
|
||||
@@ -234,6 +234,7 @@ mod tests {
|
||||
parent_head: parent_head.encode().into(),
|
||||
block_data: collation.proof_of_validity.block_data,
|
||||
relay_chain_height: 1,
|
||||
relay_storage_root: Default::default(),
|
||||
hrmp_mqc_heads: Vec::new(),
|
||||
dmq_mqc_head: Default::default(),
|
||||
},
|
||||
|
||||
@@ -68,6 +68,7 @@ fn execute_good_on_parent(isolation_strategy: IsolationStrategy) {
|
||||
parent_head: GenericHeadData(parent_head.encode()),
|
||||
block_data: GenericBlockData(block_data.encode()),
|
||||
relay_chain_height: 1,
|
||||
relay_storage_root: Default::default(),
|
||||
hrmp_mqc_heads: Vec::new(),
|
||||
dmq_mqc_head: Default::default(),
|
||||
},
|
||||
@@ -107,6 +108,7 @@ fn execute_good_chain_on_parent() {
|
||||
parent_head: GenericHeadData(parent_head.encode()),
|
||||
block_data: GenericBlockData(block_data.encode()),
|
||||
relay_chain_height: number as RelayChainBlockNumber + 1,
|
||||
relay_storage_root: Default::default(),
|
||||
hrmp_mqc_heads: Vec::new(),
|
||||
dmq_mqc_head: Default::default(),
|
||||
},
|
||||
@@ -147,6 +149,7 @@ fn execute_bad_on_parent() {
|
||||
parent_head: GenericHeadData(parent_head.encode()),
|
||||
block_data: GenericBlockData(block_data.encode()),
|
||||
relay_chain_height: 1,
|
||||
relay_storage_root: Default::default(),
|
||||
hrmp_mqc_heads: Vec::new(),
|
||||
dmq_mqc_head: Default::default(),
|
||||
},
|
||||
|
||||
@@ -42,6 +42,7 @@ fn terminates_on_timeout() {
|
||||
block_data: BlockData(Vec::new()),
|
||||
parent_head: Default::default(),
|
||||
relay_chain_height: 1,
|
||||
relay_storage_root: Default::default(),
|
||||
hrmp_mqc_heads: Vec::new(),
|
||||
dmq_mqc_head: Default::default(),
|
||||
},
|
||||
@@ -70,6 +71,7 @@ fn parallel_execution() {
|
||||
block_data: BlockData(Vec::new()),
|
||||
parent_head: Default::default(),
|
||||
relay_chain_height: 1,
|
||||
relay_storage_root: Default::default(),
|
||||
hrmp_mqc_heads: Vec::new(),
|
||||
dmq_mqc_head: Default::default(),
|
||||
},
|
||||
@@ -81,6 +83,7 @@ fn parallel_execution() {
|
||||
ValidationParams {
|
||||
block_data: BlockData(Vec::new()),
|
||||
parent_head: Default::default(),
|
||||
relay_storage_root: Default::default(),
|
||||
relay_chain_height: 1,
|
||||
hrmp_mqc_heads: Vec::new(),
|
||||
dmq_mqc_head: Default::default(),
|
||||
|
||||
Reference in New Issue
Block a user