Trait orml_traits::auction::AuctionHandler
source · pub trait AuctionHandler<AccountId, Balance, BlockNumber, AuctionId> {
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§
sourcefn on_new_bid(
now: BlockNumber,
id: AuctionId,
new_bid: (AccountId, Balance),
last_bid: Option<(AccountId, Balance)>
) -> OnNewBidResult<BlockNumber>
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.
sourcefn on_auction_ended(id: AuctionId, winner: Option<(AccountId, Balance)>)
fn on_auction_ended(id: AuctionId, winner: Option<(AccountId, Balance)>)
End an auction with winner