Skip to content

Commit

Permalink
fix: capitalize request registry status
Browse files Browse the repository at this point in the history
  • Loading branch information
0xyaco committed Sep 9, 2024
1 parent ce83a43 commit dec8b75
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion packages/automated-dispute/src/eboActor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@ export class EboActor {
*/
public canBeTerminated(blockNumber: bigint): boolean {
const request = this.getActorRequest();
const isRequestFinalized = request.status === "finalized";
const isRequestFinalized = request.status === "Finalized";
const nonSettledProposals = this.activeProposals(blockNumber);

return isRequestFinalized && nonSettledProposals.length === 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export class AddRequest implements EboRegistryCommand {
epoch: event.metadata.epoch,
createdAt: event.blockNumber,
prophetData: event.metadata.request,
status: "active",
status: "Active",
};

return new AddRequest(registry, request);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export class FinalizeRequest implements EboRegistryCommand {

this.previousStatus = this.request.status;

this.registry.updateRequestStatus(this.request.id, "finalized");
this.registry.updateRequestStatus(this.request.id, "Finalized");

this.wasRun = true;
}
Expand Down
2 changes: 1 addition & 1 deletion packages/automated-dispute/src/types/prophet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { NormalizedAddress } from "@ebo-agent/shared";
import { Address } from "viem";

export type RequestId = NormalizedAddress;
export type RequestStatus = "active" | "finalized";
export type RequestStatus = "Active" | "Finalized";

export interface Request {
id: RequestId;
Expand Down
2 changes: 1 addition & 1 deletion packages/automated-dispute/tests/eboActor/fixtures.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export const DEFAULT_MOCKED_REQUEST_CREATED_DATA: Request = {
chainId: "eip155:1",
epoch: 1n,
createdAt: 1n,
status: "active",
status: "Active",
prophetData: {
disputeModule: "0x01" as Address,
finalityModule: "0x02" as Address,
Expand Down
4 changes: 2 additions & 2 deletions packages/automated-dispute/tests/services/eboActor.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ describe("EboActor", () => {
it("returns false if the request is finalized but there's one active dispute", () => {
const request: Request = {
...DEFAULT_MOCKED_REQUEST_CREATED_DATA,
status: "finalized",
status: "Finalized",
};

const response = mocks.buildResponse(request);
Expand All @@ -294,7 +294,7 @@ describe("EboActor", () => {
it("returns true once everything is settled", () => {
const request: Request = {
...DEFAULT_MOCKED_REQUEST_CREATED_DATA,
status: "finalized",
status: "Finalized",
};

const disputedResponse = mocks.buildResponse(request, { id: "0x01" });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ describe("FinalizeRequest", () => {

command.run();

expect(registry.updateRequestStatus).toHaveBeenCalledWith(request.id, "finalized");
expect(registry.updateRequestStatus).toHaveBeenCalledWith(request.id, "Finalized");
});

it("throws if the command was already run", () => {
Expand All @@ -62,7 +62,7 @@ describe("FinalizeRequest", () => {
expect(registry.updateRequestStatus).toHaveBeenNthCalledWith(
1,
request.id,
"finalized",
"Finalized",
);

expect(registry.updateRequestStatus).toHaveBeenNthCalledWith(
Expand Down

0 comments on commit dec8b75

Please sign in to comment.