mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-19 13:31:04 +00:00
Broker pallet: RegionDropped event fix & additional tests (#1609)
This PR includes the following fix: - [x] The `duration` is always set to zero in the `RegionDropped` event. This is fixed in this PR. Also added some additional tests to cover some cases that aren't covered : - [x] Selling a partitioned region to the instantaneous coretime pool. - [x] Partitioning a region after assigning it to a particular task. - [x] Interlacing a region after assigning it to a particular task.
This commit is contained in:
@@ -101,9 +101,9 @@ impl<T: Config> Pallet<T> {
|
||||
|
||||
let last_committed_timeslice = status.last_committed_timeslice;
|
||||
if region_id.begin <= last_committed_timeslice {
|
||||
let duration = region.end.saturating_sub(region_id.begin);
|
||||
region_id.begin = last_committed_timeslice + 1;
|
||||
if region_id.begin >= region.end {
|
||||
let duration = region.end.saturating_sub(region_id.begin);
|
||||
Self::deposit_event(Event::RegionDropped { region_id, duration });
|
||||
return Ok(None)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user