Trait OnDemandRevenue
pub trait OnDemandRevenue<Balance, AccountId> {
// Required methods
fn is_enabled() -> bool;
fn claim_revenue(
up_to: u32,
beneficiary: &AccountId,
) -> RevenueClaim<Balance>;
}Expand description
A source of revenue from instantaneous (on-demand) Coretime sales.
The sales are expected to happen on the same chain as pallet-broker, so that the revenue can
be claimed and paid out synchronously.
Required Methods§
fn is_enabled() -> bool
fn is_enabled() -> bool
Whether on-demand Coretime is sold here.
Once it is, the claimer is expected to claim the revenue through Self::claim_revenue.
Until then, no orders are accepted, and the claimer is expected to get its revenue from
elsewhere.
fn claim_revenue(up_to: u32, beneficiary: &AccountId) -> RevenueClaim<Balance>
fn claim_revenue(up_to: u32, beneficiary: &AccountId) -> RevenueClaim<Balance>
Claim the revenue from the on-demand orders placed during timeslice up_to and during
every earlier timeslice whose revenue has not been claimed yet, transferring it to
beneficiary.
The claimer is expected to claim every timeslice once it has ended.
The revenue of a timeslice is either paid out in full or not at all. The oldest revenue is paid out first.
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.
Implementations on Foreign Types§
§impl<Balance, AccountId> OnDemandRevenue<Balance, AccountId> for ()
No on-demand Coretime market on this chain, for a broker which gets its revenue from elsewhere.
impl<Balance, AccountId> OnDemandRevenue<Balance, AccountId> for ()
No on-demand Coretime market on this chain, for a broker which gets its revenue from elsewhere.