Struct noble_transaction_payment::CurrencyAdapter[][src]

pub struct CurrencyAdapter<C, OU>(_);

Implements the transaction payment for a module implementing the Currency trait (eg. the noble_balances) using an unbalance handler (implementing OnUnbalanced).

Trait Implementations

impl<T, C, OU> OnChargeTransaction<T> for CurrencyAdapter<C, OU> where
    T: Config,
    T::TransactionByteFee: Get<<C as Currency<<T as Config>::AccountId>>::Balance>,
    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]

Default implementation for a Currency and an OnUnbalanced handler.

type LiquidityInfo = Option<<C as Currency<<T as Config>::AccountId>>::NegativeImbalance>

type Balance = <C as Currency<<T as Config>::AccountId>>::Balance

The underlying integer type in which fees are calculated.

fn withdraw_fee(
    who: &T::AccountId,
    _call: &T::Call,
    _info: &DispatchInfoOf<T::Call>,
    fee: Self::Balance,
    tip: Self::Balance
) -> Result<Self::LiquidityInfo, TransactionValidityError>
[src]

Withdraw the predicted fee from the transaction origin.

Note: The fee already includes the tip.

fn correct_and_deposit_fee(
    who: &T::AccountId,
    _dispatch_info: &DispatchInfoOf<T::Call>,
    _post_info: &PostDispatchInfoOf<T::Call>,
    corrected_fee: Self::Balance,
    tip: Self::Balance,
    already_withdrawn: Self::LiquidityInfo
) -> Result<(), TransactionValidityError>
[src]

Hand the fee and the tip over to the [OnUnbalanced] implementation. Since the predicted fee might have been too high, parts of the fee may be refunded.

Note: The fee already includes the tip.

Auto Trait Implementations

impl<C, OU> RefUnwindSafe for CurrencyAdapter<C, OU> where
    C: RefUnwindSafe,
    OU: RefUnwindSafe

impl<C, OU> Send for CurrencyAdapter<C, OU> where
    C: Send,
    OU: Send

impl<C, OU> Sync for CurrencyAdapter<C, OU> where
    C: Sync,
    OU: Sync

impl<C, OU> Unpin for CurrencyAdapter<C, OU> where
    C: Unpin,
    OU: Unpin

impl<C, OU> UnwindSafe for CurrencyAdapter<C, OU> where
    C: UnwindSafe,
    OU: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> CheckedConversion for T[src]

impl<T> Downcast for T where
    T: Any

impl<T> DowncastSync for T where
    T: Any + Send + Sync

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> IsType<T> for T[src]

impl<T, Outer> IsWrappedBy<Outer> for T where
    T: From<Outer>,
    Outer: AsRef<T> + AsMut<T> + From<T>, 
[src]

pub fn from_ref(outer: &Outer) -> &T[src]

Get a reference to the inner from the outer.

pub fn from_mut(outer: &mut Outer) -> &mut T[src]

Get a mutable reference to the inner from the outer.

impl<T> MaybeRefUnwindSafe for T where
    T: RefUnwindSafe

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> SaturatedConversion for T

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<S, T> UncheckedInto<T> for S where
    T: UncheckedFrom<S>, 
[src]

impl<T, S> UniqueSaturatedInto<T> for S where
    T: Bounded,
    S: TryInto<T>, 

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,