mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 09:21:04 +00:00
Add tipping into treasury (#4480)
* First draft * Initial work on tests * Add tests. * Ensure old members can't tip. * Fix complexity * Update node runtime * Build fix. * build fix * Fix tests * Fix tests * Refactor Contains impl for tests * Introduce new way to avoid impl Contains conflicts * Fixes * Docs. * Docs. * Typo * Whitespace * Docs * Typo * Formatting * Update frame/treasury/src/lib.rs Co-Authored-By: Shawn Tabrizi <shawntabrizi@gmail.com> * Update frame/treasury/src/lib.rs Co-Authored-By: Shawn Tabrizi <shawntabrizi@gmail.com> * Update frame/treasury/src/lib.rs Co-Authored-By: Shawn Tabrizi <shawntabrizi@gmail.com> * Apply suggestions from code review Co-Authored-By: Shawn Tabrizi <shawntabrizi@gmail.com> * Add provisional weights. Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
This commit is contained in:
committed by
Shawn Tabrizi
parent
586685fca0
commit
67202b7ec3
@@ -88,7 +88,7 @@ use frame_support::{
|
||||
decl_storage, decl_event, ensure, decl_module, decl_error, weights::SimpleDispatchInfo,
|
||||
traits::{
|
||||
Currency, Get, LockableCurrency, LockIdentifier, ReservableCurrency, WithdrawReasons,
|
||||
ChangeMembers, OnUnbalanced, WithdrawReason
|
||||
ChangeMembers, OnUnbalanced, WithdrawReason, Contains
|
||||
}
|
||||
};
|
||||
use sp_phragmen::ExtendedBalance;
|
||||
@@ -767,6 +767,13 @@ impl<T: Trait> Module<T> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<T: Trait> Contains<T::AccountId> for Module<T> {
|
||||
fn contains(who: &T::AccountId) -> bool {
|
||||
Self::is_member(who)
|
||||
}
|
||||
fn sorted_members() -> Vec<T::AccountId> { Self::members_ids() }
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
||||
Reference in New Issue
Block a user