mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-26 06:31:08 +00:00
[pallet-broker] Fix claim revenue behaviour for zero timeslices (#3997)
This PR adds a check that `max_timeslices > 0` and errors if not. It also adds a test for this behaviour and cleans up some misleading docs.
This commit is contained in:
@@ -329,6 +329,7 @@ impl<T: Config> Pallet<T> {
|
||||
mut region: RegionId,
|
||||
max_timeslices: Timeslice,
|
||||
) -> DispatchResult {
|
||||
ensure!(max_timeslices > 0, Error::<T>::NoClaimTimeslices);
|
||||
let mut contribution =
|
||||
InstaPoolContribution::<T>::take(region).ok_or(Error::<T>::UnknownContribution)?;
|
||||
let contributed_parts = region.mask.count_ones();
|
||||
|
||||
Reference in New Issue
Block a user