Skip to content

Commit

Permalink
Merge pull request #93 from MinaFoundation/feature/worker-heartbeat-a…
Browse files Browse the repository at this point in the history
…dmin

Feature/worker heartbeat admin
  • Loading branch information
iluxonchik authored Dec 19, 2024
2 parents 4fdc8b7 + ca51d4f commit 9213e8f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "pgt-web-app",
"version": "0.1.23",
"version": "0.1.24",
"private": true,
"type": "module",
"scripts": {
Expand Down
11 changes: 7 additions & 4 deletions src/services/ProposalStatusMoveService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,8 @@ export class ProposalStatusMoveService {
? await this.shouldMoveToDeliberation(proposal)
: await this.shouldMoveBackToConsideration(proposal);

logger.info(`Proposal ${proposalId} should move to ${shouldMove ? ProposalStatus.DELIBERATION : ProposalStatus.CONSIDERATION}. Proposal status: ${proposal.status}t statu`);

logger.info(`Proposal ${proposalId} should move to ${shouldMove ? ProposalStatus.DELIBERATION : ProposalStatus.CONSIDERATION}. Proposal status: ${proposal.status}`);

if (shouldMove) {
const newStatus = proposal.status === ProposalStatus.CONSIDERATION
Expand Down Expand Up @@ -159,6 +160,7 @@ export class ProposalStatusMoveService {
const ocvData = proposal.OCVConsiderationVote?.voteData as OCVVoteResponse | undefined;
const ocvEligible = ocvData?.eligible ?? false;

logger.info(`OCV data: ${JSON.stringify(ocvData)}`);
logger.info(`Proposal ${proposal.id} should move to DELIBERATION. Approval count: ${approvalCount}, min approvals: ${this.config.considerationPhase.minReviewerApprovals}, OCV eligible: ${ocvEligible}`);

return isMinApprovals || ocvEligible;
Expand All @@ -167,12 +169,13 @@ export class ProposalStatusMoveService {
private async shouldMoveBackToConsideration(proposal: ProposalWithVotes): Promise<boolean> {
const approvalCount = this.countValidApprovals(proposal);
const isMinApprovals = approvalCount >= this.config.considerationPhase.minReviewerApprovals;
const ocvData = proposal.OCVConsiderationVote?.voteData as OCVVoteResponse | undefined;
const ocvData = proposal.OCVConsiderationVote?.voteData as OCVVoteResponse | undefined;
const ocvEligible = ocvData?.eligible ?? false;


logger.info(`OCV data: ${JSON.stringify(ocvData)}`);
logger.info(`Proposal ${proposal.id} should move back to CONSIDERATION. Approval count: ${approvalCount}, min approvals: ${this.config.considerationPhase.minReviewerApprovals}, OCV eligible: ${ocvEligible}`);

return !(isMinApprovals || ocvEligible);
return !isMinApprovals && !ocvEligible;
}

private countValidApprovals(proposal: ProposalWithVotes): number {
Expand Down

0 comments on commit 9213e8f

Please sign in to comment.