diff --git a/packages/automated-dispute/src/services/prophetCodec.ts b/packages/automated-dispute/src/services/prophetCodec.ts index 72205c6..6e54fa0 100644 --- a/packages/automated-dispute/src/services/prophetCodec.ts +++ b/packages/automated-dispute/src/services/prophetCodec.ts @@ -237,21 +237,10 @@ export class ProphetCodec { * @returns The DisputeStatus string corresponding to the input value. */ static decodeDisputeStatus(status: number): DisputeStatus { - let disputeStatus: DisputeStatus | undefined; + const disputeStatus: DisputeStatus | undefined = DISPUTE_STATUS_ENUM[status]; - try { - disputeStatus = DISPUTE_STATUS_ENUM[status]; - } catch (err) { - throw new ProphetDecodingError( - "dispute.status", - toHex(status.toString()), - err instanceof Error ? err : undefined, - ); - } - - if (!disputeStatus) - throw new ProphetDecodingError("dispute.status", toHex(status.toString())); - else return disputeStatus; + if (disputeStatus) return disputeStatus; + else throw new ProphetDecodingError("dispute.status", toHex(status.toString())); } /**