Update treasury weights. (#5723)

* treasury weight formula

* use max tippers count

* doc

* Fix upper bound

* rounding a bit

* remove unused + doc

* as u64 -> as Weight

* 2 significative digits rounded up

* rename ContainsCountUpperBound -> ContainsLengthBound

* add doc

* sender account -> origin account

* fix
This commit is contained in:
thiolliere
2020-04-28 17:55:56 +02:00
committed by GitHub
parent 2d73ccd65b
commit 8b69609397
4 changed files with 101 additions and 46 deletions
@@ -93,6 +93,7 @@ use frame_support::{
traits::{
Currency, Get, LockableCurrency, LockIdentifier, ReservableCurrency, WithdrawReasons,
ChangeMembers, OnUnbalanced, WithdrawReason, Contains, BalanceStatus, InitializeMembers,
ContainsLengthBound,
}
};
use sp_phragmen::{build_support_map, ExtendedBalance, VoteWeight, PhragmenResult};
@@ -880,6 +881,15 @@ impl<T: Trait> Contains<T::AccountId> for Module<T> {
}
}
impl<T: Trait> ContainsLengthBound for Module<T> {
fn min_len() -> usize { 0 }
/// Implementation uses a parameter type so calling is cost-free.
fn max_len() -> usize {
Self::desired_members() as usize
}
}
#[cfg(test)]
mod tests {
use super::*;