zeitgeist
zeitgeist copied to clipboard
Update `court` pallet
Some of the changes to the court
pallet are made in accordance to the recent changes to the specification of the DisputeApi
:
- Let
on_resolution
returnNone
if none of the jurors voted. - Replace
TreasuryPalletId
withSlash
trait. The purpose of this is to fix a simple design problem: Before this change, thecourt
pallet used theTreasuryPalletId
constant to calculate the treasury account. However, if thetreasury
pallet changes the way if calculates the treasury account, this breaks thecourt
pallet. Instead, we now take a cue from the democracy pallet and replace theTreasuryPalletId
withtype Slash: OnUnbalance<...>
and move unbalances created by slashing into the treasury usingSlash::on_unbalance
. - Catch some errors in
vote
that were not considered earlier. - Improve tests:
- Replace
unwrap()
withassert_ok!
. - Lower block amounts to shorten test duration.
- Replace