Struct dao::bid_escrow::bid_engine::BidEngine
source · pub struct BidEngine { /* private fields */ }
Expand description
Manages the Bidding process.
Implementations§
source§impl BidEngine
impl BidEngine
sourcepub fn job_offers_count(&self) -> u32
pub fn job_offers_count(&self) -> u32
Gets the total number of JobOffers.
sourcepub fn bids_count(&self) -> u32
pub fn bids_count(&self) -> u32
Gets the total number of Bids.
sourcepub fn get_job_offer(&self, job_offer_id: JobOfferId) -> Option<JobOffer>
pub fn get_job_offer(&self, job_offer_id: JobOfferId) -> Option<JobOffer>
Gets the JobOffer with a given id or None
.
sourcepub fn get_job_offer_or_revert(&self, job_offer_id: &JobOfferId) -> JobOffer
pub fn get_job_offer_or_revert(&self, job_offer_id: &JobOfferId) -> JobOffer
Gets the JobOffer with a given id or reverts with JobOfferNotFound.
sourcepub fn get_bid_or_revert(&self, bid_id: &BidId) -> Bid
pub fn get_bid_or_revert(&self, bid_id: &BidId) -> Bid
Gets the Bid with a given id or reverts with BidNotFound.
sourcepub fn next_bid_id(&mut self) -> BidId
pub fn next_bid_id(&mut self) -> BidId
Increments bid counter.
sourcepub fn get_job_offer_configuration(&self, job: &Job) -> Configuration
pub fn get_job_offer_configuration(&self, job: &Job) -> Configuration
Gets the Configuration of the Job.
pub fn post_job_offer( &mut self, expected_timeframe: BlockTime, budget: Balance, dos_fee: Balance )
pub fn submit_bid( &mut self, job_offer_id: JobOfferId, time: BlockTime, payment: Balance, reputation_stake: Balance, onboard: bool, cspr_stake: Option<Balance> )
pub fn cancel_bid(&mut self, bid_id: BidId)
sourcepub fn cancel_job_offer(&mut self, job_offer_id: JobOfferId)
pub fn cancel_job_offer(&mut self, job_offer_id: JobOfferId)
Invalidates the Job Offer
, returns DOS Fee
to the Job Poster
, returns funds to Bidders
.
If a Job with the given id does not exists, contract execution stop with Error::JobOfferNotFound
.
Executes validations: HasPermissionsToCancelJobOffer
and CanJobOfferBeCancelled
.
pub fn pick_bid( &mut self, job_offer_id: JobOfferId, bid_id: BidId, cspr_amount: Balance )
pub fn slash_voter(&mut self, voter: Address) -> (Vec<JobOfferId>, Vec<BidId>)
source§impl BidEngine
impl BidEngine
pub fn cancel_all_bids(&mut self, job_offer_id: &JobOfferId)
pub fn return_job_offer_poster_dos_fee(&mut self, job_offer_id: &JobOfferId)
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for BidEngine
impl Send for BidEngine
impl Sync for BidEngine
impl Unpin for BidEngine
impl UnwindSafe for BidEngine
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more