Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/dev' into fix/handle-dispute-esc…
Browse files Browse the repository at this point in the history
…alated
  • Loading branch information
0xyaco committed Nov 1, 2024
2 parents a43b62d + 42ee7c4 commit 4ab85a4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 12 deletions.
7 changes: 6 additions & 1 deletion packages/automated-dispute/src/services/eboActor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,12 @@ export class EboActor {
} catch (err) {
if (err instanceof ProphetDecodingError) {
// Skipping malformed entities
this.logger.warn(err.message);
this.logger.warn(
stringify({
reason: err.err?.name,
message: err.message,
}),
);

continue;
} else {
Expand Down
14 changes: 3 additions & 11 deletions packages/automated-dispute/src/services/prophetCodec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -237,18 +237,10 @@ export class ProphetCodec {
* @returns The DisputeStatus string corresponding to the input value.
*/
static decodeDisputeStatus(status: number): DisputeStatus {
try {
const disputeStatus = DISPUTE_STATUS_ENUM[status];
const disputeStatus: DisputeStatus | undefined = DISPUTE_STATUS_ENUM[status];

if (!disputeStatus) throw new ProphetDecodingError("dispute.status", toHex(status));
else return disputeStatus;
} catch (err) {
throw new ProphetDecodingError(
"dispute.status",
toHex(status.toString()),
err instanceof Error ? err : undefined,
);
}
if (disputeStatus) return disputeStatus;
else throw new ProphetDecodingError("dispute.status", toHex(status.toString()));
}

/**
Expand Down

0 comments on commit 4ab85a4

Please sign in to comment.