mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-07-15 10:15:42 +00:00
Improve docs of broker pallet (#3980)
Small adjustments which should make understanding what is going on much easier for future readers. Initialization is a bit messy, the very least we should do is adding documentation to make it harder to use wrongly. I was thinking about calling `request_core_count` right from `start_sales`, but as explained in the docs, this is not necessarily what you want. --------- Co-authored-by: eskimor <eskimor@no-such-url.com> Co-authored-by: Bastian Köcher <git@kchr.de> Co-authored-by: Dónal Murray <donal.murray@parity.io>
This commit is contained in:
@@ -81,7 +81,8 @@ impl<T: Config> Pallet<T> {
|
||||
last_timeslice: Self::current_timeslice(),
|
||||
};
|
||||
let now = frame_system::Pallet::<T>::block_number();
|
||||
let new_sale = SaleInfoRecord {
|
||||
// Imaginary old sale for bootstrapping the first actual sale:
|
||||
let old_sale = SaleInfoRecord {
|
||||
sale_start: now,
|
||||
leadin_length: Zero::zero(),
|
||||
price,
|
||||
@@ -94,7 +95,7 @@ impl<T: Config> Pallet<T> {
|
||||
cores_sold: 0,
|
||||
};
|
||||
Self::deposit_event(Event::<T>::SalesStarted { price, core_count });
|
||||
Self::rotate_sale(new_sale, &config, &status);
|
||||
Self::rotate_sale(old_sale, &config, &status);
|
||||
Status::<T>::put(&status);
|
||||
Ok(())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user