Struct pallet_evm::EVMCurrencyAdapter [−][src]
pub struct EVMCurrencyAdapter<C, OU>(_);
Expand description
Implements the transaction payment for a module implementing the Currency
trait (eg. the pallet_balances) using an unbalance handler (implementing
OnUnbalanced
).
Similar to CurrencyAdapter
of pallet_transaction_payment
Trait Implementations
impl<T, C, OU> OnChargeEVMTransaction<T> for EVMCurrencyAdapter<C, OU> where
T: Config,
C: Currency<<T as Config>::AccountId>,
C::PositiveImbalance: Imbalance<<C as Currency<<T as Config>::AccountId>>::Balance, Opposite = C::NegativeImbalance>,
C::NegativeImbalance: Imbalance<<C as Currency<<T as Config>::AccountId>>::Balance, Opposite = C::PositiveImbalance>,
OU: OnUnbalanced<<C as Currency<<T as Config>::AccountId>>::NegativeImbalance>,
impl<T, C, OU> OnChargeEVMTransaction<T> for EVMCurrencyAdapter<C, OU> where
T: Config,
C: Currency<<T as Config>::AccountId>,
C::PositiveImbalance: Imbalance<<C as Currency<<T as Config>::AccountId>>::Balance, Opposite = C::NegativeImbalance>,
C::NegativeImbalance: Imbalance<<C as Currency<<T as Config>::AccountId>>::Balance, Opposite = C::PositiveImbalance>,
OU: OnUnbalanced<<C as Currency<<T as Config>::AccountId>>::NegativeImbalance>,
type LiquidityInfo = Option<<C as Currency<<T as Config>::AccountId>>::NegativeImbalance>
Before the transaction is executed the payment of the transaction fees need to be secured. Read more
fn correct_and_deposit_fee(
who: &H160,
corrected_fee: U256,
already_withdrawn: Self::LiquidityInfo
) -> Result<(), Error<T>>
fn correct_and_deposit_fee(
who: &H160,
corrected_fee: U256,
already_withdrawn: Self::LiquidityInfo
) -> Result<(), Error<T>>
After the transaction was executed the actual fee can be calculated. This function should refund any overpaid fees and optionally deposit the corrected amount. Read more
Auto Trait Implementations
impl<C, OU> RefUnwindSafe for EVMCurrencyAdapter<C, OU> where
C: RefUnwindSafe,
OU: RefUnwindSafe,
impl<C, OU> Send for EVMCurrencyAdapter<C, OU> where
C: Send,
OU: Send,
impl<C, OU> Sync for EVMCurrencyAdapter<C, OU> where
C: Sync,
OU: Sync,
impl<C, OU> Unpin for EVMCurrencyAdapter<C, OU> where
C: Unpin,
OU: Unpin,
impl<C, OU> UnwindSafe for EVMCurrencyAdapter<C, OU> where
C: UnwindSafe,
OU: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
type Output = T
type Output = T
Should always be Self
fn saturated_from<T>(t: T) -> Self where
Self: UniqueSaturatedFrom<T>,
fn saturated_from<T>(t: T) -> Self where
Self: UniqueSaturatedFrom<T>,
Convert from a value of T
into an equivalent instance of Self
. Read more
fn saturated_into<T>(self) -> T where
Self: UniqueSaturatedInto<T>,
fn saturated_into<T>(self) -> T where
Self: UniqueSaturatedInto<T>,
Consume self to return an equivalent value of T
. Read more
The inverse inclusion map: attempts to construct self
from the equivalent element of its
superset. Read more
pub fn is_in_subset(&self) -> bool
pub fn is_in_subset(&self) -> bool
Checks if self
is actually part of its subset T
(and can be converted to it).
pub fn to_subset_unchecked(&self) -> SS
pub fn to_subset_unchecked(&self) -> SS
Use with care! Same as self.to_subset
but without any property checks. Always succeeds.
pub fn from_subset(element: &SS) -> SP
pub fn from_subset(element: &SS) -> SP
The inclusion map: converts self
to the equivalent element of its superset.
The counterpart to unchecked_from
.
pub fn unique_saturated_into(self) -> T
pub fn unique_saturated_into(self) -> T
Consume self to return an equivalent value of T
.