mirror of
https://github.com/bisq-network/bisq.git
synced 2024-11-19 18:03:12 +01:00
Display changed param value at proposal time, fix #2692
This commit is contained in:
parent
abc0909ffe
commit
29c48e9548
@ -689,7 +689,11 @@ public class DaoFacade implements DaoSetupService {
|
||||
}
|
||||
|
||||
public String getParamValue(Param param) {
|
||||
return daoStateService.getParamValue(param, periodService.getChainHeight());
|
||||
return getParamValue(param, periodService.getChainHeight());
|
||||
}
|
||||
|
||||
public String getParamValue(Param param, int blockHeight) {
|
||||
return daoStateService.getParamValue(param, blockHeight);
|
||||
}
|
||||
|
||||
public void resyncDao(Runnable resultHandler) {
|
||||
|
@ -1473,6 +1473,7 @@ dao.param.BONDED_ROLE_FACTOR=Bonded role unit factor in BSQ
|
||||
dao.param.ISSUANCE_LIMIT=Issuance limit per cycle in BSQ
|
||||
|
||||
dao.param.currentValue=Current value: {0}
|
||||
dao.param.currentAndPastValue=Current value: {0} (Value when proposal was made: {1})
|
||||
dao.param.blocks={0} blocks
|
||||
|
||||
dao.results.cycle.duration.label=Duration of {0}
|
||||
|
@ -39,6 +39,7 @@ import bisq.core.dao.governance.param.Param;
|
||||
import bisq.core.dao.governance.proposal.ProposalType;
|
||||
import bisq.core.dao.governance.proposal.param.ChangeParamInputValidator;
|
||||
import bisq.core.dao.governance.proposal.param.ChangeParamValidator;
|
||||
import bisq.core.dao.state.model.blockchain.BaseTx;
|
||||
import bisq.core.dao.state.model.blockchain.Tx;
|
||||
import bisq.core.dao.state.model.governance.Ballot;
|
||||
import bisq.core.dao.state.model.governance.BondedRoleType;
|
||||
@ -542,6 +543,14 @@ public class ProposalDisplay {
|
||||
comboBoxValueTextField.setText(paramComboBox.getConverter().toString(changeParamProposal.getParam()));
|
||||
checkNotNull(paramValueTextField, "paramValueTextField must not be null");
|
||||
paramValueTextField.setText(bsqFormatter.formatParamValue(changeParamProposal.getParam(), changeParamProposal.getParamValue()));
|
||||
String currentValue = bsqFormatter.formatParamValue(changeParamProposal.getParam(),
|
||||
daoFacade.getParamValue(changeParamProposal.getParam()));
|
||||
int height = daoFacade.getTx(changeParamProposal.getTxId())
|
||||
.map(BaseTx::getBlockHeight)
|
||||
.orElse(1);
|
||||
String valueAtProposal = bsqFormatter.formatParamValue(changeParamProposal.getParam(),
|
||||
daoFacade.getParamValue(changeParamProposal.getParam(), height));
|
||||
paramValueTextField.setPromptText(Res.get("dao.param.currentAndPastValue", currentValue, valueAtProposal));
|
||||
} else if (proposal instanceof RoleProposal) {
|
||||
RoleProposal roleProposal = (RoleProposal) proposal;
|
||||
checkNotNull(bondedRoleTypeComboBox, "bondedRoleComboBox must not be null");
|
||||
|
Loading…
Reference in New Issue
Block a user