Trait orml_traits::auction::AuctionHandler

source ·
pub trait AuctionHandler<AccountId, Balance, BlockNumber, AuctionId> {
    // Required methods
    fn on_new_bid(
        now: BlockNumber,
        id: AuctionId,
        new_bid: (AccountId, Balance),
        last_bid: Option<(AccountId, Balance)>
    ) -> OnNewBidResult<BlockNumber>;
    fn on_auction_ended(id: AuctionId, winner: Option<(AccountId, Balance)>);
}
Expand description

Hooks for auction to handle bids.

Required Methods§

source

fn on_new_bid( now: BlockNumber, id: AuctionId, new_bid: (AccountId, Balance), last_bid: Option<(AccountId, Balance)> ) -> OnNewBidResult<BlockNumber>

Called when new bid is received. The return value determines if the bid should be accepted and update auction end time. Implementation should reserve money from current winner and refund previous winner.

source

fn on_auction_ended(id: AuctionId, winner: Option<(AccountId, Balance)>)

End an auction with winner

Object Safety§

This trait is not object safe.

Implementors§