mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 19:51:02 +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:
@@ -372,6 +372,11 @@ fn instapool_payouts_work() {
|
||||
advance_to(11);
|
||||
assert_eq!(pot(), 14);
|
||||
assert_eq!(revenue(), 106);
|
||||
|
||||
// Cannot claim for 0 timeslices.
|
||||
assert_noop!(Broker::do_claim_revenue(region, 0), Error::<Test>::NoClaimTimeslices);
|
||||
|
||||
// Revenue can be claimed.
|
||||
assert_ok!(Broker::do_claim_revenue(region, 100));
|
||||
assert_eq!(pot(), 10);
|
||||
assert_eq!(balance(2), 4);
|
||||
|
||||
Reference in New Issue
Block a user