From 3e7eba8f0499fa3eb682de13fd3aa32f3aa6efa1 Mon Sep 17 00:00:00 2001 From: Manfred Karrer Date: Thu, 4 Oct 2018 23:24:14 -0500 Subject: [PATCH] Add Generic- and removeAsset proposals --- common/src/main/proto/pb.proto | 24 ++-- .../main/java/bisq/core/dao/DaoFacade.java | 25 ++++ .../main/java/bisq/core/dao/DaoModule.java | 10 ++ .../dao/governance/proposal/Proposal.java | 14 +- .../dao/governance/proposal/ProposalType.java | 6 +- .../proposal/generic/GenericProposal.java | 122 ++++++++++++++++ .../generic/GenericProposalService.java | 69 +++++++++ .../generic/GenericProposalValidator.java | 49 +++++++ .../proposal/param/ChangeParamValidator.java | 23 +-- .../removeAsset/RemoveAssetProposal.java | 133 ++++++++++++++++++ .../RemoveAssetProposalService.java | 80 +++++++++++ .../removeAsset/RemoveAssetValidator.java | 49 +++++++ .../proposal/role/BondedRoleProposal.java | 4 +- .../bisq/core/dao/state/governance/Param.java | 11 +- .../java/bisq/core/locale/CurrencyUtil.java | 9 ++ .../java/bisq/core/util/BsqFormatter.java | 22 +-- .../resources/i18n/displayStrings.properties | 20 ++- .../i18n/displayStrings_de.properties | 8 +- .../i18n/displayStrings_el.properties | 12 +- .../i18n/displayStrings_es.properties | 12 +- .../i18n/displayStrings_fa.properties | 12 +- .../i18n/displayStrings_fr.properties | 2 +- .../i18n/displayStrings_hu.properties | 12 +- .../i18n/displayStrings_pt.properties | 12 +- .../i18n/displayStrings_ro.properties | 12 +- .../i18n/displayStrings_ru.properties | 8 +- .../i18n/displayStrings_sr.properties | 12 +- .../i18n/displayStrings_th.properties | 12 +- .../i18n/displayStrings_vi.properties | 12 +- .../i18n/displayStrings_zh.properties | 12 +- .../main/dao/governance/ProposalDisplay.java | 93 ++++++++---- .../dao/governance/make/MakeProposalView.java | 43 +++--- .../governance/result/ProposalListItem.java | 19 +-- 33 files changed, 788 insertions(+), 175 deletions(-) create mode 100644 core/src/main/java/bisq/core/dao/governance/proposal/generic/GenericProposal.java create mode 100644 core/src/main/java/bisq/core/dao/governance/proposal/generic/GenericProposalService.java create mode 100644 core/src/main/java/bisq/core/dao/governance/proposal/generic/GenericProposalValidator.java create mode 100644 core/src/main/java/bisq/core/dao/governance/proposal/removeAsset/RemoveAssetProposal.java create mode 100644 core/src/main/java/bisq/core/dao/governance/proposal/removeAsset/RemoveAssetProposalService.java create mode 100644 core/src/main/java/bisq/core/dao/governance/proposal/removeAsset/RemoveAssetValidator.java diff --git a/common/src/main/proto/pb.proto b/common/src/main/proto/pb.proto index 0bb2b80c6f..56ad8660de 100644 --- a/common/src/main/proto/pb.proto +++ b/common/src/main/proto/pb.proto @@ -1470,11 +1470,11 @@ message Proposal { string tx_id = 5; oneof message { CompensationProposal compensation_proposal = 6; - GenericProposal generic_proposal = 7; - ChangeParamProposal change_param_proposal = 8; - RemoveAltcoinProposal remove_altcoin_proposal = 9; - ConfiscateBondProposal confiscate_bond_proposal = 10; - BondedRoleProposal bonded_role_proposal = 11; + ChangeParamProposal change_param_proposal = 7; + BondedRoleProposal bonded_role_proposal = 8; + ConfiscateBondProposal confiscate_bond_proposal = 9; + GenericProposal generic_proposal = 10; + RemoveAssetProposal remove_asset_proposal = 11; } } @@ -1483,24 +1483,24 @@ message CompensationProposal { string bsq_address = 2; } -message GenericProposal { -} - message ChangeParamProposal { string param = 1; // name of enum int64 param_value = 2; } -message RemoveAltcoinProposal { - string currency_code = 1; +message BondedRoleProposal { + BondedRole bonded_role = 1; } message ConfiscateBondProposal { bytes hash = 1; } -message BondedRoleProposal { - BondedRole bonded_role = 1; +message GenericProposal { +} + +message RemoveAssetProposal { + string ticker_symbol = 1; } message BondedRole { diff --git a/core/src/main/java/bisq/core/dao/DaoFacade.java b/core/src/main/java/bisq/core/dao/DaoFacade.java index 5728c31f32..e926d308e0 100644 --- a/core/src/main/java/bisq/core/dao/DaoFacade.java +++ b/core/src/main/java/bisq/core/dao/DaoFacade.java @@ -40,7 +40,9 @@ import bisq.core.dao.governance.proposal.TxException; import bisq.core.dao.governance.proposal.compensation.CompensationConsensus; import bisq.core.dao.governance.proposal.compensation.CompensationProposalService; import bisq.core.dao.governance.proposal.confiscatebond.ConfiscateBondProposalService; +import bisq.core.dao.governance.proposal.generic.GenericProposalService; import bisq.core.dao.governance.proposal.param.ChangeParamProposalService; +import bisq.core.dao.governance.proposal.removeAsset.RemoveAssetProposalService; import bisq.core.dao.governance.proposal.role.BondedRoleProposalService; import bisq.core.dao.governance.role.BondedRole; import bisq.core.dao.governance.role.BondedRolesService; @@ -79,6 +81,10 @@ import java.util.Set; import javax.annotation.Nullable; + + +import bisq.asset.Asset; + /** * Provides a facade to interact with the Dao domain. Hides complexity and domain details to clients (e.g. UI or APIs) * by providing a reduced API and/or aggregating subroutines. @@ -96,6 +102,8 @@ public class DaoFacade implements DaoSetupService { private final ChangeParamProposalService changeParamProposalService; private final ConfiscateBondProposalService confiscateBondProposalService; private final BondedRoleProposalService bondedRoleProposalService; + private final GenericProposalService genericProposalService; + private final RemoveAssetProposalService removeAssetProposalService; private final BondedRolesService bondedRolesService; private final LockupService lockupService; private final UnlockService unlockService; @@ -116,6 +124,8 @@ public class DaoFacade implements DaoSetupService { ChangeParamProposalService changeParamProposalService, ConfiscateBondProposalService confiscateBondProposalService, BondedRoleProposalService bondedRoleProposalService, + GenericProposalService genericProposalService, + RemoveAssetProposalService removeAssetProposalService, BondedRolesService bondedRolesService, LockupService lockupService, UnlockService unlockService, @@ -132,6 +142,8 @@ public class DaoFacade implements DaoSetupService { this.changeParamProposalService = changeParamProposalService; this.confiscateBondProposalService = confiscateBondProposalService; this.bondedRoleProposalService = bondedRoleProposalService; + this.genericProposalService = genericProposalService; + this.removeAssetProposalService = removeAssetProposalService; this.bondedRolesService = bondedRolesService; this.lockupService = lockupService; this.unlockService = unlockService; @@ -233,6 +245,19 @@ public class DaoFacade implements DaoSetupService { return bondedRoleProposalService.createProposalWithTransaction(bondedRole); } + public ProposalWithTransaction getGenericProposalWithTransaction(String name, + String link) + throws ValidationException, InsufficientMoneyException, TxException { + return genericProposalService.createProposalWithTransaction(name, link); + } + + public ProposalWithTransaction getRemoveAssetProposalWithTransaction(String name, + String link, + Asset asset) + throws ValidationException, InsufficientMoneyException, TxException { + return removeAssetProposalService.createProposalWithTransaction(name, link, asset); + } + public List getBondedRoleList() { return bondedRolesService.getBondedRoleList(); } diff --git a/core/src/main/java/bisq/core/dao/DaoModule.java b/core/src/main/java/bisq/core/dao/DaoModule.java index f757c65eeb..00d66f2781 100644 --- a/core/src/main/java/bisq/core/dao/DaoModule.java +++ b/core/src/main/java/bisq/core/dao/DaoModule.java @@ -37,8 +37,12 @@ import bisq.core.dao.governance.proposal.compensation.CompensationProposalServic import bisq.core.dao.governance.proposal.compensation.CompensationValidator; import bisq.core.dao.governance.proposal.confiscatebond.ConfiscateBondProposalService; import bisq.core.dao.governance.proposal.confiscatebond.ConfiscateBondValidator; +import bisq.core.dao.governance.proposal.generic.GenericProposalService; +import bisq.core.dao.governance.proposal.generic.GenericProposalValidator; import bisq.core.dao.governance.proposal.param.ChangeParamProposalService; import bisq.core.dao.governance.proposal.param.ChangeParamValidator; +import bisq.core.dao.governance.proposal.removeAsset.RemoveAssetProposalService; +import bisq.core.dao.governance.proposal.removeAsset.RemoveAssetValidator; import bisq.core.dao.governance.proposal.role.BondedRoleProposalService; import bisq.core.dao.governance.proposal.role.BondedRoleValidator; import bisq.core.dao.governance.proposal.storage.appendonly.ProposalStorageService; @@ -134,6 +138,12 @@ public class DaoModule extends AppModule { bind(ConfiscateBondValidator.class).in(Singleton.class); bind(ConfiscateBondProposalService.class).in(Singleton.class); + bind(GenericProposalValidator.class).in(Singleton.class); + bind(GenericProposalService.class).in(Singleton.class); + + bind(RemoveAssetValidator.class).in(Singleton.class); + bind(RemoveAssetProposalService.class).in(Singleton.class); + // Ballot bind(BallotListService.class).in(Singleton.class); diff --git a/core/src/main/java/bisq/core/dao/governance/proposal/Proposal.java b/core/src/main/java/bisq/core/dao/governance/proposal/Proposal.java index 501f23c137..bd73f1b0a2 100644 --- a/core/src/main/java/bisq/core/dao/governance/proposal/Proposal.java +++ b/core/src/main/java/bisq/core/dao/governance/proposal/Proposal.java @@ -20,7 +20,9 @@ package bisq.core.dao.governance.proposal; import bisq.core.dao.governance.ConsensusCritical; import bisq.core.dao.governance.proposal.compensation.CompensationProposal; import bisq.core.dao.governance.proposal.confiscatebond.ConfiscateBondProposal; +import bisq.core.dao.governance.proposal.generic.GenericProposal; import bisq.core.dao.governance.proposal.param.ChangeParamProposal; +import bisq.core.dao.governance.proposal.removeAsset.RemoveAssetProposal; import bisq.core.dao.governance.proposal.role.BondedRoleProposal; import bisq.core.dao.state.blockchain.TxType; import bisq.core.dao.state.governance.Param; @@ -91,16 +93,16 @@ public abstract class Proposal implements PersistablePayload, NetworkPayload, Co switch (proto.getMessageCase()) { case COMPENSATION_PROPOSAL: return CompensationProposal.fromProto(proto); - case GENERIC_PROPOSAL: - throw new ProtobufferRuntimeException("Not implemented yet: " + proto); case CHANGE_PARAM_PROPOSAL: return ChangeParamProposal.fromProto(proto); - case REMOVE_ALTCOIN_PROPOSAL: - throw new ProtobufferRuntimeException("Not implemented yet: " + proto); - case CONFISCATE_BOND_PROPOSAL: - return ConfiscateBondProposal.fromProto(proto); case BONDED_ROLE_PROPOSAL: return BondedRoleProposal.fromProto(proto); + case CONFISCATE_BOND_PROPOSAL: + return ConfiscateBondProposal.fromProto(proto); + case GENERIC_PROPOSAL: + return GenericProposal.fromProto(proto); + case REMOVE_ASSET_PROPOSAL: + return RemoveAssetProposal.fromProto(proto); case MESSAGE_NOT_SET: default: throw new ProtobufferRuntimeException("Unknown message case: " + proto); diff --git a/core/src/main/java/bisq/core/dao/governance/proposal/ProposalType.java b/core/src/main/java/bisq/core/dao/governance/proposal/ProposalType.java index 94422066e2..343ae773fa 100644 --- a/core/src/main/java/bisq/core/dao/governance/proposal/ProposalType.java +++ b/core/src/main/java/bisq/core/dao/governance/proposal/ProposalType.java @@ -21,11 +21,11 @@ import bisq.core.locale.Res; public enum ProposalType { COMPENSATION_REQUEST, - BONDED_ROLE, - REMOVE_ALTCOIN, CHANGE_PARAM, + BONDED_ROLE, + CONFISCATE_BOND, GENERIC, - CONFISCATE_BOND; + REMOVE_ASSET; public String getDisplayName() { return Res.get("dao.proposal.type." + name()); diff --git a/core/src/main/java/bisq/core/dao/governance/proposal/generic/GenericProposal.java b/core/src/main/java/bisq/core/dao/governance/proposal/generic/GenericProposal.java new file mode 100644 index 0000000000..706cca27cd --- /dev/null +++ b/core/src/main/java/bisq/core/dao/governance/proposal/generic/GenericProposal.java @@ -0,0 +1,122 @@ +/* + * This file is part of Bisq. + * + * Bisq is free software: you can redistribute it and/or modify it + * under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or (at + * your option) any later version. + * + * Bisq is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public + * License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with Bisq. If not, see . + */ + +package bisq.core.dao.governance.proposal.generic; + +import bisq.core.dao.governance.proposal.Proposal; +import bisq.core.dao.governance.proposal.ProposalType; +import bisq.core.dao.state.blockchain.TxType; +import bisq.core.dao.state.governance.Param; + +import bisq.common.app.Version; + +import io.bisq.generated.protobuffer.PB; + +import java.util.Date; + +import lombok.EqualsAndHashCode; +import lombok.Value; +import lombok.extern.slf4j.Slf4j; + +import javax.annotation.concurrent.Immutable; + +@Immutable +@Slf4j +@EqualsAndHashCode(callSuper = true) +@Value +public final class GenericProposal extends Proposal { + + GenericProposal(String name, + String link) { + this(name, + link, + Version.PROPOSAL, + new Date().getTime(), + ""); + } + + + /////////////////////////////////////////////////////////////////////////////////////////// + // PROTO BUFFER + /////////////////////////////////////////////////////////////////////////////////////////// + + private GenericProposal(String name, + String link, + byte version, + long creationDate, + String txId) { + super(name, + link, + version, + creationDate, + txId); + } + + @Override + public PB.Proposal.Builder getProposalBuilder() { + final PB.GenericProposal.Builder builder = PB.GenericProposal.newBuilder(); + return super.getProposalBuilder().setGenericProposal(builder); + } + + public static GenericProposal fromProto(PB.Proposal proto) { + return new GenericProposal(proto.getName(), + proto.getLink(), + (byte) proto.getVersion(), + proto.getCreationDate(), + proto.getTxId()); + } + + + /////////////////////////////////////////////////////////////////////////////////////////// + // Getters + /////////////////////////////////////////////////////////////////////////////////////////// + + @Override + public ProposalType getType() { + return ProposalType.GENERIC; + } + + @Override + public Param getQuorumParam() { + return Param.QUORUM_GENERIC; + } + + @Override + public Param getThresholdParam() { + return Param.THRESHOLD_GENERIC; + } + + @Override + public TxType getTxType() { + return TxType.PROPOSAL; + } + + @Override + public Proposal cloneProposalAndAddTxId(String txId) { + return new GenericProposal(getName(), + getLink(), + getVersion(), + getCreationDate().getTime(), + txId); + } + + @Override + public String toString() { + return "GenericProposal{" + + "\n} " + super.toString(); + } +} diff --git a/core/src/main/java/bisq/core/dao/governance/proposal/generic/GenericProposalService.java b/core/src/main/java/bisq/core/dao/governance/proposal/generic/GenericProposalService.java new file mode 100644 index 0000000000..3a9ea2d05e --- /dev/null +++ b/core/src/main/java/bisq/core/dao/governance/proposal/generic/GenericProposalService.java @@ -0,0 +1,69 @@ +/* + * This file is part of Bisq. + * + * bisq is free software: you can redistribute it and/or modify it + * under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or (at + * your option) any later version. + * + * bisq is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public + * License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with bisq. If not, see . + */ + +package bisq.core.dao.governance.proposal.generic; + +import bisq.core.btc.wallet.BsqWalletService; +import bisq.core.btc.wallet.BtcWalletService; +import bisq.core.dao.exceptions.ValidationException; +import bisq.core.dao.governance.proposal.BaseProposalService; +import bisq.core.dao.governance.proposal.ProposalConsensus; +import bisq.core.dao.governance.proposal.ProposalWithTransaction; +import bisq.core.dao.governance.proposal.TxException; +import bisq.core.dao.state.BsqStateService; + +import org.bitcoinj.core.InsufficientMoneyException; + +import javax.inject.Inject; + +import lombok.extern.slf4j.Slf4j; + +/** + * Creates GenericProposal and transaction. + */ +@Slf4j +public class GenericProposalService extends BaseProposalService { + + + /////////////////////////////////////////////////////////////////////////////////////////// + // Constructor + /////////////////////////////////////////////////////////////////////////////////////////// + + @Inject + public GenericProposalService(BsqWalletService bsqWalletService, + BtcWalletService btcWalletService, + BsqStateService bsqStateService, + ProposalConsensus proposalConsensus, + GenericProposalValidator proposalValidator) { + super(bsqWalletService, + btcWalletService, + bsqStateService, + proposalConsensus, + proposalValidator); + } + + public ProposalWithTransaction createProposalWithTransaction(String name, String link) + throws ValidationException, InsufficientMoneyException, TxException { + + return super.createProposalWithTransaction(name, link); + } + + @Override + protected GenericProposal createProposalWithoutTxId() { + return new GenericProposal(name, link); + } +} diff --git a/core/src/main/java/bisq/core/dao/governance/proposal/generic/GenericProposalValidator.java b/core/src/main/java/bisq/core/dao/governance/proposal/generic/GenericProposalValidator.java new file mode 100644 index 0000000000..0435d2782b --- /dev/null +++ b/core/src/main/java/bisq/core/dao/governance/proposal/generic/GenericProposalValidator.java @@ -0,0 +1,49 @@ +/* + * This file is part of Bisq. + * + * Bisq is free software: you can redistribute it and/or modify it + * under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or (at + * your option) any later version. + * + * Bisq is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public + * License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with Bisq. If not, see . + */ + +package bisq.core.dao.governance.proposal.generic; + +import bisq.core.dao.exceptions.ValidationException; +import bisq.core.dao.governance.proposal.Proposal; +import bisq.core.dao.governance.proposal.ProposalValidator; +import bisq.core.dao.state.BsqStateService; +import bisq.core.dao.state.period.PeriodService; + +import javax.inject.Inject; + +import lombok.extern.slf4j.Slf4j; + +@Slf4j +public class GenericProposalValidator extends ProposalValidator { + + @Inject + public GenericProposalValidator(BsqStateService bsqStateService, PeriodService periodService) { + super(bsqStateService, periodService); + } + + @Override + public void validateDataFields(Proposal proposal) throws ValidationException { + try { + super.validateDataFields(proposal); + + GenericProposal genericProposalProposal = (GenericProposal) proposal; + //TODO + } catch (Throwable throwable) { + throw new ValidationException(throwable); + } + } +} diff --git a/core/src/main/java/bisq/core/dao/governance/proposal/param/ChangeParamValidator.java b/core/src/main/java/bisq/core/dao/governance/proposal/param/ChangeParamValidator.java index 73cd33acc6..dccd3044e1 100644 --- a/core/src/main/java/bisq/core/dao/governance/proposal/param/ChangeParamValidator.java +++ b/core/src/main/java/bisq/core/dao/governance/proposal/param/ChangeParamValidator.java @@ -67,6 +67,7 @@ public class ChangeParamValidator extends ProposalValidator { switch (param) { case UNDEFINED: break; + case BSQ_MAKER_FEE_IN_PERCENT: break; case BSQ_TAKER_FEE_IN_PERCENT: @@ -75,41 +76,47 @@ public class ChangeParamValidator extends ProposalValidator { break; case BTC_TAKER_FEE_IN_PERCENT: break; + case PROPOSAL_FEE: break; case BLIND_VOTE_FEE: break; + case COMPENSATION_REQUEST_MIN_AMOUNT: if (paramValue < Restrictions.getMinNonDustOutput().value) throw new ChangeParamValidationException(Res.get("validation.amountBelowDust", Restrictions.getMinNonDustOutput().value)); - checkMinMax(param, paramValue, 100, -50); - break; case COMPENSATION_REQUEST_MAX_AMOUNT: checkMinMax(param, paramValue, 100, -50); + break; - break; - case QUORUM_PROPOSAL: - break; case QUORUM_COMP_REQUEST: break; case QUORUM_CHANGE_PARAM: break; - case QUORUM_REMOVE_ASSET: + case QUORUM_ROLE: break; case QUORUM_CONFISCATION: break; - case THRESHOLD_PROPOSAL: + case QUORUM_GENERIC: break; + case QUORUM_REMOVE_ASSET: + break; + case THRESHOLD_COMP_REQUEST: break; case THRESHOLD_CHANGE_PARAM: break; - case THRESHOLD_REMOVE_ASSET: + case THRESHOLD_ROLE: break; case THRESHOLD_CONFISCATION: break; + case THRESHOLD_GENERIC: + break; + case THRESHOLD_REMOVE_ASSET: + break; + case PHASE_UNDEFINED: break; case PHASE_PROPOSAL: diff --git a/core/src/main/java/bisq/core/dao/governance/proposal/removeAsset/RemoveAssetProposal.java b/core/src/main/java/bisq/core/dao/governance/proposal/removeAsset/RemoveAssetProposal.java new file mode 100644 index 0000000000..5f497aa022 --- /dev/null +++ b/core/src/main/java/bisq/core/dao/governance/proposal/removeAsset/RemoveAssetProposal.java @@ -0,0 +1,133 @@ +/* + * This file is part of Bisq. + * + * Bisq is free software: you can redistribute it and/or modify it + * under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or (at + * your option) any later version. + * + * Bisq is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public + * License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with Bisq. If not, see . + */ + +package bisq.core.dao.governance.proposal.removeAsset; + +import bisq.core.dao.governance.proposal.Proposal; +import bisq.core.dao.governance.proposal.ProposalType; +import bisq.core.dao.state.blockchain.TxType; +import bisq.core.dao.state.governance.Param; + +import bisq.common.app.Version; + +import io.bisq.generated.protobuffer.PB; + +import java.util.Date; + +import lombok.EqualsAndHashCode; +import lombok.Value; +import lombok.extern.slf4j.Slf4j; + +import javax.annotation.concurrent.Immutable; + +@Immutable +@Slf4j +@EqualsAndHashCode(callSuper = true) +@Value +public final class RemoveAssetProposal extends Proposal { + private final String tickerSymbol; + + RemoveAssetProposal(String name, + String link, + String tickerSymbol) { + this(name, + link, + tickerSymbol, + Version.PROPOSAL, + new Date().getTime(), + ""); + } + + + /////////////////////////////////////////////////////////////////////////////////////////// + // PROTO BUFFER + /////////////////////////////////////////////////////////////////////////////////////////// + + private RemoveAssetProposal(String name, + String link, + String tickerSymbol, + byte version, + long creationDate, + String txId) { + super(name, + link, + version, + creationDate, + txId); + + this.tickerSymbol = tickerSymbol; + } + + @Override + public PB.Proposal.Builder getProposalBuilder() { + final PB.RemoveAssetProposal.Builder builder = PB.RemoveAssetProposal.newBuilder() + .setTickerSymbol(tickerSymbol); + return super.getProposalBuilder().setRemoveAssetProposal(builder); + } + + public static RemoveAssetProposal fromProto(PB.Proposal proto) { + final PB.RemoveAssetProposal proposalProto = proto.getRemoveAssetProposal(); + return new RemoveAssetProposal(proto.getName(), + proto.getLink(), + proposalProto.getTickerSymbol(), + (byte) proto.getVersion(), + proto.getCreationDate(), + proto.getTxId()); + } + + + /////////////////////////////////////////////////////////////////////////////////////////// + // Getters + /////////////////////////////////////////////////////////////////////////////////////////// + + @Override + public ProposalType getType() { + return ProposalType.REMOVE_ASSET; + } + + @Override + public Param getQuorumParam() { + return Param.QUORUM_REMOVE_ASSET; + } + + @Override + public Param getThresholdParam() { + return Param.THRESHOLD_REMOVE_ASSET; + } + + @Override + public TxType getTxType() { + return TxType.PROPOSAL; + } + + @Override + public Proposal cloneProposalAndAddTxId(String txId) { + return new RemoveAssetProposal(getName(), + getLink(), + getTickerSymbol(), + getVersion(), + getCreationDate().getTime(), + txId); + } + + @Override + public String toString() { + return "GenericProposal{" + + "\n tickerSymbol=" + tickerSymbol + + "\n} " + super.toString(); + } +} diff --git a/core/src/main/java/bisq/core/dao/governance/proposal/removeAsset/RemoveAssetProposalService.java b/core/src/main/java/bisq/core/dao/governance/proposal/removeAsset/RemoveAssetProposalService.java new file mode 100644 index 0000000000..44289b9efb --- /dev/null +++ b/core/src/main/java/bisq/core/dao/governance/proposal/removeAsset/RemoveAssetProposalService.java @@ -0,0 +1,80 @@ +/* + * This file is part of Bisq. + * + * bisq is free software: you can redistribute it and/or modify it + * under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or (at + * your option) any later version. + * + * bisq is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public + * License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with bisq. If not, see . + */ + +package bisq.core.dao.governance.proposal.removeAsset; + +import bisq.core.btc.wallet.BsqWalletService; +import bisq.core.btc.wallet.BtcWalletService; +import bisq.core.dao.exceptions.ValidationException; +import bisq.core.dao.governance.proposal.BaseProposalService; +import bisq.core.dao.governance.proposal.ProposalConsensus; +import bisq.core.dao.governance.proposal.ProposalWithTransaction; +import bisq.core.dao.governance.proposal.TxException; +import bisq.core.dao.state.BsqStateService; + +import org.bitcoinj.core.InsufficientMoneyException; + +import javax.inject.Inject; + +import lombok.extern.slf4j.Slf4j; + + + +import bisq.asset.Asset; + +/** + * Creates RemoveAssetProposal and transaction. + */ +@Slf4j +public class RemoveAssetProposalService extends BaseProposalService { + private Asset asset; + + + /////////////////////////////////////////////////////////////////////////////////////////// + // Constructor + /////////////////////////////////////////////////////////////////////////////////////////// + + @Inject + public RemoveAssetProposalService(BsqWalletService bsqWalletService, + BtcWalletService btcWalletService, + BsqStateService bsqStateService, + ProposalConsensus proposalConsensus, + RemoveAssetValidator proposalValidator) { + super(bsqWalletService, + btcWalletService, + bsqStateService, + proposalConsensus, + proposalValidator); + } + + public ProposalWithTransaction createProposalWithTransaction(String name, + String link, + Asset asset) + throws ValidationException, InsufficientMoneyException, TxException { + this.asset = asset; + + return super.createProposalWithTransaction(name, link); + } + + @Override + protected RemoveAssetProposal createProposalWithoutTxId() { + return new RemoveAssetProposal( + name, + link, + asset.getTickerSymbol()); + } +} diff --git a/core/src/main/java/bisq/core/dao/governance/proposal/removeAsset/RemoveAssetValidator.java b/core/src/main/java/bisq/core/dao/governance/proposal/removeAsset/RemoveAssetValidator.java new file mode 100644 index 0000000000..d88e4fa2a6 --- /dev/null +++ b/core/src/main/java/bisq/core/dao/governance/proposal/removeAsset/RemoveAssetValidator.java @@ -0,0 +1,49 @@ +/* + * This file is part of Bisq. + * + * Bisq is free software: you can redistribute it and/or modify it + * under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or (at + * your option) any later version. + * + * Bisq is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public + * License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with Bisq. If not, see . + */ + +package bisq.core.dao.governance.proposal.removeAsset; + +import bisq.core.dao.exceptions.ValidationException; +import bisq.core.dao.governance.proposal.Proposal; +import bisq.core.dao.governance.proposal.ProposalValidator; +import bisq.core.dao.state.BsqStateService; +import bisq.core.dao.state.period.PeriodService; + +import javax.inject.Inject; + +import lombok.extern.slf4j.Slf4j; + +@Slf4j +public class RemoveAssetValidator extends ProposalValidator { + + @Inject + public RemoveAssetValidator(BsqStateService bsqStateService, PeriodService periodService) { + super(bsqStateService, periodService); + } + + @Override + public void validateDataFields(Proposal proposal) throws ValidationException { + try { + super.validateDataFields(proposal); + + RemoveAssetProposal removeAssetProposal = (RemoveAssetProposal) proposal; + //TODO + } catch (Throwable throwable) { + throw new ValidationException(throwable); + } + } +} diff --git a/core/src/main/java/bisq/core/dao/governance/proposal/role/BondedRoleProposal.java b/core/src/main/java/bisq/core/dao/governance/proposal/role/BondedRoleProposal.java index 1fd2dcff61..0a961b5e29 100644 --- a/core/src/main/java/bisq/core/dao/governance/proposal/role/BondedRoleProposal.java +++ b/core/src/main/java/bisq/core/dao/governance/proposal/role/BondedRoleProposal.java @@ -100,12 +100,12 @@ public final class BondedRoleProposal extends Proposal { @Override public Param getQuorumParam() { - return Param.QUORUM_PROPOSAL; + return Param.QUORUM_ROLE; } @Override public Param getThresholdParam() { - return Param.THRESHOLD_PROPOSAL; + return Param.THRESHOLD_ROLE; } @Override diff --git a/core/src/main/java/bisq/core/dao/state/governance/Param.java b/core/src/main/java/bisq/core/dao/state/governance/Param.java index 7ff4a9da0e..012f328394 100644 --- a/core/src/main/java/bisq/core/dao/state/governance/Param.java +++ b/core/src/main/java/bisq/core/dao/state/governance/Param.java @@ -59,18 +59,21 @@ public enum Param { COMPENSATION_REQUEST_MAX_AMOUNT(10_000_000), // 100 000 BSQ // Quorum for voting in BSQ stake - QUORUM_PROPOSAL(100), // 10 000 BSQ TODO change low dev value QUORUM_COMP_REQUEST(100), // 10 000 BSQ TODO change low dev value QUORUM_CHANGE_PARAM(300), // 100 000 BSQ TODO change low dev value - QUORUM_REMOVE_ASSET(400), // 10 000 BSQ TODO change low dev value + QUORUM_ROLE(500), // 10 000 BSQ TODO change low dev value QUORUM_CONFISCATION(500), // 10 000 BSQ TODO change low dev value + QUORUM_GENERIC(100), // 10 000 BSQ TODO change low dev value + QUORUM_REMOVE_ASSET(400), // 10 000 BSQ TODO change low dev value + // Threshold for voting in % with precision of 2 (e.g. 5000 -> 50.00%) - THRESHOLD_PROPOSAL(5_000), // 50% THRESHOLD_COMP_REQUEST(5_000), // 50% THRESHOLD_CHANGE_PARAM(7_500), // 75% -> that might change the THRESHOLD_CHANGE_PARAM and QUORUM_CHANGE_PARAM! - THRESHOLD_REMOVE_ASSET(5_000), // 50% + THRESHOLD_ROLE(5_000), // 50% THRESHOLD_CONFISCATION(8_500), // 85% + THRESHOLD_GENERIC(5_000), // 50% + THRESHOLD_REMOVE_ASSET(5_000), // 50% // Period phase (16 blocks atm) PHASE_UNDEFINED(0), diff --git a/core/src/main/java/bisq/core/locale/CurrencyUtil.java b/core/src/main/java/bisq/core/locale/CurrencyUtil.java index 55148efc85..1cf03e90db 100644 --- a/core/src/main/java/bisq/core/locale/CurrencyUtil.java +++ b/core/src/main/java/bisq/core/locale/CurrencyUtil.java @@ -33,6 +33,7 @@ import java.util.Optional; import java.util.Set; import java.util.stream.Collectors; +import lombok.Getter; import lombok.extern.slf4j.Slf4j; import static com.google.common.base.Preconditions.checkArgument; @@ -52,6 +53,7 @@ public class CurrencyUtil { setBaseCurrencyCode(BisqEnvironment.getBaseCurrencyNetwork().getCurrencyCode()); } + @Getter private static final AssetRegistry assetRegistry = new AssetRegistry(); private static String baseCurrencyCode = "BTC"; @@ -437,4 +439,11 @@ public class CurrencyUtil { // If we are in mainnet we need have a mainet asset defined. throw new IllegalArgumentException("We are on mainnet and we could not find an asset with network type mainnet"); } + + public static Optional findAsset(String tickerSymbol, BaseCurrencyNetwork baseCurrencyNetwork) { + return getAssetRegistry().stream() + .filter(asset -> asset.getTickerSymbol().equals(tickerSymbol)) + .filter(asset -> assetMatchesNetwork(asset, baseCurrencyNetwork)) + .findAny(); + } } diff --git a/core/src/main/java/bisq/core/util/BsqFormatter.java b/core/src/main/java/bisq/core/util/BsqFormatter.java index 93fc4e8ec0..cabbdb6570 100644 --- a/core/src/main/java/bisq/core/util/BsqFormatter.java +++ b/core/src/main/java/bisq/core/util/BsqFormatter.java @@ -135,18 +135,20 @@ public class BsqFormatter extends BSFormatter { case COMPENSATION_REQUEST_MAX_AMOUNT: return formatCoinWithCode(Coin.valueOf(value)); - case QUORUM_PROPOSAL: case QUORUM_COMP_REQUEST: case QUORUM_CHANGE_PARAM: - case QUORUM_REMOVE_ASSET: + case QUORUM_ROLE: case QUORUM_CONFISCATION: + case QUORUM_GENERIC: + case QUORUM_REMOVE_ASSET: return formatCoinWithCode(Coin.valueOf(value)); - case THRESHOLD_PROPOSAL: case THRESHOLD_COMP_REQUEST: case THRESHOLD_CHANGE_PARAM: - case THRESHOLD_REMOVE_ASSET: + case THRESHOLD_ROLE: case THRESHOLD_CONFISCATION: + case THRESHOLD_GENERIC: + case THRESHOLD_REMOVE_ASSET: return formatToPercentWithSymbol(value / 10000d); case PHASE_UNDEFINED: @@ -183,18 +185,22 @@ public class BsqFormatter extends BSFormatter { case COMPENSATION_REQUEST_MAX_AMOUNT: return parseToCoin(inputValue).value; - case QUORUM_PROPOSAL: + case QUORUM_COMP_REQUEST: case QUORUM_CHANGE_PARAM: - case QUORUM_REMOVE_ASSET: + case QUORUM_ROLE: case QUORUM_CONFISCATION: + case QUORUM_GENERIC: + case QUORUM_REMOVE_ASSET: return parseToCoin(inputValue).value; - case THRESHOLD_PROPOSAL: + case THRESHOLD_COMP_REQUEST: case THRESHOLD_CHANGE_PARAM: - case THRESHOLD_REMOVE_ASSET: + case THRESHOLD_ROLE: case THRESHOLD_CONFISCATION: + case THRESHOLD_GENERIC: + case THRESHOLD_REMOVE_ASSET: return (long) (parsePercentStringToDouble(inputValue) * 10000); case PHASE_UNDEFINED: diff --git a/core/src/main/resources/i18n/displayStrings.properties b/core/src/main/resources/i18n/displayStrings.properties index 18f132e2c3..fc8681cdfe 100644 --- a/core/src/main/resources/i18n/displayStrings.properties +++ b/core/src/main/resources/i18n/displayStrings.properties @@ -1211,26 +1211,32 @@ dao.param.COMPENSATION_REQUEST_MIN_AMOUNT=Compensation request min. BSQ amount dao.param.COMPENSATION_REQUEST_MAX_AMOUNT=Compensation request max. BSQ amount # suppress inspection "UnusedProperty" -dao.param.QUORUM_PROPOSAL=Required quorum in BSQ for proposal +dao.param.QUORUM_GENERIC=Required quorum in BSQ for generic proposal # suppress inspection "UnusedProperty" dao.param.QUORUM_COMP_REQUEST=Required quorum in BSQ for compensation request # suppress inspection "UnusedProperty" dao.param.QUORUM_CHANGE_PARAM=Required quorum in BSQ for changing a parameter # suppress inspection "UnusedProperty" -dao.param.QUORUM_REMOVE_ASSET=Required quorum in BSQ for removing an altcoin +dao.param.QUORUM_REMOVE_ASSET=Required quorum in BSQ for removing an asset # suppress inspection "UnusedProperty" dao.param.QUORUM_CONFISCATION=Required quorum in BSQ for bond confiscation +# suppress inspection "UnusedProperty" +dao.param.QUORUM_ROLE=Required quorum in BSQ for taking a bonded role + + # suppress inspection "UnusedProperty" -dao.param.THRESHOLD_PROPOSAL=Required threshold in % for proposal +dao.param.THRESHOLD_GENERIC=Required threshold in % for generic proposal # suppress inspection "UnusedProperty" dao.param.THRESHOLD_COMP_REQUEST=Required threshold in % for compensation request # suppress inspection "UnusedProperty" dao.param.THRESHOLD_CHANGE_PARAM=Required threshold in % for changing a parameter # suppress inspection "UnusedProperty" -dao.param.THRESHOLD_REMOVE_ASSET=Required threshold in % for removing an altcoin +dao.param.THRESHOLD_REMOVE_ASSET=Required threshold in % for removing an asset # suppress inspection "UnusedProperty" dao.param.THRESHOLD_CONFISCATION=Required threshold in % for bond confiscation +# suppress inspection "UnusedProperty" +dao.param.THRESHOLD_ROLE=Required threshold in % for taking a bonded role dao.param.currentValue=Current value: {0} dao.param.blocks={0} blocks @@ -1360,7 +1366,7 @@ dao.proposal.type.COMPENSATION_REQUEST=Compensation request # suppress inspection "UnusedProperty" dao.proposal.type.BONDED_ROLE=Proposal for a bonded role # suppress inspection "UnusedProperty" -dao.proposal.type.REMOVE_ALTCOIN=Proposal for removing an altcoin +dao.proposal.type.REMOVE_ASSET=Proposal for removing an asset # suppress inspection "UnusedProperty" dao.proposal.type.CHANGE_PARAM=Proposal for changing a parameter # suppress inspection "UnusedProperty" @@ -1373,7 +1379,7 @@ dao.proposal.type.short.COMPENSATION_REQUEST=Compensation request # suppress inspection "UnusedProperty" dao.proposal.type.short.BONDED_ROLE=Bonded role # suppress inspection "UnusedProperty" -dao.proposal.type.short.REMOVE_ALTCOIN=Removing an altcoin +dao.proposal.type.short.REMOVE_ASSET=Removing an altcoin # suppress inspection "UnusedProperty" dao.proposal.type.short.CHANGE_PARAM=Changing a parameter # suppress inspection "UnusedProperty" @@ -1413,6 +1419,7 @@ dao.proposal.display.proposalFee=Proposal fee: dao.proposal.display.myVote=My vote: dao.proposal.display.voteResult=Vote result summary: dao.proposal.display.bondedRoleComboBox.label=Choose bonded role type +dao.proposal.display.tickerSymbol.label=Ticker Symbol dao.proposal.table.header.proposalType=Proposal type dao.proposal.table.header.link=Link @@ -1430,6 +1437,7 @@ dao.proposal.display.paramComboBox.label=Choose parameter dao.proposal.display.paramValue=Parameter value: dao.proposal.display.confiscateBondComboBox.label=Choose bond +dao.proposal.display.assetComboBox.label=Asset to remove dao.blindVote=blind vote diff --git a/core/src/main/resources/i18n/displayStrings_de.properties b/core/src/main/resources/i18n/displayStrings_de.properties index 3b1f6c31eb..62efd22c3f 100644 --- a/core/src/main/resources/i18n/displayStrings_de.properties +++ b/core/src/main/resources/i18n/displayStrings_de.properties @@ -1065,7 +1065,7 @@ dao.param.PROPOSAL_FEE=Vorschlag-Gebühr dao.param.BLIND_VOTE_FEE=Stimm-Gebühr # suppress inspection "UnusedProperty" -dao.param.QUORUM_PROPOSAL=Benötigtes Quorum für Vorschlag +dao.param.QUORUM_GENERIC=Benötigtes Quorum für Vorschlag # suppress inspection "UnusedProperty" dao.param.QUORUM_COMP_REQUEST=Benötigtes Quorum für Entlohnungsanfrage # suppress inspection "UnusedProperty" @@ -1076,7 +1076,7 @@ dao.param.QUORUM_REMOVE_ASSET=Benötigtes Quorum um einen Altcoin zu entfernen dao.param.QUORUM_CONFISCATION=Benötigtes Quorum für Kopplung Konfiszierung # suppress inspection "UnusedProperty" -dao.param.THRESHOLD_PROPOSAL=Benötigter Schwellwert für Vorschlag +dao.param.THRESHOLD_GENERIC=Benötigter Schwellwert für Vorschlag # suppress inspection "UnusedProperty" dao.param.THRESHOLD_COMP_REQUEST=Benötigter Schwellwert für Entlohnungsanfrage # suppress inspection "UnusedProperty" @@ -1211,7 +1211,7 @@ dao.proposal.type.COMPENSATION_REQUEST=Entlohnungsanfrage # suppress inspection "UnusedProperty" dao.proposal.type.BONDED_ROLE=Vorschlag für Gekoppelte Rolle # suppress inspection "UnusedProperty" -dao.proposal.type.REMOVE_ALTCOIN=Vorschlag einen Altcoin zu entfernen +dao.proposal.type.REMOVE_ASSET=Vorschlag einen Altcoin zu entfernen # suppress inspection "UnusedProperty" dao.proposal.type.CHANGE_PARAM=Vorschlag einen Parameter zu ändern # suppress inspection "UnusedProperty" @@ -1224,7 +1224,7 @@ dao.proposal.type.short.COMPENSATION_REQUEST=Entlohnungsanfrage # suppress inspection "UnusedProperty" dao.proposal.type.short.BONDED_ROLE=Gekoppelte Rolle # suppress inspection "UnusedProperty" -dao.proposal.type.short.REMOVE_ALTCOIN=Einen Altcoin entfernen +dao.proposal.type.short.REMOVE_ASSET=Einen Altcoin entfernen # suppress inspection "UnusedProperty" dao.proposal.type.short.CHANGE_PARAM=Einen Parameter ändern # suppress inspection "UnusedProperty" diff --git a/core/src/main/resources/i18n/displayStrings_el.properties b/core/src/main/resources/i18n/displayStrings_el.properties index b310930a16..6f3ad29e31 100644 --- a/core/src/main/resources/i18n/displayStrings_el.properties +++ b/core/src/main/resources/i18n/displayStrings_el.properties @@ -1065,24 +1065,24 @@ dao.param.PROPOSAL_FEE=Proposal fee dao.param.BLIND_VOTE_FEE=Voting fee # suppress inspection "UnusedProperty" -dao.param.QUORUM_PROPOSAL=Required quorum for proposal +dao.param.QUORUM_GENERIC=Required quorum for proposal # suppress inspection "UnusedProperty" dao.param.QUORUM_COMP_REQUEST=Required quorum for compensation request # suppress inspection "UnusedProperty" dao.param.QUORUM_CHANGE_PARAM=Required quorum for changing a parameter # suppress inspection "UnusedProperty" -dao.param.QUORUM_REMOVE_ASSET=Required quorum for removing an altcoin +dao.param.QUORUM_REMOVE_ASSET=Required quorum for removing an asset # suppress inspection "UnusedProperty" dao.param.QUORUM_CONFISCATION=Required quorum for bond confiscation # suppress inspection "UnusedProperty" -dao.param.THRESHOLD_PROPOSAL=Required threshold for proposal +dao.param.THRESHOLD_GENERIC=Required threshold for proposal # suppress inspection "UnusedProperty" dao.param.THRESHOLD_COMP_REQUEST=Required threshold for compensation request # suppress inspection "UnusedProperty" dao.param.THRESHOLD_CHANGE_PARAM=Required threshold for changing a parameter # suppress inspection "UnusedProperty" -dao.param.THRESHOLD_REMOVE_ASSET=Required threshold for removing an altcoin +dao.param.THRESHOLD_REMOVE_ASSET=Required threshold for removing an asset # suppress inspection "UnusedProperty" dao.param.THRESHOLD_CONFISCATION=Required threshold for bond confiscation @@ -1211,7 +1211,7 @@ dao.proposal.type.COMPENSATION_REQUEST=Αίτημα αποζημίωσης # suppress inspection "UnusedProperty" dao.proposal.type.BONDED_ROLE=Proposal for a bonded role # suppress inspection "UnusedProperty" -dao.proposal.type.REMOVE_ALTCOIN=Πρόταση για απόσυρση εναλλακτικού νομίσματος +dao.proposal.type.REMOVE_ASSET=Πρόταση για απόσυρση εναλλακτικού νομίσματος # suppress inspection "UnusedProperty" dao.proposal.type.CHANGE_PARAM=Πρόταση για αλλαγή παραμέτρου # suppress inspection "UnusedProperty" @@ -1224,7 +1224,7 @@ dao.proposal.type.short.COMPENSATION_REQUEST=Αίτημα αποζημίωσης # suppress inspection "UnusedProperty" dao.proposal.type.short.BONDED_ROLE=Bonded role # suppress inspection "UnusedProperty" -dao.proposal.type.short.REMOVE_ALTCOIN=Removing an altcoin +dao.proposal.type.short.REMOVE_ASSET=Removing an altcoin # suppress inspection "UnusedProperty" dao.proposal.type.short.CHANGE_PARAM=Changing a parameter # suppress inspection "UnusedProperty" diff --git a/core/src/main/resources/i18n/displayStrings_es.properties b/core/src/main/resources/i18n/displayStrings_es.properties index 01f3404477..1a1bbd777d 100644 --- a/core/src/main/resources/i18n/displayStrings_es.properties +++ b/core/src/main/resources/i18n/displayStrings_es.properties @@ -1065,24 +1065,24 @@ dao.param.PROPOSAL_FEE=Proposal fee dao.param.BLIND_VOTE_FEE=Voting fee # suppress inspection "UnusedProperty" -dao.param.QUORUM_PROPOSAL=Required quorum for proposal +dao.param.QUORUM_GENERIC=Required quorum for proposal # suppress inspection "UnusedProperty" dao.param.QUORUM_COMP_REQUEST=Required quorum for compensation request # suppress inspection "UnusedProperty" dao.param.QUORUM_CHANGE_PARAM=Required quorum for changing a parameter # suppress inspection "UnusedProperty" -dao.param.QUORUM_REMOVE_ASSET=Required quorum for removing an altcoin +dao.param.QUORUM_REMOVE_ASSET=Required quorum for removing an asset # suppress inspection "UnusedProperty" dao.param.QUORUM_CONFISCATION=Required quorum for bond confiscation # suppress inspection "UnusedProperty" -dao.param.THRESHOLD_PROPOSAL=Required threshold for proposal +dao.param.THRESHOLD_GENERIC=Required threshold for proposal # suppress inspection "UnusedProperty" dao.param.THRESHOLD_COMP_REQUEST=Required threshold for compensation request # suppress inspection "UnusedProperty" dao.param.THRESHOLD_CHANGE_PARAM=Required threshold for changing a parameter # suppress inspection "UnusedProperty" -dao.param.THRESHOLD_REMOVE_ASSET=Required threshold for removing an altcoin +dao.param.THRESHOLD_REMOVE_ASSET=Required threshold for removing an asset # suppress inspection "UnusedProperty" dao.param.THRESHOLD_CONFISCATION=Required threshold for bond confiscation @@ -1211,7 +1211,7 @@ dao.proposal.type.COMPENSATION_REQUEST=Petición de compensación # suppress inspection "UnusedProperty" dao.proposal.type.BONDED_ROLE=Proposal for a bonded role # suppress inspection "UnusedProperty" -dao.proposal.type.REMOVE_ALTCOIN=Propuesta para eliminar una altcoin +dao.proposal.type.REMOVE_ASSET=Propuesta para eliminar una altcoin # suppress inspection "UnusedProperty" dao.proposal.type.CHANGE_PARAM=Propuesta para cambiar un parámetro # suppress inspection "UnusedProperty" @@ -1224,7 +1224,7 @@ dao.proposal.type.short.COMPENSATION_REQUEST=Petición de compensación # suppress inspection "UnusedProperty" dao.proposal.type.short.BONDED_ROLE=Bonded role # suppress inspection "UnusedProperty" -dao.proposal.type.short.REMOVE_ALTCOIN=Removing an altcoin +dao.proposal.type.short.REMOVE_ASSET=Removing an altcoin # suppress inspection "UnusedProperty" dao.proposal.type.short.CHANGE_PARAM=Changing a parameter # suppress inspection "UnusedProperty" diff --git a/core/src/main/resources/i18n/displayStrings_fa.properties b/core/src/main/resources/i18n/displayStrings_fa.properties index 2845d0f7b0..5107875b13 100644 --- a/core/src/main/resources/i18n/displayStrings_fa.properties +++ b/core/src/main/resources/i18n/displayStrings_fa.properties @@ -1065,24 +1065,24 @@ dao.param.PROPOSAL_FEE=Proposal fee dao.param.BLIND_VOTE_FEE=Voting fee # suppress inspection "UnusedProperty" -dao.param.QUORUM_PROPOSAL=Required quorum for proposal +dao.param.QUORUM_GENERIC=Required quorum for proposal # suppress inspection "UnusedProperty" dao.param.QUORUM_COMP_REQUEST=Required quorum for compensation request # suppress inspection "UnusedProperty" dao.param.QUORUM_CHANGE_PARAM=Required quorum for changing a parameter # suppress inspection "UnusedProperty" -dao.param.QUORUM_REMOVE_ASSET=Required quorum for removing an altcoin +dao.param.QUORUM_REMOVE_ASSET=Required quorum for removing an asset # suppress inspection "UnusedProperty" dao.param.QUORUM_CONFISCATION=Required quorum for bond confiscation # suppress inspection "UnusedProperty" -dao.param.THRESHOLD_PROPOSAL=Required threshold for proposal +dao.param.THRESHOLD_GENERIC=Required threshold for proposal # suppress inspection "UnusedProperty" dao.param.THRESHOLD_COMP_REQUEST=Required threshold for compensation request # suppress inspection "UnusedProperty" dao.param.THRESHOLD_CHANGE_PARAM=Required threshold for changing a parameter # suppress inspection "UnusedProperty" -dao.param.THRESHOLD_REMOVE_ASSET=Required threshold for removing an altcoin +dao.param.THRESHOLD_REMOVE_ASSET=Required threshold for removing an asset # suppress inspection "UnusedProperty" dao.param.THRESHOLD_CONFISCATION=Required threshold for bond confiscation @@ -1211,7 +1211,7 @@ dao.proposal.type.COMPENSATION_REQUEST=درخواست خسارت # suppress inspection "UnusedProperty" dao.proposal.type.BONDED_ROLE=Proposal for a bonded role # suppress inspection "UnusedProperty" -dao.proposal.type.REMOVE_ALTCOIN=پیشنهاد برای حذف یک آلت کوین +dao.proposal.type.REMOVE_ASSET=پیشنهاد برای حذف یک آلت کوین # suppress inspection "UnusedProperty" dao.proposal.type.CHANGE_PARAM=پیشنهاد برای تغییر یک پارامتر # suppress inspection "UnusedProperty" @@ -1224,7 +1224,7 @@ dao.proposal.type.short.COMPENSATION_REQUEST=درخواست خسارت # suppress inspection "UnusedProperty" dao.proposal.type.short.BONDED_ROLE=Bonded role # suppress inspection "UnusedProperty" -dao.proposal.type.short.REMOVE_ALTCOIN=Removing an altcoin +dao.proposal.type.short.REMOVE_ASSET=Removing an altcoin # suppress inspection "UnusedProperty" dao.proposal.type.short.CHANGE_PARAM=Changing a parameter # suppress inspection "UnusedProperty" diff --git a/core/src/main/resources/i18n/displayStrings_fr.properties b/core/src/main/resources/i18n/displayStrings_fr.properties index 1e6bc9c1e5..e9133d1707 100644 --- a/core/src/main/resources/i18n/displayStrings_fr.properties +++ b/core/src/main/resources/i18n/displayStrings_fr.properties @@ -975,7 +975,7 @@ dao.phase.short.BREAK4=Break dao.proposal.type.COMPENSATION_REQUEST=Requête de compensation dao.proposal.type.GENERIC=Generic proposal dao.proposal.type.CHANGE_PARAM=Proposal for changing a parameter -dao.proposal.type.REMOVE_ALTCOIN=Proposal for removing an altcoin +dao.proposal.type.REMOVE_ASSET=Proposal for removing an asset dao.proposal.details=Proposal details dao.proposal.selectedProposal=Selected proposal dao.proposal.active.header=Active proposals diff --git a/core/src/main/resources/i18n/displayStrings_hu.properties b/core/src/main/resources/i18n/displayStrings_hu.properties index 5b5c5930ac..55a795713e 100644 --- a/core/src/main/resources/i18n/displayStrings_hu.properties +++ b/core/src/main/resources/i18n/displayStrings_hu.properties @@ -1065,24 +1065,24 @@ dao.param.PROPOSAL_FEE=Proposal fee dao.param.BLIND_VOTE_FEE=Voting fee # suppress inspection "UnusedProperty" -dao.param.QUORUM_PROPOSAL=Required quorum for proposal +dao.param.QUORUM_GENERIC=Required quorum for proposal # suppress inspection "UnusedProperty" dao.param.QUORUM_COMP_REQUEST=Required quorum for compensation request # suppress inspection "UnusedProperty" dao.param.QUORUM_CHANGE_PARAM=Required quorum for changing a parameter # suppress inspection "UnusedProperty" -dao.param.QUORUM_REMOVE_ASSET=Required quorum for removing an altcoin +dao.param.QUORUM_REMOVE_ASSET=Required quorum for removing an asset # suppress inspection "UnusedProperty" dao.param.QUORUM_CONFISCATION=Required quorum for bond confiscation # suppress inspection "UnusedProperty" -dao.param.THRESHOLD_PROPOSAL=Required threshold for proposal +dao.param.THRESHOLD_GENERIC=Required threshold for proposal # suppress inspection "UnusedProperty" dao.param.THRESHOLD_COMP_REQUEST=Required threshold for compensation request # suppress inspection "UnusedProperty" dao.param.THRESHOLD_CHANGE_PARAM=Required threshold for changing a parameter # suppress inspection "UnusedProperty" -dao.param.THRESHOLD_REMOVE_ASSET=Required threshold for removing an altcoin +dao.param.THRESHOLD_REMOVE_ASSET=Required threshold for removing an asset # suppress inspection "UnusedProperty" dao.param.THRESHOLD_CONFISCATION=Required threshold for bond confiscation @@ -1211,7 +1211,7 @@ dao.proposal.type.COMPENSATION_REQUEST=Kártérítési kérelem # suppress inspection "UnusedProperty" dao.proposal.type.BONDED_ROLE=Proposal for a bonded role # suppress inspection "UnusedProperty" -dao.proposal.type.REMOVE_ALTCOIN=Proposal for removing an altcoin +dao.proposal.type.REMOVE_ASSET=Proposal for removing an asset # suppress inspection "UnusedProperty" dao.proposal.type.CHANGE_PARAM=Proposal for changing a parameter # suppress inspection "UnusedProperty" @@ -1224,7 +1224,7 @@ dao.proposal.type.short.COMPENSATION_REQUEST=Kártérítési kérelem # suppress inspection "UnusedProperty" dao.proposal.type.short.BONDED_ROLE=Bonded role # suppress inspection "UnusedProperty" -dao.proposal.type.short.REMOVE_ALTCOIN=Removing an altcoin +dao.proposal.type.short.REMOVE_ASSET=Removing an altcoin # suppress inspection "UnusedProperty" dao.proposal.type.short.CHANGE_PARAM=Changing a parameter # suppress inspection "UnusedProperty" diff --git a/core/src/main/resources/i18n/displayStrings_pt.properties b/core/src/main/resources/i18n/displayStrings_pt.properties index e9926a8b11..4e20c2c689 100644 --- a/core/src/main/resources/i18n/displayStrings_pt.properties +++ b/core/src/main/resources/i18n/displayStrings_pt.properties @@ -1065,24 +1065,24 @@ dao.param.PROPOSAL_FEE=Proposal fee dao.param.BLIND_VOTE_FEE=Voting fee # suppress inspection "UnusedProperty" -dao.param.QUORUM_PROPOSAL=Required quorum for proposal +dao.param.QUORUM_GENERIC=Required quorum for proposal # suppress inspection "UnusedProperty" dao.param.QUORUM_COMP_REQUEST=Required quorum for compensation request # suppress inspection "UnusedProperty" dao.param.QUORUM_CHANGE_PARAM=Required quorum for changing a parameter # suppress inspection "UnusedProperty" -dao.param.QUORUM_REMOVE_ASSET=Required quorum for removing an altcoin +dao.param.QUORUM_REMOVE_ASSET=Required quorum for removing an asset # suppress inspection "UnusedProperty" dao.param.QUORUM_CONFISCATION=Required quorum for bond confiscation # suppress inspection "UnusedProperty" -dao.param.THRESHOLD_PROPOSAL=Required threshold for proposal +dao.param.THRESHOLD_GENERIC=Required threshold for proposal # suppress inspection "UnusedProperty" dao.param.THRESHOLD_COMP_REQUEST=Required threshold for compensation request # suppress inspection "UnusedProperty" dao.param.THRESHOLD_CHANGE_PARAM=Required threshold for changing a parameter # suppress inspection "UnusedProperty" -dao.param.THRESHOLD_REMOVE_ASSET=Required threshold for removing an altcoin +dao.param.THRESHOLD_REMOVE_ASSET=Required threshold for removing an asset # suppress inspection "UnusedProperty" dao.param.THRESHOLD_CONFISCATION=Required threshold for bond confiscation @@ -1211,7 +1211,7 @@ dao.proposal.type.COMPENSATION_REQUEST=Pedido de compensação # suppress inspection "UnusedProperty" dao.proposal.type.BONDED_ROLE=Proposal for a bonded role # suppress inspection "UnusedProperty" -dao.proposal.type.REMOVE_ALTCOIN=Proposal for removing an altcoin +dao.proposal.type.REMOVE_ASSET=Proposal for removing an asset # suppress inspection "UnusedProperty" dao.proposal.type.CHANGE_PARAM=Proposal for changing a parameter # suppress inspection "UnusedProperty" @@ -1224,7 +1224,7 @@ dao.proposal.type.short.COMPENSATION_REQUEST=Pedido de compensação # suppress inspection "UnusedProperty" dao.proposal.type.short.BONDED_ROLE=Bonded role # suppress inspection "UnusedProperty" -dao.proposal.type.short.REMOVE_ALTCOIN=Removing an altcoin +dao.proposal.type.short.REMOVE_ASSET=Removing an altcoin # suppress inspection "UnusedProperty" dao.proposal.type.short.CHANGE_PARAM=Changing a parameter # suppress inspection "UnusedProperty" diff --git a/core/src/main/resources/i18n/displayStrings_ro.properties b/core/src/main/resources/i18n/displayStrings_ro.properties index a9975beb23..c4fcb2ed0c 100644 --- a/core/src/main/resources/i18n/displayStrings_ro.properties +++ b/core/src/main/resources/i18n/displayStrings_ro.properties @@ -1065,24 +1065,24 @@ dao.param.PROPOSAL_FEE=Proposal fee dao.param.BLIND_VOTE_FEE=Voting fee # suppress inspection "UnusedProperty" -dao.param.QUORUM_PROPOSAL=Required quorum for proposal +dao.param.QUORUM_GENERIC=Required quorum for proposal # suppress inspection "UnusedProperty" dao.param.QUORUM_COMP_REQUEST=Required quorum for compensation request # suppress inspection "UnusedProperty" dao.param.QUORUM_CHANGE_PARAM=Required quorum for changing a parameter # suppress inspection "UnusedProperty" -dao.param.QUORUM_REMOVE_ASSET=Required quorum for removing an altcoin +dao.param.QUORUM_REMOVE_ASSET=Required quorum for removing an asset # suppress inspection "UnusedProperty" dao.param.QUORUM_CONFISCATION=Required quorum for bond confiscation # suppress inspection "UnusedProperty" -dao.param.THRESHOLD_PROPOSAL=Required threshold for proposal +dao.param.THRESHOLD_GENERIC=Required threshold for proposal # suppress inspection "UnusedProperty" dao.param.THRESHOLD_COMP_REQUEST=Required threshold for compensation request # suppress inspection "UnusedProperty" dao.param.THRESHOLD_CHANGE_PARAM=Required threshold for changing a parameter # suppress inspection "UnusedProperty" -dao.param.THRESHOLD_REMOVE_ASSET=Required threshold for removing an altcoin +dao.param.THRESHOLD_REMOVE_ASSET=Required threshold for removing an asset # suppress inspection "UnusedProperty" dao.param.THRESHOLD_CONFISCATION=Required threshold for bond confiscation @@ -1211,7 +1211,7 @@ dao.proposal.type.COMPENSATION_REQUEST=Solicitare de despăgubire # suppress inspection "UnusedProperty" dao.proposal.type.BONDED_ROLE=Proposal for a bonded role # suppress inspection "UnusedProperty" -dao.proposal.type.REMOVE_ALTCOIN=Proposal for removing an altcoin +dao.proposal.type.REMOVE_ASSET=Proposal for removing an asset # suppress inspection "UnusedProperty" dao.proposal.type.CHANGE_PARAM=Proposal for changing a parameter # suppress inspection "UnusedProperty" @@ -1224,7 +1224,7 @@ dao.proposal.type.short.COMPENSATION_REQUEST=Solicitare de despăgubire # suppress inspection "UnusedProperty" dao.proposal.type.short.BONDED_ROLE=Bonded role # suppress inspection "UnusedProperty" -dao.proposal.type.short.REMOVE_ALTCOIN=Removing an altcoin +dao.proposal.type.short.REMOVE_ASSET=Removing an altcoin # suppress inspection "UnusedProperty" dao.proposal.type.short.CHANGE_PARAM=Changing a parameter # suppress inspection "UnusedProperty" diff --git a/core/src/main/resources/i18n/displayStrings_ru.properties b/core/src/main/resources/i18n/displayStrings_ru.properties index f28a7a2a4e..5af342f994 100644 --- a/core/src/main/resources/i18n/displayStrings_ru.properties +++ b/core/src/main/resources/i18n/displayStrings_ru.properties @@ -1065,7 +1065,7 @@ dao.param.PROPOSAL_FEE=Сбор за предложение dao.param.BLIND_VOTE_FEE=Сбор за голосование # suppress inspection "UnusedProperty" -dao.param.QUORUM_PROPOSAL=Необходимый кворум для предложения +dao.param.QUORUM_GENERIC=Необходимый кворум для предложения # suppress inspection "UnusedProperty" dao.param.QUORUM_COMP_REQUEST=Необходимый кворум для запроса компенсации # suppress inspection "UnusedProperty" @@ -1076,7 +1076,7 @@ dao.param.QUORUM_REMOVE_ASSET=Необходимый кворум для уда dao.param.QUORUM_CONFISCATION=Необходимый кворум для конфискации гарантийного депозита # suppress inspection "UnusedProperty" -dao.param.THRESHOLD_PROPOSAL=Необходимый порог для предложения +dao.param.THRESHOLD_GENERIC=Необходимый порог для предложения # suppress inspection "UnusedProperty" dao.param.THRESHOLD_COMP_REQUEST=Необходимый порог для запроса компенсации # suppress inspection "UnusedProperty" @@ -1211,7 +1211,7 @@ dao.proposal.type.COMPENSATION_REQUEST=Запрос компенсации # suppress inspection "UnusedProperty" dao.proposal.type.BONDED_ROLE=Предложение учредить обеспеченную роль # suppress inspection "UnusedProperty" -dao.proposal.type.REMOVE_ALTCOIN=Предложение удалить алткойн +dao.proposal.type.REMOVE_ASSET=Предложение удалить алткойн # suppress inspection "UnusedProperty" dao.proposal.type.CHANGE_PARAM=Предложение по изменению параметра # suppress inspection "UnusedProperty" @@ -1224,7 +1224,7 @@ dao.proposal.type.short.COMPENSATION_REQUEST=Запрос компенсации # suppress inspection "UnusedProperty" dao.proposal.type.short.BONDED_ROLE=Обеспеченная роль # suppress inspection "UnusedProperty" -dao.proposal.type.short.REMOVE_ALTCOIN=Удаление алткойна +dao.proposal.type.short.REMOVE_ASSET=Удаление алткойна # suppress inspection "UnusedProperty" dao.proposal.type.short.CHANGE_PARAM=Изменение параметра # suppress inspection "UnusedProperty" diff --git a/core/src/main/resources/i18n/displayStrings_sr.properties b/core/src/main/resources/i18n/displayStrings_sr.properties index c7412d6a3b..bb3a8f1906 100644 --- a/core/src/main/resources/i18n/displayStrings_sr.properties +++ b/core/src/main/resources/i18n/displayStrings_sr.properties @@ -1065,24 +1065,24 @@ dao.param.PROPOSAL_FEE=Proposal fee dao.param.BLIND_VOTE_FEE=Voting fee # suppress inspection "UnusedProperty" -dao.param.QUORUM_PROPOSAL=Required quorum for proposal +dao.param.QUORUM_GENERIC=Required quorum for proposal # suppress inspection "UnusedProperty" dao.param.QUORUM_COMP_REQUEST=Required quorum for compensation request # suppress inspection "UnusedProperty" dao.param.QUORUM_CHANGE_PARAM=Required quorum for changing a parameter # suppress inspection "UnusedProperty" -dao.param.QUORUM_REMOVE_ASSET=Required quorum for removing an altcoin +dao.param.QUORUM_REMOVE_ASSET=Required quorum for removing an asset # suppress inspection "UnusedProperty" dao.param.QUORUM_CONFISCATION=Required quorum for bond confiscation # suppress inspection "UnusedProperty" -dao.param.THRESHOLD_PROPOSAL=Required threshold for proposal +dao.param.THRESHOLD_GENERIC=Required threshold for proposal # suppress inspection "UnusedProperty" dao.param.THRESHOLD_COMP_REQUEST=Required threshold for compensation request # suppress inspection "UnusedProperty" dao.param.THRESHOLD_CHANGE_PARAM=Required threshold for changing a parameter # suppress inspection "UnusedProperty" -dao.param.THRESHOLD_REMOVE_ASSET=Required threshold for removing an altcoin +dao.param.THRESHOLD_REMOVE_ASSET=Required threshold for removing an asset # suppress inspection "UnusedProperty" dao.param.THRESHOLD_CONFISCATION=Required threshold for bond confiscation @@ -1211,7 +1211,7 @@ dao.proposal.type.COMPENSATION_REQUEST=Zahtev za nadoknadu # suppress inspection "UnusedProperty" dao.proposal.type.BONDED_ROLE=Proposal for a bonded role # suppress inspection "UnusedProperty" -dao.proposal.type.REMOVE_ALTCOIN=Proposal for removing an altcoin +dao.proposal.type.REMOVE_ASSET=Proposal for removing an asset # suppress inspection "UnusedProperty" dao.proposal.type.CHANGE_PARAM=Proposal for changing a parameter # suppress inspection "UnusedProperty" @@ -1224,7 +1224,7 @@ dao.proposal.type.short.COMPENSATION_REQUEST=Zahtev za nadoknadu # suppress inspection "UnusedProperty" dao.proposal.type.short.BONDED_ROLE=Bonded role # suppress inspection "UnusedProperty" -dao.proposal.type.short.REMOVE_ALTCOIN=Removing an altcoin +dao.proposal.type.short.REMOVE_ASSET=Removing an altcoin # suppress inspection "UnusedProperty" dao.proposal.type.short.CHANGE_PARAM=Changing a parameter # suppress inspection "UnusedProperty" diff --git a/core/src/main/resources/i18n/displayStrings_th.properties b/core/src/main/resources/i18n/displayStrings_th.properties index 9094f2c686..69debf2ca1 100644 --- a/core/src/main/resources/i18n/displayStrings_th.properties +++ b/core/src/main/resources/i18n/displayStrings_th.properties @@ -1065,24 +1065,24 @@ dao.param.PROPOSAL_FEE=Proposal fee dao.param.BLIND_VOTE_FEE=Voting fee # suppress inspection "UnusedProperty" -dao.param.QUORUM_PROPOSAL=Required quorum for proposal +dao.param.QUORUM_GENERIC=Required quorum for proposal # suppress inspection "UnusedProperty" dao.param.QUORUM_COMP_REQUEST=Required quorum for compensation request # suppress inspection "UnusedProperty" dao.param.QUORUM_CHANGE_PARAM=Required quorum for changing a parameter # suppress inspection "UnusedProperty" -dao.param.QUORUM_REMOVE_ASSET=Required quorum for removing an altcoin +dao.param.QUORUM_REMOVE_ASSET=Required quorum for removing an asset # suppress inspection "UnusedProperty" dao.param.QUORUM_CONFISCATION=Required quorum for bond confiscation # suppress inspection "UnusedProperty" -dao.param.THRESHOLD_PROPOSAL=Required threshold for proposal +dao.param.THRESHOLD_GENERIC=Required threshold for proposal # suppress inspection "UnusedProperty" dao.param.THRESHOLD_COMP_REQUEST=Required threshold for compensation request # suppress inspection "UnusedProperty" dao.param.THRESHOLD_CHANGE_PARAM=Required threshold for changing a parameter # suppress inspection "UnusedProperty" -dao.param.THRESHOLD_REMOVE_ASSET=Required threshold for removing an altcoin +dao.param.THRESHOLD_REMOVE_ASSET=Required threshold for removing an asset # suppress inspection "UnusedProperty" dao.param.THRESHOLD_CONFISCATION=Required threshold for bond confiscation @@ -1211,7 +1211,7 @@ dao.proposal.type.COMPENSATION_REQUEST=คำขอชดเชย # suppress inspection "UnusedProperty" dao.proposal.type.BONDED_ROLE=Proposal for a bonded role # suppress inspection "UnusedProperty" -dao.proposal.type.REMOVE_ALTCOIN=ข้อเสนอสำหรับการลบ altcoin +dao.proposal.type.REMOVE_ASSET=ข้อเสนอสำหรับการลบ altcoin # suppress inspection "UnusedProperty" dao.proposal.type.CHANGE_PARAM=ข้อเสนอสำหรับการเปลี่ยนข้อจำกัด # suppress inspection "UnusedProperty" @@ -1224,7 +1224,7 @@ dao.proposal.type.short.COMPENSATION_REQUEST=คำขอชดเชย # suppress inspection "UnusedProperty" dao.proposal.type.short.BONDED_ROLE=Bonded role # suppress inspection "UnusedProperty" -dao.proposal.type.short.REMOVE_ALTCOIN=Removing an altcoin +dao.proposal.type.short.REMOVE_ASSET=Removing an altcoin # suppress inspection "UnusedProperty" dao.proposal.type.short.CHANGE_PARAM=Changing a parameter # suppress inspection "UnusedProperty" diff --git a/core/src/main/resources/i18n/displayStrings_vi.properties b/core/src/main/resources/i18n/displayStrings_vi.properties index 29be79c8b3..6d4d11b064 100644 --- a/core/src/main/resources/i18n/displayStrings_vi.properties +++ b/core/src/main/resources/i18n/displayStrings_vi.properties @@ -1065,24 +1065,24 @@ dao.param.PROPOSAL_FEE=Proposal fee dao.param.BLIND_VOTE_FEE=Voting fee # suppress inspection "UnusedProperty" -dao.param.QUORUM_PROPOSAL=Required quorum for proposal +dao.param.QUORUM_GENERIC=Required quorum for proposal # suppress inspection "UnusedProperty" dao.param.QUORUM_COMP_REQUEST=Required quorum for compensation request # suppress inspection "UnusedProperty" dao.param.QUORUM_CHANGE_PARAM=Required quorum for changing a parameter # suppress inspection "UnusedProperty" -dao.param.QUORUM_REMOVE_ASSET=Required quorum for removing an altcoin +dao.param.QUORUM_REMOVE_ASSET=Required quorum for removing an asset # suppress inspection "UnusedProperty" dao.param.QUORUM_CONFISCATION=Required quorum for bond confiscation # suppress inspection "UnusedProperty" -dao.param.THRESHOLD_PROPOSAL=Required threshold for proposal +dao.param.THRESHOLD_GENERIC=Required threshold for proposal # suppress inspection "UnusedProperty" dao.param.THRESHOLD_COMP_REQUEST=Required threshold for compensation request # suppress inspection "UnusedProperty" dao.param.THRESHOLD_CHANGE_PARAM=Required threshold for changing a parameter # suppress inspection "UnusedProperty" -dao.param.THRESHOLD_REMOVE_ASSET=Required threshold for removing an altcoin +dao.param.THRESHOLD_REMOVE_ASSET=Required threshold for removing an asset # suppress inspection "UnusedProperty" dao.param.THRESHOLD_CONFISCATION=Required threshold for bond confiscation @@ -1211,7 +1211,7 @@ dao.proposal.type.COMPENSATION_REQUEST=Yêu cầu bồi thường # suppress inspection "UnusedProperty" dao.proposal.type.BONDED_ROLE=Proposal for a bonded role # suppress inspection "UnusedProperty" -dao.proposal.type.REMOVE_ALTCOIN=Đề xuất gỡ bỏ một altcoin +dao.proposal.type.REMOVE_ASSET=Đề xuất gỡ bỏ một altcoin # suppress inspection "UnusedProperty" dao.proposal.type.CHANGE_PARAM=Đề xuất thay đổi một thông số # suppress inspection "UnusedProperty" @@ -1224,7 +1224,7 @@ dao.proposal.type.short.COMPENSATION_REQUEST=Yêu cầu bồi thường # suppress inspection "UnusedProperty" dao.proposal.type.short.BONDED_ROLE=Bonded role # suppress inspection "UnusedProperty" -dao.proposal.type.short.REMOVE_ALTCOIN=Removing an altcoin +dao.proposal.type.short.REMOVE_ASSET=Removing an altcoin # suppress inspection "UnusedProperty" dao.proposal.type.short.CHANGE_PARAM=Changing a parameter # suppress inspection "UnusedProperty" diff --git a/core/src/main/resources/i18n/displayStrings_zh.properties b/core/src/main/resources/i18n/displayStrings_zh.properties index bce3e6284e..ead0fbb710 100644 --- a/core/src/main/resources/i18n/displayStrings_zh.properties +++ b/core/src/main/resources/i18n/displayStrings_zh.properties @@ -1065,24 +1065,24 @@ dao.param.PROPOSAL_FEE=Proposal fee dao.param.BLIND_VOTE_FEE=Voting fee # suppress inspection "UnusedProperty" -dao.param.QUORUM_PROPOSAL=Required quorum for proposal +dao.param.QUORUM_GENERIC=Required quorum for proposal # suppress inspection "UnusedProperty" dao.param.QUORUM_COMP_REQUEST=Required quorum for compensation request # suppress inspection "UnusedProperty" dao.param.QUORUM_CHANGE_PARAM=Required quorum for changing a parameter # suppress inspection "UnusedProperty" -dao.param.QUORUM_REMOVE_ASSET=Required quorum for removing an altcoin +dao.param.QUORUM_REMOVE_ASSET=Required quorum for removing an asset # suppress inspection "UnusedProperty" dao.param.QUORUM_CONFISCATION=Required quorum for bond confiscation # suppress inspection "UnusedProperty" -dao.param.THRESHOLD_PROPOSAL=Required threshold for proposal +dao.param.THRESHOLD_GENERIC=Required threshold for proposal # suppress inspection "UnusedProperty" dao.param.THRESHOLD_COMP_REQUEST=Required threshold for compensation request # suppress inspection "UnusedProperty" dao.param.THRESHOLD_CHANGE_PARAM=Required threshold for changing a parameter # suppress inspection "UnusedProperty" -dao.param.THRESHOLD_REMOVE_ASSET=Required threshold for removing an altcoin +dao.param.THRESHOLD_REMOVE_ASSET=Required threshold for removing an asset # suppress inspection "UnusedProperty" dao.param.THRESHOLD_CONFISCATION=Required threshold for bond confiscation @@ -1211,7 +1211,7 @@ dao.proposal.type.COMPENSATION_REQUEST=赔偿要求 # suppress inspection "UnusedProperty" dao.proposal.type.BONDED_ROLE=Proposal for a bonded role # suppress inspection "UnusedProperty" -dao.proposal.type.REMOVE_ALTCOIN=Proposal for removing an altcoin +dao.proposal.type.REMOVE_ASSET=Proposal for removing an asset # suppress inspection "UnusedProperty" dao.proposal.type.CHANGE_PARAM=修改参数的提议 # suppress inspection "UnusedProperty" @@ -1224,7 +1224,7 @@ dao.proposal.type.short.COMPENSATION_REQUEST=赔偿要求 # suppress inspection "UnusedProperty" dao.proposal.type.short.BONDED_ROLE=Bonded role # suppress inspection "UnusedProperty" -dao.proposal.type.short.REMOVE_ALTCOIN=Removing an altcoin +dao.proposal.type.short.REMOVE_ASSET=Removing an altcoin # suppress inspection "UnusedProperty" dao.proposal.type.short.CHANGE_PARAM=Changing a parameter # suppress inspection "UnusedProperty" diff --git a/desktop/src/main/java/bisq/desktop/main/dao/governance/ProposalDisplay.java b/desktop/src/main/java/bisq/desktop/main/dao/governance/ProposalDisplay.java index 3b3e0e1abb..4bef53b56c 100644 --- a/desktop/src/main/java/bisq/desktop/main/dao/governance/ProposalDisplay.java +++ b/desktop/src/main/java/bisq/desktop/main/dao/governance/ProposalDisplay.java @@ -26,6 +26,7 @@ import bisq.desktop.util.Layout; import bisq.desktop.util.validation.BsqAddressValidator; import bisq.desktop.util.validation.BsqValidator; +import bisq.core.btc.BaseCurrencyNetwork; import bisq.core.btc.wallet.BsqWalletService; import bisq.core.dao.DaoFacade; import bisq.core.dao.governance.ballot.Ballot; @@ -34,7 +35,9 @@ import bisq.core.dao.governance.proposal.Proposal; import bisq.core.dao.governance.proposal.ProposalType; import bisq.core.dao.governance.proposal.compensation.CompensationProposal; import bisq.core.dao.governance.proposal.confiscatebond.ConfiscateBondProposal; +import bisq.core.dao.governance.proposal.generic.GenericProposal; import bisq.core.dao.governance.proposal.param.ChangeParamProposal; +import bisq.core.dao.governance.proposal.removeAsset.RemoveAssetProposal; import bisq.core.dao.governance.proposal.role.BondedRoleProposal; import bisq.core.dao.governance.role.BondedRole; import bisq.core.dao.governance.role.BondedRoleType; @@ -42,6 +45,7 @@ import bisq.core.dao.governance.voteresult.EvaluatedProposal; import bisq.core.dao.governance.voteresult.ProposalVoteResult; import bisq.core.dao.state.blockchain.Tx; import bisq.core.dao.state.governance.Param; +import bisq.core.locale.CurrencyUtil; import bisq.core.locale.Res; import bisq.core.util.BsqFormatter; import bisq.core.util.validation.InputValidator; @@ -82,6 +86,10 @@ import javax.annotation.Nullable; import static bisq.desktop.util.FormBuilder.*; import static com.google.common.base.Preconditions.checkNotNull; + + +import bisq.asset.Asset; + @SuppressWarnings("ConstantConditions") @Slf4j public class ProposalDisplay { @@ -104,6 +112,8 @@ public class ProposalDisplay { public ComboBox confiscateBondComboBox; @Nullable public ComboBox bondedRoleTypeComboBox; + @Nullable + public ComboBox assetComboBox; @Getter private int gridRow; @@ -155,18 +165,20 @@ public class ProposalDisplay { case COMPENSATION_REQUEST: titledGroupBgRowSpan += 1; break; - case BONDED_ROLE: - break; - case REMOVE_ALTCOIN: - break; case CHANGE_PARAM: titledGroupBgRowSpan += 1; break; - case GENERIC: + case BONDED_ROLE: break; case CONFISCATE_BOND: break; + case GENERIC: + titledGroupBgRowSpan -= 1; + break; + case REMOVE_ASSET: + break; } + // at isMakeProposalScreen we show fee but no uid and txID (+1) // otherwise we don't show fee but show uid and txID (+2) if (isMakeProposalScreen) @@ -217,26 +229,6 @@ public class ProposalDisplay { bsqAddressTextField.setValidator(new BsqAddressValidator(bsqFormatter)); inputControls.add(bsqAddressTextField); break; - case BONDED_ROLE: - bondedRoleTypeComboBox = FormBuilder.addLabelComboBox(gridPane, ++gridRow, - Res.getWithCol("dao.proposal.display.bondedRoleComboBox.label")).second; - checkNotNull(bondedRoleTypeComboBox, "bondedRoleTypeComboBox must not be null"); - bondedRoleTypeComboBox.setItems(FXCollections.observableArrayList(BondedRoleType.values())); - bondedRoleTypeComboBox.setConverter(new StringConverter<>() { - @Override - public String toString(BondedRoleType bondedRoleType) { - return bondedRoleType != null ? bondedRoleType.getDisplayString() : ""; - } - - @Override - public BondedRoleType fromString(String string) { - return null; - } - }); - comboBoxes.add(bondedRoleTypeComboBox); - break; - case REMOVE_ALTCOIN: - break; case CHANGE_PARAM: checkNotNull(gridPane, "gridPane must not be null"); paramComboBox = FormBuilder.addLabelComboBox(gridPane, ++gridRow, @@ -276,7 +268,23 @@ public class ProposalDisplay { }; paramComboBox.getSelectionModel().selectedItemProperty().addListener(paramChangeListener); break; - case GENERIC: + case BONDED_ROLE: + bondedRoleTypeComboBox = FormBuilder.addLabelComboBox(gridPane, ++gridRow, + Res.getWithCol("dao.proposal.display.bondedRoleComboBox.label")).second; + checkNotNull(bondedRoleTypeComboBox, "bondedRoleTypeComboBox must not be null"); + bondedRoleTypeComboBox.setItems(FXCollections.observableArrayList(BondedRoleType.values())); + bondedRoleTypeComboBox.setConverter(new StringConverter<>() { + @Override + public String toString(BondedRoleType bondedRoleType) { + return bondedRoleType != null ? bondedRoleType.getDisplayString() : ""; + } + + @Override + public BondedRoleType fromString(String string) { + return null; + } + }); + comboBoxes.add(bondedRoleTypeComboBox); break; case CONFISCATE_BOND: confiscateBondComboBox = FormBuilder.addLabelComboBox(gridPane, ++gridRow, @@ -296,6 +304,31 @@ public class ProposalDisplay { }); comboBoxes.add(confiscateBondComboBox); break; + case GENERIC: + break; + case REMOVE_ASSET: + assetComboBox = FormBuilder.addLabelComboBox(gridPane, ++gridRow, + Res.getWithCol("dao.proposal.display.assetComboBox.label")).second; + checkNotNull(assetComboBox, "assetComboBox must not be null"); + List assetList = CurrencyUtil.getAssetRegistry().stream() + .filter(e -> !e.getTickerSymbol().equals("BSQ")) + .filter(e -> !e.getTickerSymbol().equals("BTC")) + .filter(e -> CurrencyUtil.assetMatchesNetwork(e, BaseCurrencyNetwork.BTC_MAINNET)) + .collect(Collectors.toList()); + assetComboBox.setItems(FXCollections.observableArrayList(assetList)); + assetComboBox.setConverter(new StringConverter<>() { + @Override + public String toString(Asset asset) { + return asset != null ? CurrencyUtil.getNameAndCode(asset.getTickerSymbol()) : ""; + } + + @Override + public Asset fromString(String string) { + return null; + } + }); + comboBoxes.add(assetComboBox); + break; } if (!isMakeProposalScreen) { @@ -420,12 +453,18 @@ public class ProposalDisplay { checkNotNull(bondedRoleTypeComboBox, "bondedRoleComboBox must not be null"); BondedRole bondedRole = bondedRoleProposal.getBondedRole(); bondedRoleTypeComboBox.getSelectionModel().select(bondedRole.getBondedRoleType()); - } else if (proposal instanceof ConfiscateBondProposal) { ConfiscateBondProposal confiscateBondProposal = (ConfiscateBondProposal) proposal; checkNotNull(confiscateBondComboBox, "confiscateBondComboBox must not be null"); daoFacade.getBondedRoleFromHash(confiscateBondProposal.getHash()) .ifPresent(bondedRole -> confiscateBondComboBox.getSelectionModel().select(bondedRole)); + } else if (proposal instanceof GenericProposal) { + // do nothing + } else if (proposal instanceof RemoveAssetProposal) { + RemoveAssetProposal removeAssetProposal = (RemoveAssetProposal) proposal; + checkNotNull(assetComboBox, "assetComboBox must not be null"); + CurrencyUtil.findAsset(removeAssetProposal.getTickerSymbol(), BaseCurrencyNetwork.BTC_MAINNET) + .ifPresent(asset -> assetComboBox.getSelectionModel().select(asset)); } int chainHeight; if (txIdTextField != null) { diff --git a/desktop/src/main/java/bisq/desktop/main/dao/governance/make/MakeProposalView.java b/desktop/src/main/java/bisq/desktop/main/dao/governance/make/MakeProposalView.java index caf11ca4f2..1545dc5d7d 100644 --- a/desktop/src/main/java/bisq/desktop/main/dao/governance/make/MakeProposalView.java +++ b/desktop/src/main/java/bisq/desktop/main/dao/governance/make/MakeProposalView.java @@ -43,7 +43,6 @@ import bisq.core.dao.state.blockchain.Block; import bisq.core.dao.state.governance.Param; import bisq.core.dao.state.period.DaoPhase; import bisq.core.locale.Res; -import bisq.core.provider.fee.FeeService; import bisq.core.util.BSFormatter; import bisq.core.util.BsqFormatter; @@ -71,7 +70,6 @@ import java.util.Arrays; import java.util.List; import java.util.Objects; import java.util.concurrent.atomic.AtomicBoolean; -import java.util.stream.Collectors; import javax.annotation.Nullable; @@ -79,6 +77,10 @@ import static bisq.desktop.util.FormBuilder.addButtonAfterGroup; import static bisq.desktop.util.FormBuilder.addTitledGroupBg; import static com.google.common.base.Preconditions.checkNotNull; + + +import bisq.asset.Asset; + @FxmlView public class MakeProposalView extends ActivatableView implements BsqStateListener { private final DaoFacade daoFacade; @@ -109,7 +111,6 @@ public class MakeProposalView extends ActivatableView implements BsqWalletService bsqWalletService, WalletsSetup walletsSetup, P2PService p2PService, - FeeService feeService, PhasesView phasesView, ChangeParamValidator changeParamValidator, BSFormatter btcFormatter, @@ -150,11 +151,7 @@ public class MakeProposalView extends ActivatableView implements }; alwaysVisibleGridRowIndex = gridRow + 1; - //TODO remove filter once all are implemented - List proposalTypes = Arrays.stream(ProposalType.values()) - .filter(proposalType -> proposalType != ProposalType.GENERIC && - proposalType != ProposalType.REMOVE_ALTCOIN) - .collect(Collectors.toList()); + List proposalTypes = Arrays.asList(ProposalType.values()); proposalTypeComboBox.setItems(FXCollections.observableArrayList(proposalTypes)); } @@ -269,16 +266,6 @@ public class MakeProposalView extends ActivatableView implements proposalDisplay.linkInputTextField.getText(), bsqFormatter.parseToCoin(proposalDisplay.requestedBsqTextField.getText()), proposalDisplay.bsqAddressTextField.getText()); - case BONDED_ROLE: - checkNotNull(proposalDisplay.bondedRoleTypeComboBox, - "proposalDisplay.bondedRoleTypeComboBox must not be null"); - bondedRole = new BondedRole(proposalDisplay.nameTextField.getText(), - proposalDisplay.linkInputTextField.getText(), - proposalDisplay.bondedRoleTypeComboBox.getSelectionModel().getSelectedItem()); - return daoFacade.getBondedRoleProposalWithTransaction(bondedRole); - case REMOVE_ALTCOIN: - //TODO - throw new RuntimeException("Not implemented yet"); case CHANGE_PARAM: checkNotNull(proposalDisplay.paramComboBox, "proposalDisplay.paramComboBox must no tbe null"); @@ -304,9 +291,13 @@ public class MakeProposalView extends ActivatableView implements new Popup<>().warning(e.getMessage()).show(); return null; } - case GENERIC: - //TODO - throw new RuntimeException("Not implemented yet"); + case BONDED_ROLE: + checkNotNull(proposalDisplay.bondedRoleTypeComboBox, + "proposalDisplay.bondedRoleTypeComboBox must not be null"); + bondedRole = new BondedRole(proposalDisplay.nameTextField.getText(), + proposalDisplay.linkInputTextField.getText(), + proposalDisplay.bondedRoleTypeComboBox.getSelectionModel().getSelectedItem()); + return daoFacade.getBondedRoleProposalWithTransaction(bondedRole); case CONFISCATE_BOND: checkNotNull(proposalDisplay.confiscateBondComboBox, "proposalDisplay.confiscateBondComboBox must not be null"); @@ -314,6 +305,16 @@ public class MakeProposalView extends ActivatableView implements return daoFacade.getConfiscateBondProposalWithTransaction(proposalDisplay.nameTextField.getText(), proposalDisplay.linkInputTextField.getText(), bondedRole.getHash()); + case GENERIC: + return daoFacade.getGenericProposalWithTransaction(proposalDisplay.nameTextField.getText(), + proposalDisplay.linkInputTextField.getText()); + case REMOVE_ASSET: + checkNotNull(proposalDisplay.assetComboBox, + "proposalDisplay.assetComboBox must not be null"); + Asset asset = proposalDisplay.assetComboBox.getSelectionModel().getSelectedItem(); + return daoFacade.getRemoveAssetProposalWithTransaction(proposalDisplay.nameTextField.getText(), + proposalDisplay.linkInputTextField.getText(), + asset); default: final String msg = "Undefined ProposalType " + selectedProposalType; log.error(msg); diff --git a/desktop/src/main/java/bisq/desktop/main/dao/governance/result/ProposalListItem.java b/desktop/src/main/java/bisq/desktop/main/dao/governance/result/ProposalListItem.java index ddc3795c5c..31fefbe611 100644 --- a/desktop/src/main/java/bisq/desktop/main/dao/governance/result/ProposalListItem.java +++ b/desktop/src/main/java/bisq/desktop/main/dao/governance/result/ProposalListItem.java @@ -23,9 +23,11 @@ import bisq.core.dao.governance.proposal.Proposal; import bisq.core.dao.governance.proposal.compensation.CompensationProposal; import bisq.core.dao.governance.proposal.confiscatebond.ConfiscateBondProposal; import bisq.core.dao.governance.proposal.param.ChangeParamProposal; +import bisq.core.dao.governance.proposal.removeAsset.RemoveAssetProposal; import bisq.core.dao.governance.proposal.role.BondedRoleProposal; import bisq.core.dao.governance.role.BondedRole; import bisq.core.dao.governance.voteresult.EvaluatedProposal; +import bisq.core.locale.CurrencyUtil; import bisq.core.locale.Res; import bisq.core.util.BsqFormatter; @@ -107,23 +109,22 @@ public class ProposalListItem { CompensationProposal compensationProposal = (CompensationProposal) proposal; Coin requestedBsq = evaluatedProposal.isAccepted() ? compensationProposal.getRequestedBsq() : Coin.ZERO; return bsqFormatter.formatCoinWithCode(requestedBsq); + case CHANGE_PARAM: + ChangeParamProposal changeParamProposal = (ChangeParamProposal) proposal; + return changeParamProposal.getParam().getDisplayString(); case BONDED_ROLE: BondedRoleProposal bondedRoleProposal = (BondedRoleProposal) proposal; BondedRole bondedRole = bondedRoleProposal.getBondedRole(); return Res.get("dao.bond.bondedRoleType." + bondedRole.getBondedRoleType().name()); - case REMOVE_ALTCOIN: - // TODO - return "N/A"; - case CHANGE_PARAM: - ChangeParamProposal changeParamProposal = (ChangeParamProposal) proposal; - return changeParamProposal.getParam().getDisplayString(); - case GENERIC: - // TODO - return "N/A"; case CONFISCATE_BOND: ConfiscateBondProposal confiscateBondProposal = (ConfiscateBondProposal) proposal; // TODO add info to bond return confiscateBondProposal.getTxId(); + case GENERIC: + return proposal.getName(); + case REMOVE_ASSET: + RemoveAssetProposal removeAssetProposal = (RemoveAssetProposal) proposal; + return CurrencyUtil.getNameAndCode(removeAssetProposal.getTickerSymbol()); } return "-"; }