Struct dao::bid_escrow::job_engine::JobEngineRef
source · pub struct JobEngineRef { /* private fields */ }Expand description
Reference to the JobEngine contract instance.
Implementations§
source§impl JobEngineRef
impl JobEngineRef
source§impl JobEngineRef
impl JobEngineRef
sourcepub fn submit_job_proof(&mut self, job_id: JobId, proof: DocumentHash)
pub fn submit_job_proof(&mut self, job_id: JobId, proof: DocumentHash)
Validates the correctness of proof submission.
If the submission is correct, the Job Storage is updated, the Voting process starts.
§Errors
If a proof has been submitted before, reverts with Error::JobAlreadySubmitted.
sourcepub fn submit_job_proof_during_grace_period(
&mut self,
job_id: JobId,
proof: DocumentHash,
reputation_stake: Balance,
onboard: bool
)
pub fn submit_job_proof_during_grace_period( &mut self, job_id: JobId, proof: DocumentHash, reputation_stake: Balance, onboard: bool )
Updates the old Bid and Job, the job is assigned to a new Worker. The rest goes the same
as regular proof submission. See submit_job_proof().
The old Worker who didn’t submit the proof in time, is getting slashed.
See the Grace Period section in the module description.
sourcepub fn cancel_job(&mut self, job_id: JobId)
pub fn cancel_job(&mut self, job_id: JobId)
Terminates the Voting process and slashes the Worker.
- the bid stake is redistributed along the VAs’ and the multisig wallet.
DOS Feeis returned to theJob Poster.
§Error
If the state in which the process cannot be canceled, the execution reverts with Error::CannotCancelJob or Error::JobCannotBeYetCanceled.
sourcepub fn vote(
&mut self,
voting_id: VotingId,
voting_type: VotingType,
choice: Choice,
stake: Balance
)
pub fn vote( &mut self, voting_id: VotingId, voting_type: VotingType, choice: Choice, stake: Balance )
sourcepub fn finish_voting(
&mut self,
voting_id: VotingId,
voting_type: VotingType
) -> VotingSummary
pub fn finish_voting( &mut self, voting_id: VotingId, voting_type: VotingType ) -> VotingSummary
Ends the current voting phase and redistributes funds.
Interacts with Reputation Token Contract to
redistribute reputation.
sourcepub fn slash_voter(
&mut self,
voter: Address
) -> (Vec<JobId>, Vec<VotingId>, Vec<VotingId>)
pub fn slash_voter( &mut self, voter: Address ) -> (Vec<JobId>, Vec<VotingId>, Vec<VotingId>)
Slashes the voter and cancels all his active jobs. Returns the lists of slashed jobs, canceled votings and affected votings.
sourcepub fn jobs_count(&self) -> u32
pub fn jobs_count(&self) -> u32
Returns the total number of jobs.
Trait Implementations§
source§impl Clone for JobEngineRef
impl Clone for JobEngineRef
source§fn clone(&self) -> JobEngineRef
fn clone(&self) -> JobEngineRef
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more