referrerpolicy=no-referrer-when-downgrade

ChannelDepositProvider

Trait ChannelDepositProvider 

Source
pub trait ChannelDepositProvider {
    type OnDepositSet: OnDepositSet;

    // Required methods
    fn try_set_deposit(
        request: DepositChangeRequest,
    ) -> Result<DepositChangeResponse, DispatchError>;
    fn weight_of_try_set_deposit() -> Weight;
}
Expand description

Holds HRMP channel deposits.

A provider either applies a request within the call or accepts it and reports the outcome later through Self::OnDepositSet. While a request for one side of a channel is pending, it refuses another request for that side.

Required Associated Types§

Source

type OnDepositSet: OnDepositSet

Receives the report of a pending request once it is done.

Required Methods§

Source

fn try_set_deposit( request: DepositChangeRequest, ) -> Result<DepositChangeResponse, DispatchError>

Applies request, or accepts it to apply it later. Refuses it with an error, e.g. when the funds are short or a request for the same side is still pending.

Source

fn weight_of_try_set_deposit() -> Weight

Upper bound of what Self::try_set_deposit spends on top of what the calls’ benchmarks measure with the in-pallet provider, e.g. sending a message.

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.

Implementors§

Source§

impl<T: Config> ChannelDepositProvider for Pallet<T>

The in-pallet provider: holds the deposits in Config::Currency and applies every request within the call.