pub trait OnChargeCapacityTransaction<T: Config> {
type Balance: Balance;
// Required methods
fn withdraw_fee(
key: &T::AccountId,
fee: Self::Balance,
) -> Result<Self::Balance, TransactionValidityError>;
fn can_withdraw_fee(
key: &T::AccountId,
fee: Self::Balance,
) -> Result<(), TransactionValidityError>;
}
Expand description
A trait used for the withdrawal of Capacity.
Required Associated Types§
Required Methods§
Sourcefn withdraw_fee(
key: &T::AccountId,
fee: Self::Balance,
) -> Result<Self::Balance, TransactionValidityError>
fn withdraw_fee( key: &T::AccountId, fee: Self::Balance, ) -> Result<Self::Balance, TransactionValidityError>
Handles withdrawal of Capacity from an Account.
Sourcefn can_withdraw_fee(
key: &T::AccountId,
fee: Self::Balance,
) -> Result<(), TransactionValidityError>
fn can_withdraw_fee( key: &T::AccountId, fee: Self::Balance, ) -> Result<(), TransactionValidityError>
Checks if there is enough Capacity balance to cover the fee.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.