-
Notifications
You must be signed in to change notification settings - Fork 15
Labels
e2e testsRelated to end-to-end testsRelated to end-to-end testsenhancementNew feature or requestNew feature or request
Milestone
Description
Test scenarios for referenda that fail due to missing deposits or insufficient support/approval. These tests cover all negative outcomes that can actually happen in pallet_referenda.
-
Missing decision deposit
- Submit a referendum without paying the decision deposit.
- Ensure it never enters
Decidingand is automatically rejected or cleaned up after the undeciding timeout. - Check correct events (
TimedOut,DepositRefunded/Slashed) and state transitions.
-
Insufficient support
- Enter
Decidingphase with decision deposit paid. - Cast votes so that support (proportion of aye vs possible votes) stays below the track’s minimum support threshold.
- Expected outcome: referendum rejected for insufficient support.
- Enter
-
Insufficient approval
- Enter
Decidingphase with decision deposit paid. - Cast votes so support meets the minimum, but approval (vote-weight adjusted) is below the track’s required approval curve.
- Expected outcome: referendum rejected for insufficient approval.
- Enter
-
Track capacity / queue overflow (optional)
- Submit more referenda than
max_decidingallows. - Verify that queued referenda are handled correctly
- Submit more referenda than
-
Assertions for all scenarios
- Correct state transitions:
Submitted→ deposit →Deciding→Rejected/TimedOut. - Correct events emitted:
DecisionDepositPlaced,DecisionStarted,Rejected,TimedOut,DepositRefunded/DepositSlashed. - Correct application of track curves for support and approval.
- Deposit refund or slashing behaves according to outcome.
- Correct state transitions:
Metadata
Metadata
Assignees
Labels
e2e testsRelated to end-to-end testsRelated to end-to-end testsenhancementNew feature or requestNew feature or request