pub trait Auctioneer<BlockNumber> {
    type AccountId;
    type LeasePeriod;
    type Currency: ReservableCurrency<Self::AccountId>;

    fn new_auction(
        duration: BlockNumber,
        lease_period_index: Self::LeasePeriod
    ) -> DispatchResult; fn auction_status(now: BlockNumber) -> AuctionStatus<BlockNumber>; fn place_bid(
        bidder: Self::AccountId,
        para: ParaId,
        first_slot: Self::LeasePeriod,
        last_slot: Self::LeasePeriod,
        amount: <Self::Currency as Currency<Self::AccountId>>::Balance
    ) -> DispatchResult; fn lease_period_length() -> (BlockNumber, BlockNumber); fn lease_period_index(
        block: BlockNumber
    ) -> Option<(Self::LeasePeriod, bool)>; fn has_won_an_auction(para: ParaId, bidder: &Self::AccountId) -> bool; }

Required Associated Types§

An account identifier for a leaser.

The measurement type for counting lease periods (generally the same as BlockNumber).

The currency type in which the lease is taken.

Required Methods§

Create a new auction.

This can only happen when there isn’t already an auction in progress. Accepts the duration of this auction and the lease_period_index of the initial lease period of the four that are to be auctioned.

Given the current block number, return the current auction status.

Place a bid in the current auction.

  • bidder: The account that will be funding this bid.
  • para: The para to bid for.
  • first_slot: The first lease period index of the range to be bid on.
  • last_slot: The last lease period index of the range to be bid on (inclusive).
  • amount: The total amount to be the bid for deposit over the range.

The account Bidder must have at least amount available as a free balance in Currency. The implementation MUST remove or reserve amount funds from bidder and those funds should be returned or freed once the bid is rejected or lease has ended.

The length of a lease period, and any offset which may be introduced. This is only used in benchmarking to automate certain calls.

Returns the lease period at block, and if this is the first block of a new lease period.

Will return None if the first lease period has not started yet, for example when an offset is placed.

Check if the para and user combination has won an auction in the past.

Implementors§