mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-11-07 19:31:07 +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:
1 parent
027d88796b
commit
a381f033bd
3 files changed
+44
-29
No files matched your search
@@ -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