Skip to content

Commit

Permalink
fix councilFlag set at initialize of proposal
Browse files Browse the repository at this point in the history
  • Loading branch information
sdpisreddevil committed Oct 23, 2024
1 parent 1d22f39 commit fabf351
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,9 @@ private String getPrepName(Address address) {
int index = getCouncilManagers().indexOf(address);
return "Council Manager " + (index + 1);
}
return (String) getPRepInfo(address).get("name");
else {
return (String) getPRepInfo(address).get("name");
}
}

private BigInteger getStake(Address address) {
Expand Down Expand Up @@ -678,6 +680,7 @@ public void submitProposal(ProposalAttributes proposals, MilestonesAttributes[]
String ipfsHashPrefix = proposalPrefix(ipfsHash);

addDataToProposalDB(proposals, ipfsHashPrefix);
councilFlag.at(ipfsHashPrefix).set(getCouncilFlag());
BigInteger initialPaymentPercentage = callScore(BigInteger.class, getCpsTreasuryScore(), "getOnsetPayment");

BigInteger totalBudget = proposals.total_budget.multiply(EXA);
Expand Down Expand Up @@ -1436,7 +1439,6 @@ private void updateProgressReportResult() {
} else {
if (majorityFlag) {
_approved_reports_count += 1;

if (milestoneStatus == MILESTONE_REPORT_COMPLETED) {
milestonePassed += 1;
milestoneBudget = milestoneBudget.add(MilestoneDb.budget.at(milestonePrefix).getOrDefault(BigInteger.ZERO));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
package community.icon.cps.score.cpscore.db;

import community.icon.cps.score.lib.interfaces.CPSCoreInterface.ProposalAttributes;
import score.*;

import java.math.BigInteger;
import java.util.Map;

import community.icon.cps.score.lib.interfaces.CPSCoreInterface.ProposalAttributes;

import static community.icon.cps.score.cpscore.utils.ArrayDBUtils.recordTxHash;
import static community.icon.cps.score.cpscore.utils.Constants.*;
import static community.icon.cps.score.lib.interfaces.CPSCoreInterface.ProposalAttributes;

public class ProposalDataDb {
public static final BranchDB<String, VarDB<String>> ipfsHash = Context.newBranchDB(IPFS_HASH, String.class);
Expand Down Expand Up @@ -73,10 +71,7 @@ public static void addDataToProposalDB(ProposalAttributes proposalData, String p
token.at(prefix).set(proposalData.token);
milestoneCount.at(prefix).set(proposalData.milestoneCount);
isMilestone.at(prefix).set(true);

majorityFlag.at(prefix).set(false);
councilFlag.at(prefix).set(false);

}

public static void updatePercentageCompleted(String prefix, int percentage) {
Expand Down

0 comments on commit fabf351

Please sign in to comment.