Skip to content

Commit

Permalink
Merge pull request #29 from icon-community/fix/progress-report-submis…
Browse files Browse the repository at this point in the history
…sion-fail

Fix/progress report submission fail
  • Loading branch information
naneey authored Feb 10, 2024
2 parents fc39096 + b5e9a01 commit a8355fc
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 8 deletions.
2 changes: 1 addition & 1 deletion CPSCore/build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version = '1.3.8'
version = '1.3.9'

dependencies {
compileOnly 'foundation.icon:javaee-api:0.9.2'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,32 @@ public CPSCore(@Optional BigInteger bondValue, @Optional BigInteger applicationP
this.period.set(APPLICATION_PERIOD, applicationPeriod);
this.period.set(VOTING_PERIOD, TOTAL_PERIOD.subtract(applicationPeriod));
}

// Fix for ICON Dashboard Proposal not being able to submit progress report being rejected

String progressReport = "bafybeic4jhoowlgeyewjqkcpgbm3fs7mgtxzhqd5kbguihoehm4cwwwzcq";
String proposalKey = "bafybeidoxysex3jloigzi4pvdeqgy35a4nykd46w66pobxrkephpawyjoi";

String proposalPrefix = proposalPrefix(proposalKey);
String progressReportPrefix = progressReportPrefix(progressReport);

ProposalDataDb.submitProgressReport.at(proposalPrefix).set(Boolean.FALSE);

ProgressReportDataDb.status.at(progressReportPrefix).set(PROGRESS_REPORT_REJECTED);
ProgressReportDataDb.timestamp.at(progressReportPrefix).set(BigInteger.valueOf(1706244342109937L));
Status status = new Status();
status.progressReportStatus.get(PROGRESS_REPORT_REJECTED).add(progressReport);

// End of fix

// Migrate sponsor bond from Techiast- to Techiast
Address oldAddr = Address.fromString("hxdc4b3fb5b47d6c14c7f9a0bac8eea9f3f48d3288");
Address address = Address.fromString("hxfe0256b41f1db0186f9e6cbebf8c71cf006d5d17");
DictDB<String, BigInteger> userAmounts = sponsorBondReturn.at(oldAddr.toString());

BigInteger bnUSDAmount = userAmounts.getOrDefault(bnUSD, BigInteger.ZERO);
sponsorBondReturn.at(address.toString()).set(bnUSD, bnUSDAmount);

}

@Override
Expand Down Expand Up @@ -1370,9 +1396,9 @@ private void updateProgressReportResult() {
ProposalDataDb.updatePercentageCompleted(proposal_prefix, 100);

// Transfer the Sponsor - Bond back to the Sponsor P - Rep after the project is completed.
this.sponsorBondReturn.at(_sponsor_address.toString()).set(flag,
this.sponsorBondReturn.at(_sponsor_address.toString()).getOrDefault(flag, BigInteger.ZERO).
add(_sponsor_deposit_amount));
DictDB<String, BigInteger> userSponsorBond = this.sponsorBondReturn.at(_sponsor_address.toString());
BigInteger sponsorBond = userSponsorBond.getOrDefault(flag, BigInteger.ZERO);
userSponsorBond.set(flag, sponsorBond.add(_sponsor_deposit_amount));
sponsorDepositStatus.at(proposal_prefix).set(BOND_RETURNED);
SponsorBondReturned(_sponsor_address,
_sponsor_deposit_amount + " " + flag + " returned to sponsor address.");
Expand Down Expand Up @@ -1481,10 +1507,9 @@ private void checkProgressReportSubmission() {
String lastProgressKey = progressReports.get(submittedProgressReports - 1);
int milestoneCount = ProgressReportDataDb.milestoneSubmitted.at(progressReportPrefix(lastProgressKey)).size();
if (milestoneCount == 0) {
Status status = new Status();
removeArrayItem(status.waitingProgressReports, lastProgressKey);
ProposalDataDb.submitProgressReport.at(proposalPrefix).set(Boolean.FALSE);
updateProgressReportStatus(lastProgressKey, PROGRESS_REPORT_REJECTED);
checkProgressReportStatus(_ipfs_hash, proposalPrefix);

}
}
}
Expand Down Expand Up @@ -2727,7 +2752,6 @@ public void updateContributor(String _ipfs_hash, Address _new_contributor, @Opti
callScore(getCpsTreasuryScore(), "updateContributorSponsorAddress", _ipfs_hash, _new_contributor);
}
UpdateContributorAddress(_contributor_address, _new_contributor);

}


Expand Down

0 comments on commit a8355fc

Please sign in to comment.