mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-12 21:41:12 +00:00
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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user