Trait orml_traits::auction::Auction
source · pub trait Auction<AccountId, BlockNumber> {
type AuctionId: FullCodec + Default + Copy + Eq + PartialEq + MaybeSerializeDeserialize + Bounded + Debug;
type Balance: AtLeast32Bit + FullCodec + Copy + MaybeSerializeDeserialize + Debug + Default;
fn auction_info(
id: Self::AuctionId
) -> Option<AuctionInfo<AccountId, Self::Balance, BlockNumber>>;
fn update_auction(
id: Self::AuctionId,
info: AuctionInfo<AccountId, Self::Balance, BlockNumber>
) -> DispatchResult;
fn new_auction(
start: BlockNumber,
end: Option<BlockNumber>
) -> Result<Self::AuctionId, DispatchError>;
fn remove_auction(id: Self::AuctionId);
}
Expand description
Abstraction over a simple auction system.
Required Associated Types§
sourcetype AuctionId: FullCodec + Default + Copy + Eq + PartialEq + MaybeSerializeDeserialize + Bounded + Debug
type AuctionId: FullCodec + Default + Copy + Eq + PartialEq + MaybeSerializeDeserialize + Bounded + Debug
The id of an AuctionInfo
sourcetype Balance: AtLeast32Bit + FullCodec + Copy + MaybeSerializeDeserialize + Debug + Default
type Balance: AtLeast32Bit + FullCodec + Copy + MaybeSerializeDeserialize + Debug + Default
The price to bid.
Required Methods§
sourcefn auction_info(
id: Self::AuctionId
) -> Option<AuctionInfo<AccountId, Self::Balance, BlockNumber>>
fn auction_info(
id: Self::AuctionId
) -> Option<AuctionInfo<AccountId, Self::Balance, BlockNumber>>
The auction info of id
sourcefn update_auction(
id: Self::AuctionId,
info: AuctionInfo<AccountId, Self::Balance, BlockNumber>
) -> DispatchResult
fn update_auction(
id: Self::AuctionId,
info: AuctionInfo<AccountId, Self::Balance, BlockNumber>
) -> DispatchResult
Update the auction info of id
with info
sourcefn new_auction(
start: BlockNumber,
end: Option<BlockNumber>
) -> Result<Self::AuctionId, DispatchError>
fn new_auction(
start: BlockNumber,
end: Option<BlockNumber>
) -> Result<Self::AuctionId, DispatchError>
Create new auction with specific startblock and endblock, return the id of the auction
sourcefn remove_auction(id: Self::AuctionId)
fn remove_auction(id: Self::AuctionId)
Remove auction by id