--no-immediate-elect requires --surplus-order by_size

This commit is contained in:
RunasSudo 2022-07-02 23:46:02 +10:00
parent 566cdeb185
commit f187975601
Signed by: RunasSudo
GPG Key ID: 7234E476BF21C61A

View File

@ -266,6 +266,10 @@ impl STVOptions {
return Err(STVError::InvalidOptions("--subtract-nontransferable requires --transferable-only"));
}
}
if !self.immediate_elect && self.surplus_order != SurplusOrder::BySize {
// Invalid because there is no other metric to determine which surplus to distribute
return Err(STVError::InvalidOptions("--no-immediate-elect requires --surplus-order by_size"));
}
if self.min_threshold != "0" && self.defer_surpluses {
// TODO: NYI
return Err(STVError::InvalidOptions("--min-threshold is incompatible with --defer-surpluses (not yet implemented)"));