Skip to content

Commit

Permalink
docs: add docs to dispute methods on EboActor
Browse files Browse the repository at this point in the history
  • Loading branch information
0xyaco committed Aug 13, 2024
1 parent 0f369d6 commit 66dc205
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions packages/automated-dispute/src/eboActor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,13 @@ export class EboActor {
else await this.pledgeAgainst(request, dispute);
}

/**
* Check if a dispute is valid, comparing the already submitted and disputed proposal with
* the response this actor would propose.
*
* @param proposedResponse the already submitted response
* @returns true if the hypothetical proposal is different that the submitted one, false otherwise
*/
private async isValidDispute(proposedResponse: Response) {
const actorResponse = await this.buildResponse(
proposedResponse.prophetData.response.chainId,
Expand All @@ -270,6 +277,12 @@ export class EboActor {
return !equalResponses;
}

/**
* Pledge in favor of the dispute.
*
* @param request the dispute's `Request`
* @param dispute the `Dispute`
*/
private async pledgeFor(request: Request, dispute: Dispute) {
try {
this.logger.info(`Pledging against dispute ${dispute.id}`);
Expand All @@ -288,6 +301,12 @@ export class EboActor {
}
}

/**
* Pledge against the dispute.
*
* @param request the dispute's `Request`
* @param dispute the `Dispute`
*/
private async pledgeAgainst(request: Request, dispute: Dispute) {
try {
this.logger.info(`Pledging for dispute ${dispute.id}`);
Expand Down

0 comments on commit 66dc205

Please sign in to comment.