Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: add cc threshold to epoch param #201

Merged
merged 1 commit into from
Jun 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ public class GenesisDataServiceImpl implements GenesisDataService {

private final static String COMMITTEE = "committee";
private final static String MEMBERS = "members";
private final static String QUORUM = "quorum";
private final static String THRESHOLD = "threshold";

private final static String PLUTUS_V_3_COST_MODEL = "plutusV3CostModel";
private final static String MIN_FEE_REF_SCRIPT_COST_PER_BYTE = "minFeeRefScriptCostPerByte";
Expand Down Expand Up @@ -376,6 +376,7 @@ public void fetchConwayGenesis(GenesisData genesisData) {
});
final var poolVotingThresholds = (Map<String, Object>) genesisConwayJsonMap.get(POOL_VOTING_THRESHOLDS);
final var dRepVotingThresholds = (Map<String, Object>) genesisConwayJsonMap.get(D_REP_VOTING_THRESHOLDS);
final var committee = (Map<String, Object>) genesisConwayJsonMap.get(COMMITTEE);

EpochParam genesisConwayProtocols = EpochParam.builder()
.pvtCommitteeNormal(convertObjectToBigDecimal(poolVotingThresholds.get(PVT_COMMITTEE_NORMAL)).doubleValue())
Expand All @@ -401,6 +402,10 @@ public void fetchConwayGenesis(GenesisData genesisData) {
.drepActivity(convertObjecToBigInteger(genesisConwayJsonMap.get(D_REP_ACTIVITY)))
.build();

if (committee.get(THRESHOLD) != null) {
genesisConwayProtocols.setCcThreshold(convertObjectToBigDecimal(committee.get(THRESHOLD)).doubleValue());
}

if (genesisConwayJsonMap.get(MIN_FEE_REF_SCRIPT_COST_PER_BYTE) != null) {
genesisConwayProtocols.setMinFeeRefScriptCostPerByte(convertObjectToBigDecimal(genesisConwayJsonMap.get(MIN_FEE_REF_SCRIPT_COST_PER_BYTE)).doubleValue());
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ALTER TABLE epoch_param
ADD COLUMN cc_threshold double precision;
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,9 @@ public class EpochParam extends BaseEntity {
@Column(name = "min_fee_ref_script_cost_per_byte")
private Double minFeeRefScriptCostPerByte;

@Column(name = "cc_threshold")
private Double ccThreshold;

@Override
public boolean equals(Object o) {
if (this == o) {
Expand Down Expand Up @@ -287,6 +290,6 @@ public int hashCode() {
dvtHardForkInitiation, dvtPPNetworkGroup, dvtPPEconomicGroup,
dvtPPTechnicalGroup, dvtPPGovGroup, dvtTreasuryWithdrawal,
committeeMinSize, committeeMaxTermLength, govActionLifetime,
govActionDeposit, drepDeposit, drepActivity, minFeeRefScriptCostPerByte);
govActionDeposit, drepDeposit, drepActivity, minFeeRefScriptCostPerByte, ccThreshold);
}
}
Loading