mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-13 21:01:05 +00:00
Repot frame_support::traits; introduce some new currency stuff (#8435)
* Reservable, Transferrable Fungible(s), plus adapters. * Repot into new dir * Imbalances for Fungibles * Repot and balanced fungible. * Clean up names and bridge-over Imbalanced. * Repot frame_support::trait. Finally. * Make build. * Docs * Good errors * Fix tests. Implement fungible::Inspect for Balances. * Implement additional traits for Balances. * Revert UI test "fixes" * Fix UI error * Fix UI test * Fixes * Update lock * Grumbles * Grumbles * Fixes Co-authored-by: Bastian Köcher <info@kchr.de>
This commit is contained in:
@@ -1201,11 +1201,22 @@ impl<T: Config> Pallet<T> {
|
||||
Account::<T>::get(who).consumers
|
||||
}
|
||||
|
||||
/// True if the account has some outstanding references.
|
||||
/// True if the account has some outstanding consumer references.
|
||||
pub fn is_provider_required(who: &T::AccountId) -> bool {
|
||||
Account::<T>::get(who).consumers != 0
|
||||
}
|
||||
|
||||
/// True if the account has no outstanding consumer references or more than one provider.
|
||||
pub fn can_dec_provider(who: &T::AccountId) -> bool {
|
||||
let a = Account::<T>::get(who);
|
||||
a.consumers == 0 || a.providers > 1
|
||||
}
|
||||
|
||||
/// True if the account has at least one provider reference.
|
||||
pub fn can_inc_consumer(who: &T::AccountId) -> bool {
|
||||
Account::<T>::get(who).providers > 0
|
||||
}
|
||||
|
||||
/// Deposits an event into this block's event record.
|
||||
pub fn deposit_event(event: impl Into<T::Event>) {
|
||||
Self::deposit_event_indexed(&[], event.into());
|
||||
|
||||
Reference in New Issue
Block a user