Skip to content

Commit

Permalink
Fixed issue in computing the project verification attestation
Browse files Browse the repository at this point in the history
  • Loading branch information
aminlatifi committed May 15, 2024
1 parent 733f50c commit 667b038
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 9 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
"test:run-fresh-db": "docker-compose -f docker-compose-potgres-test.yml down -v; docker-compose --env-file .env.test -f docker-compose-potgres-test.yml up -d",
"test": "npm run test:run-fresh-db; dotenvx run --env-file=.env.test -- jest --runInBand",
"clear:generate:migration:run:locally": "sqd codegen ; docker compose -f docker-compose-potgres.yml down -v;docker compose -f docker-compose-potgres.yml up -d;sqd migration:generate; sqd run",
"clear:run:locally": "sqd codegen ; docker compose -f docker-compose-potgres.yml down -v;docker compose -f docker-compose-potgres.yml up -d; sqd run",
"run:locally": "sqd build; sqd run"
"clear:run:locally": "sqd build ; docker compose -f docker-compose-potgres.yml down -v;docker compose -f docker-compose-potgres.yml up -d; sqd run",
"run:locally": "docker compose -f docker-compose-potgres.yml up -d; sqd build; sqd run"
},
"dependencies": {
"@ethereum-attestation-service/eas-sdk": "^1.5.0",
Expand Down
4 changes: 3 additions & 1 deletion src/controllers/authorizeAttestation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ export const handleAuthorize = async (
ctx.store.upsert(attestorOrganisation);

ctx.log.debug(
`Attestor ${accountAddress} authorized for organisation ${organisation.name}: ${attestorOrganisation}`
`Attestor ${accountAddress} authorized for organisation ${
organisation.name
}: ${JSON.stringify(attestorOrganisation)}`
);
};

Expand Down
4 changes: 2 additions & 2 deletions src/controllers/projectVerificationAttestation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export const handleProjectAttestation = async (
uid: ${uid}
schemaUid: ${schemaUid}
issuer: ${issuer}
decodedData: ${JSON.stringify(decodedData, null, 2)}
decodedData: ${JSON.stringify(decodedData)}
projectVerificationAttestation: ${projectVerificationAttestation}
`);
throw new Error("Error parsing project verification attestation");
Expand Down Expand Up @@ -124,7 +124,7 @@ export const handleProjectAttestationRevoke = async (

attestation.revoked = true;
await ctx.store.upsert(attestation);
ctx.log.debug(`Revoked project attestation ${attestation}`);
ctx.log.debug(`Revoked project attestation ${JSON.stringify(attestation)}`);

await updateProjectAttestationCounts(ctx, attestation.project);
};
4 changes: 0 additions & 4 deletions src/controllers/utils/modelHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,9 @@ import {
Organisation,
OrganisationProject,
Project,
ProjectAttestation,
} from "../../model";
import { getEntityManger } from "./databaseHelper";
import { ProjectStats } from "./types";
import { In, Not } from "typeorm";

export const upsertOrganisatoinProject = async (
ctx: DataHandlerContext<Store>,
Expand All @@ -36,8 +34,6 @@ export const updateProjectAttestationCounts = async (
): Promise<void> => {
const em = getEntityManger(ctx);
const projectStats = await getProjectStats(ctx, project);
console.log("projectStats:", projectStats);
// throw new Error("Let's exit");

project.totalVouches = projectStats.pr_total_vouches;
project.totalFlags = projectStats.pr_total_flags;
Expand Down

0 comments on commit 667b038

Please sign in to comment.