paras: count upgrade delay from inclusion (#7486)

* paras: count upgrade delay from inclusion

* fix warning

* rename check cause block number field

* rename inclusion_parent -> included_at
This commit is contained in:
Chris Sosnin
2023-07-19 15:06:58 +03:00
committed by GitHub
parent 3bbb336ea7
commit c63b557e50
3 changed files with 178 additions and 18 deletions
@@ -884,10 +884,13 @@ impl<T: Config> Pallet<T> {
// initial weight is config read.
let mut weight = T::DbWeight::get().reads_writes(1, 0);
if let Some(new_code) = commitments.new_validation_code {
// Block number of candidate's inclusion.
let now = <frame_system::Pallet<T>>::block_number();
weight.saturating_add(<paras::Pallet<T>>::schedule_code_upgrade(
receipt.descriptor.para_id,
new_code,
relay_parent_number,
now,
&config,
));
}