mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-12 22:51:13 +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:
@@ -76,7 +76,7 @@ impl<T: Config> Pallet<T> {
|
||||
last_timeslice: Self::current_timeslice(),
|
||||
};
|
||||
let now = frame_system::Pallet::<T>::block_number();
|
||||
let dummy_sale = SaleInfoRecord {
|
||||
let new_sale = SaleInfoRecord {
|
||||
sale_start: now,
|
||||
leadin_length: Zero::zero(),
|
||||
price,
|
||||
@@ -89,7 +89,7 @@ impl<T: Config> Pallet<T> {
|
||||
cores_sold: 0,
|
||||
};
|
||||
Self::deposit_event(Event::<T>::SalesStarted { price, core_count });
|
||||
Self::rotate_sale(dummy_sale, &config, &status);
|
||||
Self::rotate_sale(new_sale, &config, &status);
|
||||
Status::<T>::put(&status);
|
||||
Ok(())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user