Skip to content

Commit

Permalink
fix: pr comments
Browse files Browse the repository at this point in the history
  • Loading branch information
0xkenj1 committed Nov 13, 2024
1 parent 9e4e78d commit 0df4dc9
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export class RoleRevokedHandler implements IEventHandler<"Registry", "RoleRevoke
readonly chainId: ChainId,
private dependencies: Dependencies,
) {}
/* @inheritdoc */
async handle(): Promise<Changeset[]> {
const { projectRepository } = this.dependencies;
const account = getAddress(this.event.params.account);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ describe("ProfileMetadataUpdatedHandler", () => {
metadata: [0, mockCid],
profileId: "mockProfileId",
},
// Add other necessary event properties here
} as ProcessorEvent<"Registry", "ProfileMetadataUpdated">;

const mockDependencies = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
} from "@grants-stack-indexer/shared";

import { ProcessorDependencies } from "../../../src/internal.js";
import { RoleGrantedHandler } from "../../../src/processors/registry/handlers/index.js"; // Adjust path if needed
import { RoleGrantedHandler } from "../../../src/processors/registry/handlers/index.js";

describe("RoleGrantedHandler", () => {
const mockProjectRepository = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,10 @@ describe("RoleRevokedHandler", () => {
});

it("throw an error when getProjectById fails", async () => {
const error = new Error("Database error");
const error = new ProjectByRoleNotFound(
mockEvent.chainId as ChainId,
mockEvent.params.role,
);
vi.spyOn(mockDependencies.projectRepository, "getProjectById").mockRejectedValueOnce(error);

const handler = new RoleRevokedHandler(mockEvent, mockChainId, mockDependencies);
Expand Down

0 comments on commit 0df4dc9

Please sign in to comment.