Better testing for lock types in staking/democracy. (#3565)

* Better testing for lock types in staking/democracy.

* Update docs.

* Update srml/executive/src/lib.rs

Co-Authored-By: Bastian Köcher <bkchr@users.noreply.github.com>

* Update srml/executive/src/lib.rs

Co-Authored-By: Bastian Köcher <bkchr@users.noreply.github.com>

* Fix test
This commit is contained in:
Kian Paimani
2019-09-06 19:41:29 +02:00
committed by GitHub
parent 027d88796b
commit a381f033bd
3 changed files with 44 additions and 29 deletions
+10
View File
@@ -639,6 +639,16 @@ pub trait Time {
impl WithdrawReasons {
/// Choose all variants except for `one`.
///
/// ```rust
/// # use srml_support::traits::{WithdrawReason, WithdrawReasons};
/// # fn main() {
/// assert_eq!(
/// WithdrawReason::Fee | WithdrawReason::Transfer | WithdrawReason::Reserve,
/// WithdrawReasons::except(WithdrawReason::TransactionPayment),
/// );
/// # }
/// ```
pub fn except(one: WithdrawReason) -> WithdrawReasons {
let mut mask = Self::all();
mask.toggle(one);