Skip to content

Commit

Permalink
Merge pull request #60 from Proof-Of-Humanity/feat/test-suite
Browse files Browse the repository at this point in the history
fix(PoH): processVouches indexing
  • Loading branch information
clesaege authored Sep 3, 2024
2 parents 4082bbd + 560d5c2 commit 22c5d45
Show file tree
Hide file tree
Showing 6 changed files with 2,197 additions and 209 deletions.
4 changes: 2 additions & 2 deletions contracts/ProofOfHumanity.sol
Original file line number Diff line number Diff line change
Expand Up @@ -1215,8 +1215,8 @@ contract ProofOfHumanity is IProofOfHumanity, IArbitrable, IEvidence {

if (applyPenalty) {
// Situation when vouching address is in the middle of renewal process.
uint256 voucherRequestId = voucherHumanity.requestCount[voucherHumanity.owner] - 1;
if (voucherRequestId != 0) voucherHumanity.requests[voucherRequestId].punishedVouch = true;
uint256 voucherRequestCount = voucherHumanity.requestCount[voucherHumanity.owner];
if (voucherRequestCount != 0) voucherHumanity.requests[voucherRequestCount - 1].punishedVouch = true;

delete voucherHumanity.owner;

Expand Down
4 changes: 2 additions & 2 deletions contracts/extending-old/ProofOfHumanityExtended.sol
Original file line number Diff line number Diff line change
Expand Up @@ -1250,8 +1250,8 @@ contract ProofOfHumanityExtended is IProofOfHumanity, IArbitrable, IEvidence {
if (applyPenalty) {
// Situation when vouching address is in the middle of renewal process.
if (voucherHumanity.owner != address(0x0) && block.timestamp < voucherHumanity.expirationTime) {
uint256 voucherRequestId = voucherHumanity.requestCount[voucherHumanity.owner] - 1;
if (voucherRequestId != 0) voucherHumanity.requests[voucherRequestId].punishedVouch = true;
uint256 voucherRequestCount = voucherHumanity.requestCount[voucherHumanity.owner];
if (voucherRequestCount != 0) voucherHumanity.requests[voucherRequestCount - 1].punishedVouch = true;

delete voucherHumanity.owner;

Expand Down
Loading

0 comments on commit 22c5d45

Please sign in to comment.