Trait pallet_evm::OnChargeEVMTransaction [−][src]
Handle withdrawing, refunding and depositing of transaction fees.
Similar to OnChargeTransaction
of pallet_transaction_payment
Associated Types
type LiquidityInfo: Default
[src]
Required methods
fn withdraw_fee(who: &H160, fee: U256) -> Result<Self::LiquidityInfo, Error<T>>
[src]
Before the transaction is executed the payment of the transaction fees need to be secured.
fn correct_and_deposit_fee(
who: &H160,
corrected_fee: U256,
already_withdrawn: Self::LiquidityInfo
) -> Result<(), Error<T>>
[src]
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.
Implementations on Foreign Types
impl<T> OnChargeEVMTransaction<T> for () where
T: Config,
<T::Currency as Currency<<T as Config>::AccountId>>::PositiveImbalance: Imbalance<<T::Currency as Currency<<T as Config>::AccountId>>::Balance, Opposite = <T::Currency as Currency<<T as Config>::AccountId>>::NegativeImbalance>,
<T::Currency as Currency<<T as Config>::AccountId>>::NegativeImbalance: Imbalance<<T::Currency as Currency<<T as Config>::AccountId>>::Balance, Opposite = <T::Currency as Currency<<T as Config>::AccountId>>::PositiveImbalance>,
[src]
T: Config,
<T::Currency as Currency<<T as Config>::AccountId>>::PositiveImbalance: Imbalance<<T::Currency as Currency<<T as Config>::AccountId>>::Balance, Opposite = <T::Currency as Currency<<T as Config>::AccountId>>::NegativeImbalance>,
<T::Currency as Currency<<T as Config>::AccountId>>::NegativeImbalance: Imbalance<<T::Currency as Currency<<T as Config>::AccountId>>::Balance, Opposite = <T::Currency as Currency<<T as Config>::AccountId>>::PositiveImbalance>,
Implementation for () does not specify what to do with imbalance
type LiquidityInfo = Option<<T::Currency as Currency<<T as Config>::AccountId>>::NegativeImbalance>
fn withdraw_fee(who: &H160, fee: U256) -> Result<Self::LiquidityInfo, Error<T>>
[src]
fn correct_and_deposit_fee(
who: &H160,
corrected_fee: U256,
already_withdrawn: Self::LiquidityInfo
) -> Result<(), Error<T>>
[src]
who: &H160,
corrected_fee: U256,
already_withdrawn: Self::LiquidityInfo
) -> Result<(), Error<T>>
Implementors
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>,
[src]
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>
fn withdraw_fee(who: &H160, fee: U256) -> Result<Self::LiquidityInfo, Error<T>>
[src]
fn correct_and_deposit_fee(
who: &H160,
corrected_fee: U256,
already_withdrawn: Self::LiquidityInfo
) -> Result<(), Error<T>>
[src]
who: &H160,
corrected_fee: U256,
already_withdrawn: Self::LiquidityInfo
) -> Result<(), Error<T>>