pub trait ExpirationScheduler<BlockNumber, OrderBookId, DEXId, OrderId, Error> {
    // Required methods
    fn service(current_block: BlockNumber, weight: &mut WeightMeter);
    fn schedule(
        when: BlockNumber,
        order_book_id: OrderBookId,
        order_id: OrderId
    ) -> Result<(), Error>;
    fn unschedule(
        when: BlockNumber,
        order_book_id: OrderBookId,
        order_id: OrderId
    ) -> Result<(), Error>;
}

Required Methods§

source

fn service(current_block: BlockNumber, weight: &mut WeightMeter)

Execute scheduled expirations considering this block to be current_block and weight limit to be set by weight.

If the weight limit is reached, it should continue where it’s left at the next block.

source

fn schedule( when: BlockNumber, order_book_id: OrderBookId, order_id: OrderId ) -> Result<(), Error>

Schedule the order for expiration at block when.

source

fn unschedule( when: BlockNumber, order_book_id: OrderBookId, order_id: OrderId ) -> Result<(), Error>

Remove the order from expiration schedule for block when.

Implementors§

source§

impl<T: Config> ExpirationScheduler<<T as Config>::BlockNumber, OrderBookId<<T as Config>::AssetId, <T as Config>::DEXId>, <T as Config>::DEXId, <T as Config>::OrderId, DispatchError> for Pallet<T>