mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 10:31:03 +00:00
Adds support for returning a custom header from validate_block (#825)
* Adds support for returning a custom header from `validate_block` This adds support for returning a custom header from `validate_block`. Before this, we always returned the header of the block that was validated (and still do it by default). However, after this pr it is possible to set a custom header or better custom head data that will be returned instead from `validate_block`. This can be for example when a chain wants to fork. * FMT
This commit is contained in:
@@ -161,6 +161,13 @@ where
|
||||
let horizontal_messages = crate::HrmpOutboundMessages::<PSC>::get();
|
||||
let hrmp_watermark = crate::HrmpWatermark::<PSC>::get();
|
||||
|
||||
let head_data =
|
||||
if let Some(custom_head_data) = crate::CustomValidationHeadData::<PSC>::get() {
|
||||
HeadData(custom_head_data)
|
||||
} else {
|
||||
head_data
|
||||
};
|
||||
|
||||
ValidationResult {
|
||||
head_data,
|
||||
new_validation_code: new_validation_code.map(Into::into),
|
||||
|
||||
Reference in New Issue
Block a user