From 6b0a54bb0e345ca0ef174ef667608e54d532ebcb Mon Sep 17 00:00:00 2001 From: Manfred Karrer Date: Wed, 24 Oct 2018 12:30:18 -0500 Subject: [PATCH 1/9] Add support for reimbursement requests --- .../main/java/bisq/common/app/Version.java | 1 + common/src/main/proto/pb.proto | 47 +++--- .../core/btc/wallet/BtcWalletService.java | 50 +++--- .../main/java/bisq/core/dao/DaoFacade.java | 36 +++- .../main/java/bisq/core/dao/DaoModule.java | 5 + .../blindvote/MyBlindVoteListService.java | 7 +- .../dao/governance/merit/MeritConsensus.java | 9 +- .../governance/proposal/IssuanceProposal.java | 31 ++++ .../dao/governance/proposal/Proposal.java | 3 + .../dao/governance/proposal/ProposalType.java | 1 + .../proposal/ProposalValidator.java | 8 +- .../compensation/CompensationProposal.java | 3 +- .../proposal/param/ChangeParamValidator.java | 6 + .../reimbursement/ReimbursementConsensus.java | 37 ++++ .../reimbursement/ReimbursementProposal.java | 159 ++++++++++++++++++ .../ReimbursementProposalService.java | 99 +++++++++++ .../reimbursement/ReimbursementValidator.java | 65 +++++++ .../voteresult/VoteResultService.java | 6 +- .../voteresult/issuance/IssuanceService.java | 36 ++-- .../core/dao/node/json/JsonTxOutputType.java | 1 + .../bisq/core/dao/node/json/JsonTxType.java | 1 + .../core/dao/node/parser/OpReturnParser.java | 5 + .../core/dao/node/parser/TxInputParser.java | 1 + .../core/dao/node/parser/TxOutputParser.java | 5 +- .../bisq/core/dao/node/parser/TxParser.java | 16 +- .../bisq/core/dao/state/DaoStateService.java | 32 +++- .../dao/state/blockchain/OpReturnType.java | 7 +- .../dao/state/blockchain/TxOutputType.java | 1 + .../core/dao/state/blockchain/TxType.java | 1 + .../core/dao/state/governance/Issuance.java | 16 +- .../dao/state/governance/IssuanceType.java | 24 +++ .../bisq/core/dao/state/governance/Param.java | 4 + .../java/bisq/core/util/BsqFormatter.java | 8 + .../resources/i18n/displayStrings.properties | 30 +++- .../i18n/displayStrings_de.properties | 6 +- .../i18n/displayStrings_el.properties | 6 +- .../i18n/displayStrings_es.properties | 6 +- .../i18n/displayStrings_fa.properties | 6 +- .../i18n/displayStrings_fr.properties | 6 +- .../i18n/displayStrings_hu.properties | 6 +- .../i18n/displayStrings_pt.properties | 6 +- .../i18n/displayStrings_ro.properties | 6 +- .../i18n/displayStrings_ru.properties | 6 +- .../i18n/displayStrings_sr.properties | 6 +- .../i18n/displayStrings_th.properties | 6 +- .../i18n/displayStrings_vi.properties | 6 +- .../i18n/displayStrings_zh.properties | 6 +- .../main/dao/governance/ProposalDisplay.java | 21 ++- .../dao/governance/make/MakeProposalView.java | 6 + .../dao/governance/result/CycleListItem.java | 6 +- .../governance/result/ProposalListItem.java | 5 + .../wallet/dashboard/BsqDashboardView.java | 22 ++- .../desktop/main/dao/wallet/tx/BsqTxView.java | 31 +++- .../transactions/TransactionsListItem.java | 13 +- 54 files changed, 785 insertions(+), 158 deletions(-) create mode 100644 core/src/main/java/bisq/core/dao/governance/proposal/IssuanceProposal.java create mode 100644 core/src/main/java/bisq/core/dao/governance/proposal/reimbursement/ReimbursementConsensus.java create mode 100644 core/src/main/java/bisq/core/dao/governance/proposal/reimbursement/ReimbursementProposal.java create mode 100644 core/src/main/java/bisq/core/dao/governance/proposal/reimbursement/ReimbursementProposalService.java create mode 100644 core/src/main/java/bisq/core/dao/governance/proposal/reimbursement/ReimbursementValidator.java create mode 100644 core/src/main/java/bisq/core/dao/state/governance/IssuanceType.java diff --git a/common/src/main/java/bisq/common/app/Version.java b/common/src/main/java/bisq/common/app/Version.java index c2ed207f85..22fbaa81db 100644 --- a/common/src/main/java/bisq/common/app/Version.java +++ b/common/src/main/java/bisq/common/app/Version.java @@ -120,6 +120,7 @@ public class Version { //TODO move to consensus area public static final byte COMPENSATION_REQUEST = (byte) 0x01; + public static final byte REIMBURSEMENT_REQUEST = (byte) 0x01; public static final byte PROPOSAL = (byte) 0x01; public static final byte BLIND_VOTE = (byte) 0x01; public static final byte VOTE_REVEAL = (byte) 0x01; diff --git a/common/src/main/proto/pb.proto b/common/src/main/proto/pb.proto index 61424dc4bd..7dd00d0554 100644 --- a/common/src/main/proto/pb.proto +++ b/common/src/main/proto/pb.proto @@ -1360,10 +1360,11 @@ enum TxType { PAY_TRADE_FEE = 6; PROPOSAL = 7; COMPENSATION_REQUEST = 8; - BLIND_VOTE = 9; - VOTE_REVEAL = 10; - LOCKUP = 11; - UNLOCK = 12; + REIMBURSEMENT_REQUEST = 9; + BLIND_VOTE = 10; + VOTE_REVEAL = 11; + LOCKUP = 12; + UNLOCK = 13; } message TxInput { @@ -1403,16 +1404,17 @@ enum TxOutputType { BTC_OUTPUT = 4; PROPOSAL_OP_RETURN_OUTPUT = 5; COMP_REQ_OP_RETURN_OUTPUT = 6; - CONFISCATE_BOND_OP_RETURN_OUTPUT = 7; - ISSUANCE_CANDIDATE_OUTPUT = 8; - BLIND_VOTE_LOCK_STAKE_OUTPUT = 9; - BLIND_VOTE_OP_RETURN_OUTPUT = 10; - VOTE_REVEAL_UNLOCK_STAKE_OUTPUT = 11; - VOTE_REVEAL_OP_RETURN_OUTPUT = 12; - LOCKUP_OUTPUT = 13; - LOCKUP_OP_RETURN_OUTPUT = 14; - UNLOCK_OUTPUT = 15; - INVALID_OUTPUT = 16; + REIMBURSEMENT_OP_RETURN_OUTPUT = 7; + CONFISCATE_BOND_OP_RETURN_OUTPUT = 8; + ISSUANCE_CANDIDATE_OUTPUT = 9; + BLIND_VOTE_LOCK_STAKE_OUTPUT = 10; + BLIND_VOTE_OP_RETURN_OUTPUT = 11; + VOTE_REVEAL_UNLOCK_STAKE_OUTPUT = 12; + VOTE_REVEAL_OP_RETURN_OUTPUT = 13; + LOCKUP_OUTPUT = 14; + LOCKUP_OP_RETURN_OUTPUT = 15; + UNLOCK_OUTPUT = 16; + INVALID_OUTPUT = 17; } message SpentInfo { @@ -1474,6 +1476,7 @@ message Issuance { int32 chain_height = 2; int64 amount = 3; string pub_key = 4; + string issuance_type = 5; } message Proposal { @@ -1484,11 +1487,12 @@ message Proposal { string tx_id = 5; oneof message { CompensationProposal compensation_proposal = 6; - ChangeParamProposal change_param_proposal = 7; - BondedRoleProposal bonded_role_proposal = 8; - ConfiscateBondProposal confiscate_bond_proposal = 9; - GenericProposal generic_proposal = 10; - RemoveAssetProposal remove_asset_proposal = 11; + ReimbursementProposal reimbursement_proposal = 7; + ChangeParamProposal change_param_proposal = 8; + BondedRoleProposal bonded_role_proposal = 9; + ConfiscateBondProposal confiscate_bond_proposal = 10; + GenericProposal generic_proposal = 11; + RemoveAssetProposal remove_asset_proposal = 12; } } @@ -1497,6 +1501,11 @@ message CompensationProposal { string bsq_address = 2; } +message ReimbursementProposal { + int64 requested_bsq = 1; + string bsq_address = 2; +} + message ChangeParamProposal { string param = 1; // name of enum int64 param_value = 2; diff --git a/core/src/main/java/bisq/core/btc/wallet/BtcWalletService.java b/core/src/main/java/bisq/core/btc/wallet/BtcWalletService.java index b58901d8d7..145efee40e 100644 --- a/core/src/main/java/bisq/core/btc/wallet/BtcWalletService.java +++ b/core/src/main/java/bisq/core/btc/wallet/BtcWalletService.java @@ -146,11 +146,28 @@ public class BtcWalletService extends WalletService { /////////////////////////////////////////////////////////////////////////////////////////// - // CompensationRequest tx + // Proposal txs /////////////////////////////////////////////////////////////////////////////////////////// - public Transaction completePreparedCompensationRequestTx(Coin issuanceAmount, Address issuanceAddress, Transaction feeTx, byte[] opReturnData) throws - TransactionVerificationException, WalletException, InsufficientMoneyException { + + public Transaction completePreparedProposalTx(Transaction preparedBurnFeeTx, byte[] opReturnData) + throws WalletException, InsufficientMoneyException, TransactionVerificationException { + return completePreparedProposalTx(preparedBurnFeeTx, opReturnData, null, null); + } + + public Transaction completePreparedReimbursementRequestTx(Coin issuanceAmount, Address issuanceAddress, Transaction feeTx, byte[] opReturnData) + throws TransactionVerificationException, WalletException, InsufficientMoneyException { + return completePreparedProposalTx(feeTx, opReturnData, issuanceAmount, issuanceAddress); + } + + public Transaction completePreparedCompensationRequestTx(Coin issuanceAmount, Address issuanceAddress, Transaction feeTx, byte[] opReturnData) + throws TransactionVerificationException, WalletException, InsufficientMoneyException { + return completePreparedProposalTx(feeTx, opReturnData, issuanceAmount, issuanceAddress); + } + + private Transaction completePreparedProposalTx(Transaction feeTx, byte[] opReturnData, + @Nullable Coin issuanceAmount, @Nullable Address issuanceAddress) + throws TransactionVerificationException, WalletException, InsufficientMoneyException { // (BsqFee)tx has following structure: // inputs [1-n] BSQ inputs (fee) @@ -160,7 +177,7 @@ public class BtcWalletService extends WalletService { // inputs [1-n] BSQ inputs for request fee // inputs [1-n] BTC inputs for BSQ issuance and miner fee // outputs [1] Mandatory BSQ request fee change output (>= 546 Satoshi) - // outputs [1] Potentially BSQ issuance output (>= 546 Satoshi) + // outputs [1] Potentially BSQ issuance output (>= 546 Satoshi) - in case of a issuance tx, otherwise that output does not exist // outputs [0-1] BTC change output from issuance and miner fee inputs (>= 546 Satoshi) // outputs [1] OP_RETURN with opReturnData and amount 0 // mining fee: BTC mining fee + burned BSQ fee @@ -174,9 +191,11 @@ public class BtcWalletService extends WalletService { // BSQ change outputs from BSQ fee inputs. feeTx.getOutputs().forEach(preparedTx::addOutput); - // BSQ issuance output - preparedTx.addOutput(issuanceAmount, issuanceAddress); - + // + if (issuanceAmount != null && issuanceAddress != null) { + // BSQ issuance output + preparedTx.addOutput(issuanceAmount, issuanceAddress); + } // safety check counter to avoid endless loops int counter = 0; @@ -204,8 +223,8 @@ public class BtcWalletService extends WalletService { } Transaction tx = new Transaction(params); - preparedBsqTxInputs.stream().forEach(tx::addInput); - preparedBsqTxOutputs.stream().forEach(tx::addOutput); + preparedBsqTxInputs.forEach(tx::addInput); + preparedBsqTxOutputs.forEach(tx::addOutput); SendRequest sendRequest = SendRequest.forTx(tx); sendRequest.shuffleOutputs = false; @@ -228,7 +247,7 @@ public class BtcWalletService extends WalletService { numInputs = resultTx.getInputs().size(); txSizeWithUnsignedInputs = resultTx.bitcoinSerialize().length; - final long estimatedFeeAsLong = txFeePerByte.multiply(txSizeWithUnsignedInputs + sigSizePerInput * numInputs).value; + long estimatedFeeAsLong = txFeePerByte.multiply(txSizeWithUnsignedInputs + sigSizePerInput * numInputs).value; // calculated fee must be inside of a tolerance range with tx fee isFeeOutsideTolerance = Math.abs(resultTx.getFee().value - estimatedFeeAsLong) > 1000; } @@ -244,17 +263,6 @@ public class BtcWalletService extends WalletService { return resultTx; } - //TODO Similar like completePreparedCompensationRequestTx but without second output for BSQ issuance - public Transaction completePreparedProposalTx(Transaction preparedBurnFeeTx, byte[] opReturnData) { - try { - //TODO dummy - return completePreparedCompensationRequestTx(Coin.valueOf(10000), getFreshAddressEntry().getAddress(), - preparedBurnFeeTx, opReturnData); - } catch (TransactionVerificationException | InsufficientMoneyException | WalletException e) { - e.printStackTrace(); - } - throw new RuntimeException("completePreparedGenericProposalTx not implemented yet."); - } /////////////////////////////////////////////////////////////////////////////////////////// // Blind vote tx diff --git a/core/src/main/java/bisq/core/dao/DaoFacade.java b/core/src/main/java/bisq/core/dao/DaoFacade.java index 59feb84d4d..7424b4cf56 100644 --- a/core/src/main/java/bisq/core/dao/DaoFacade.java +++ b/core/src/main/java/bisq/core/dao/DaoFacade.java @@ -42,6 +42,8 @@ import bisq.core.dao.governance.proposal.compensation.CompensationProposalServic 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.reimbursement.ReimbursementConsensus; +import bisq.core.dao.governance.proposal.reimbursement.ReimbursementProposalService; import bisq.core.dao.governance.proposal.removeAsset.RemoveAssetProposalService; import bisq.core.dao.governance.proposal.role.BondedRoleProposalService; import bisq.core.dao.governance.role.BondedRole; @@ -54,7 +56,7 @@ import bisq.core.dao.state.blockchain.Tx; import bisq.core.dao.state.blockchain.TxOutput; import bisq.core.dao.state.blockchain.TxOutputKey; import bisq.core.dao.state.blockchain.TxType; -import bisq.core.dao.state.governance.Issuance; +import bisq.core.dao.state.governance.IssuanceType; import bisq.core.dao.state.governance.Param; import bisq.core.dao.state.period.DaoPhase; import bisq.core.dao.state.period.PeriodService; @@ -104,6 +106,7 @@ public class DaoFacade implements DaoSetupService { private final MyBlindVoteListService myBlindVoteListService; private final MyVoteListService myVoteListService; private final CompensationProposalService compensationProposalService; + private final ReimbursementProposalService reimbursementProposalService; private final ChangeParamProposalService changeParamProposalService; private final ConfiscateBondProposalService confiscateBondProposalService; private final BondedRoleProposalService bondedRoleProposalService; @@ -126,6 +129,7 @@ public class DaoFacade implements DaoSetupService { MyBlindVoteListService myBlindVoteListService, MyVoteListService myVoteListService, CompensationProposalService compensationProposalService, + ReimbursementProposalService reimbursementProposalService, ChangeParamProposalService changeParamProposalService, ConfiscateBondProposalService confiscateBondProposalService, BondedRoleProposalService bondedRoleProposalService, @@ -144,6 +148,7 @@ public class DaoFacade implements DaoSetupService { this.myBlindVoteListService = myBlindVoteListService; this.myVoteListService = myVoteListService; this.compensationProposalService = compensationProposalService; + this.reimbursementProposalService = reimbursementProposalService; this.changeParamProposalService = changeParamProposalService; this.confiscateBondProposalService = confiscateBondProposalService; this.bondedRoleProposalService = bondedRoleProposalService; @@ -223,6 +228,15 @@ public class DaoFacade implements DaoSetupService { requestedBsq); } + public ProposalWithTransaction getReimbursementProposalWithTransaction(String name, + String link, + Coin requestedBsq) + throws ValidationException, InsufficientMoneyException, TxException { + return reimbursementProposalService.createProposalWithTransaction(name, + link, + requestedBsq); + } + public ProposalWithTransaction getParamProposalWithTransaction(String name, String link, Param param, @@ -517,8 +531,8 @@ public class DaoFacade implements DaoSetupService { return daoStateService.getGenesisTotalSupply(); } - public Set getIssuanceSet() { - return daoStateService.getIssuanceSet(); + public int getNumIssuanceTransactions(IssuanceType issuanceType) { + return daoStateService.getIssuanceSet(issuanceType).size(); } public Set getFeeTxs() { @@ -541,8 +555,8 @@ public class DaoFacade implements DaoSetupService { return daoStateService.getTotalBurntFee(); } - public long getTotalIssuedAmountFromCompRequests() { - return daoStateService.getTotalIssuedAmount(); + public long getTotalIssuedAmount(IssuanceType issuanceType) { + return daoStateService.getTotalIssuedAmount(issuanceType); } public long getBlockTime(int issuanceBlockHeight) { @@ -553,8 +567,8 @@ public class DaoFacade implements DaoSetupService { return daoStateService.getIssuanceBlockHeight(txId); } - public boolean isIssuanceTx(String txId) { - return daoStateService.isIssuanceTx(txId); + public boolean isIssuanceTx(String txId, IssuanceType issuanceType) { + return daoStateService.isIssuanceTx(txId, issuanceType); } public boolean hasTxBurntFee(String hashAsString) { @@ -605,6 +619,14 @@ public class DaoFacade implements DaoSetupService { return CompensationConsensus.getMaxCompensationRequestAmount(daoStateService, periodService.getChainHeight()); } + public Coin getMinReimbursementRequestAmount() { + return ReimbursementConsensus.getMinReimbursementRequestAmount(daoStateService, periodService.getChainHeight()); + } + + public Coin getMaxReimbursementRequestAmount() { + return ReimbursementConsensus.getMaxReimbursementRequestAmount(daoStateService, periodService.getChainHeight()); + } + public long getPramValue(Param param) { return daoStateService.getParamValue(param, periodService.getChainHeight()); } diff --git a/core/src/main/java/bisq/core/dao/DaoModule.java b/core/src/main/java/bisq/core/dao/DaoModule.java index d11d2cfee0..fd0b29b724 100644 --- a/core/src/main/java/bisq/core/dao/DaoModule.java +++ b/core/src/main/java/bisq/core/dao/DaoModule.java @@ -41,6 +41,8 @@ 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.reimbursement.ReimbursementProposalService; +import bisq.core.dao.governance.proposal.reimbursement.ReimbursementValidator; import bisq.core.dao.governance.proposal.removeAsset.RemoveAssetProposalService; import bisq.core.dao.governance.proposal.removeAsset.RemoveAssetValidator; import bisq.core.dao.governance.proposal.role.BondedRoleProposalService; @@ -131,6 +133,9 @@ public class DaoModule extends AppModule { bind(CompensationValidator.class).in(Singleton.class); bind(CompensationProposalService.class).in(Singleton.class); + bind(ReimbursementValidator.class).in(Singleton.class); + bind(ReimbursementProposalService.class).in(Singleton.class); + bind(ChangeParamValidator.class).in(Singleton.class); bind(ChangeParamProposalService.class).in(Singleton.class); diff --git a/core/src/main/java/bisq/core/dao/governance/blindvote/MyBlindVoteListService.java b/core/src/main/java/bisq/core/dao/governance/blindvote/MyBlindVoteListService.java index 8fdb461186..f8bbf4e937 100644 --- a/core/src/main/java/bisq/core/dao/governance/blindvote/MyBlindVoteListService.java +++ b/core/src/main/java/bisq/core/dao/governance/blindvote/MyBlindVoteListService.java @@ -41,6 +41,7 @@ import bisq.core.dao.governance.proposal.compensation.CompensationProposal; import bisq.core.dao.state.DaoStateListener; import bisq.core.dao.state.DaoStateService; import bisq.core.dao.state.blockchain.Block; +import bisq.core.dao.state.governance.IssuanceType; import bisq.core.dao.state.period.DaoPhase; import bisq.core.dao.state.period.PeriodService; @@ -83,6 +84,8 @@ import lombok.extern.slf4j.Slf4j; import javax.annotation.Nullable; +import static com.google.common.base.Preconditions.checkArgument; + /** * Publishes blind vote tx and blind vote payload to p2p network. * Maintains myBlindVoteList for own blind votes. Triggers republishing of my blind votes at startup during blind @@ -278,8 +281,10 @@ public class MyBlindVoteListService implements PersistedDataHost, DaoStateListen .filter(txId -> periodService.isTxInPastCycle(txId, periodService.getChainHeight())) .collect(Collectors.toSet()); - return new MeritList(daoStateService.getIssuanceSet().stream() + return new MeritList(daoStateService.getIssuanceSet(IssuanceType.COMPENSATION).stream() .map(issuance -> { + checkArgument(issuance.getIssuanceType() == IssuanceType.COMPENSATION, + "IssuanceType must be COMPENSATION for MeritList"); // We check if it is our proposal if (!myCompensationProposalTxIs.contains(issuance.getTxId())) return null; diff --git a/core/src/main/java/bisq/core/dao/governance/merit/MeritConsensus.java b/core/src/main/java/bisq/core/dao/governance/merit/MeritConsensus.java index c0a22b3761..1e2cf06b3f 100644 --- a/core/src/main/java/bisq/core/dao/governance/merit/MeritConsensus.java +++ b/core/src/main/java/bisq/core/dao/governance/merit/MeritConsensus.java @@ -21,6 +21,7 @@ import bisq.core.dao.governance.voteresult.VoteResultException; import bisq.core.dao.state.DaoStateService; import bisq.core.dao.state.blockchain.Tx; import bisq.core.dao.state.governance.Issuance; +import bisq.core.dao.state.governance.IssuanceType; import bisq.common.crypto.Encryption; import bisq.common.util.Utilities; @@ -68,8 +69,11 @@ public class MeritConsensus { .filter(merit -> isSignatureValid(merit.getSignature(), merit.getIssuance().getPubKey(), blindVoteTxId)) .mapToLong(merit -> { try { - return getWeightedMeritAmount(merit.getIssuance().getAmount(), - merit.getIssuance().getChainHeight(), + Issuance issuance = merit.getIssuance(); + checkArgument(issuance.getIssuanceType() == IssuanceType.COMPENSATION, + "issuance must be of type COMPENSATION"); + return getWeightedMeritAmount(issuance.getAmount(), + issuance.getChainHeight(), txChainHeight, BLOCKS_PER_YEAR); } catch (Throwable t) { @@ -148,6 +152,7 @@ public class MeritConsensus { .mapToLong(merit -> { try { Issuance issuance = merit.getIssuance(); + checkArgument(issuance.getIssuanceType() == IssuanceType.COMPENSATION, "issuance must be of type COMPENSATION"); int issuanceHeight = issuance.getChainHeight(); checkArgument(issuanceHeight <= currentChainHeight, "issuanceHeight must not be larger as currentChainHeight"); diff --git a/core/src/main/java/bisq/core/dao/governance/proposal/IssuanceProposal.java b/core/src/main/java/bisq/core/dao/governance/proposal/IssuanceProposal.java new file mode 100644 index 0000000000..a466b99965 --- /dev/null +++ b/core/src/main/java/bisq/core/dao/governance/proposal/IssuanceProposal.java @@ -0,0 +1,31 @@ +/* + * 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; + +import org.bitcoinj.core.Coin; + +/** + * Marker interface for proposals which can lead to new BSQ issuance + */ +public interface IssuanceProposal { + Coin getRequestedBsq(); + + String getBsqAddress(); + + String getTxId(); +} 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 bd73f1b0a2..dcc61b6788 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 @@ -22,6 +22,7 @@ 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.reimbursement.ReimbursementProposal; import bisq.core.dao.governance.proposal.removeAsset.RemoveAssetProposal; import bisq.core.dao.governance.proposal.role.BondedRoleProposal; import bisq.core.dao.state.blockchain.TxType; @@ -93,6 +94,8 @@ public abstract class Proposal implements PersistablePayload, NetworkPayload, Co switch (proto.getMessageCase()) { case COMPENSATION_PROPOSAL: return CompensationProposal.fromProto(proto); + case REIMBURSEMENT_PROPOSAL: + return ReimbursementProposal.fromProto(proto); case CHANGE_PARAM_PROPOSAL: return ChangeParamProposal.fromProto(proto); case BONDED_ROLE_PROPOSAL: 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 343ae773fa..0348fe6635 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,6 +21,7 @@ import bisq.core.locale.Res; public enum ProposalType { COMPENSATION_REQUEST, + REIMBURSEMENT_REQUEST, CHANGE_PARAM, BONDED_ROLE, CONFISCATE_BOND, diff --git a/core/src/main/java/bisq/core/dao/governance/proposal/ProposalValidator.java b/core/src/main/java/bisq/core/dao/governance/proposal/ProposalValidator.java index 478d862373..4325362cd0 100644 --- a/core/src/main/java/bisq/core/dao/governance/proposal/ProposalValidator.java +++ b/core/src/main/java/bisq/core/dao/governance/proposal/ProposalValidator.java @@ -19,6 +19,7 @@ package bisq.core.dao.governance.proposal; import bisq.core.dao.exceptions.ValidationException; import bisq.core.dao.governance.proposal.compensation.CompensationProposal; +import bisq.core.dao.governance.proposal.reimbursement.ReimbursementProposal; import bisq.core.dao.state.DaoStateService; import bisq.core.dao.state.blockchain.Tx; import bisq.core.dao.state.blockchain.TxType; @@ -112,7 +113,12 @@ public class ProposalValidator { } if (proposal instanceof CompensationProposal) { if (optionalTx.get().getTxType() != TxType.COMPENSATION_REQUEST) { - log.error("TxType is not PROPOSAL. proposal.getTxId()={}", proposal.getTxId()); + log.error("TxType is not a COMPENSATION_REQUEST. proposal.getTxId()={}", proposal.getTxId()); + return false; + } + } else if (proposal instanceof ReimbursementProposal) { + if (optionalTx.get().getTxType() != TxType.REIMBURSEMENT_REQUEST) { + log.error("TxType is not a REIMBURSEMENT_REQUEST. proposal.getTxId()={}", proposal.getTxId()); return false; } } else { diff --git a/core/src/main/java/bisq/core/dao/governance/proposal/compensation/CompensationProposal.java b/core/src/main/java/bisq/core/dao/governance/proposal/compensation/CompensationProposal.java index 07fd1e85f3..5fc6d3a304 100644 --- a/core/src/main/java/bisq/core/dao/governance/proposal/compensation/CompensationProposal.java +++ b/core/src/main/java/bisq/core/dao/governance/proposal/compensation/CompensationProposal.java @@ -18,6 +18,7 @@ package bisq.core.dao.governance.proposal.compensation; import bisq.core.app.BisqEnvironment; +import bisq.core.dao.governance.proposal.IssuanceProposal; import bisq.core.dao.governance.proposal.Proposal; import bisq.core.dao.governance.proposal.ProposalType; import bisq.core.dao.state.blockchain.TxType; @@ -43,7 +44,7 @@ import javax.annotation.concurrent.Immutable; @Slf4j @EqualsAndHashCode(callSuper = true) @Value -public final class CompensationProposal extends Proposal { +public final class CompensationProposal extends Proposal implements IssuanceProposal { private final long requestedBsq; private final String bsqAddress; 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 b39ed655a5..504f928717 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 @@ -91,16 +91,20 @@ public class ChangeParamValidator extends ProposalValidator { break; case COMPENSATION_REQUEST_MIN_AMOUNT: + case REIMBURSEMENT_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: + case REIMBURSEMENT_MAX_AMOUNT: checkMinMax(param, paramValue, 100, -50); break; case QUORUM_COMP_REQUEST: break; + case QUORUM_REIMBURSEMENT: + break; case QUORUM_CHANGE_PARAM: break; case QUORUM_ROLE: @@ -114,6 +118,8 @@ public class ChangeParamValidator extends ProposalValidator { case THRESHOLD_COMP_REQUEST: break; + case THRESHOLD_REIMBURSEMENT: + break; case THRESHOLD_CHANGE_PARAM: break; case THRESHOLD_ROLE: diff --git a/core/src/main/java/bisq/core/dao/governance/proposal/reimbursement/ReimbursementConsensus.java b/core/src/main/java/bisq/core/dao/governance/proposal/reimbursement/ReimbursementConsensus.java new file mode 100644 index 0000000000..e19c054197 --- /dev/null +++ b/core/src/main/java/bisq/core/dao/governance/proposal/reimbursement/ReimbursementConsensus.java @@ -0,0 +1,37 @@ +/* + * 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.reimbursement; + +import bisq.core.dao.state.DaoStateService; +import bisq.core.dao.state.governance.Param; + +import org.bitcoinj.core.Coin; + +import lombok.extern.slf4j.Slf4j; + +@Slf4j +public class ReimbursementConsensus { + public static Coin getMinReimbursementRequestAmount(DaoStateService daoStateService, int chainHeight) { + return Coin.valueOf(daoStateService.getParamValue(Param.REIMBURSEMENT_MIN_AMOUNT, chainHeight)); + } + + public static Coin getMaxReimbursementRequestAmount(DaoStateService daoStateService, int chainHeight) { + return Coin.valueOf(daoStateService.getParamValue(Param.REIMBURSEMENT_MAX_AMOUNT, chainHeight)); + } + +} diff --git a/core/src/main/java/bisq/core/dao/governance/proposal/reimbursement/ReimbursementProposal.java b/core/src/main/java/bisq/core/dao/governance/proposal/reimbursement/ReimbursementProposal.java new file mode 100644 index 0000000000..2a1b0075c1 --- /dev/null +++ b/core/src/main/java/bisq/core/dao/governance/proposal/reimbursement/ReimbursementProposal.java @@ -0,0 +1,159 @@ +/* + * 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.reimbursement; + +import bisq.core.app.BisqEnvironment; +import bisq.core.dao.governance.proposal.IssuanceProposal; +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 org.bitcoinj.core.Address; +import org.bitcoinj.core.AddressFormatException; +import org.bitcoinj.core.Coin; + +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 ReimbursementProposal extends Proposal implements IssuanceProposal { + private final long requestedBsq; + private final String bsqAddress; + + ReimbursementProposal(String name, + String link, + Coin requestedBsq, + String bsqAddress) { + this(name, + link, + bsqAddress, + requestedBsq.value, + Version.REIMBURSEMENT_REQUEST, + new Date().getTime(), + ""); + } + + + /////////////////////////////////////////////////////////////////////////////////////////// + // PROTO BUFFER + /////////////////////////////////////////////////////////////////////////////////////////// + + private ReimbursementProposal(String name, + String link, + String bsqAddress, + long requestedBsq, + byte version, + long creationDate, + String txId) { + super(name, + link, + version, + creationDate, + txId); + + this.requestedBsq = requestedBsq; + this.bsqAddress = bsqAddress; + } + + @Override + public PB.Proposal.Builder getProposalBuilder() { + final PB.ReimbursementProposal.Builder builder = PB.ReimbursementProposal.newBuilder() + .setBsqAddress(bsqAddress) + .setRequestedBsq(requestedBsq); + return super.getProposalBuilder().setReimbursementProposal(builder); + } + + public static ReimbursementProposal fromProto(PB.Proposal proto) { + final PB.ReimbursementProposal proposalProto = proto.getReimbursementProposal(); + return new ReimbursementProposal(proto.getName(), + proto.getLink(), + proposalProto.getBsqAddress(), + proposalProto.getRequestedBsq(), + (byte) proto.getVersion(), + proto.getCreationDate(), + proto.getTxId()); + } + + + /////////////////////////////////////////////////////////////////////////////////////////// + // Getters + /////////////////////////////////////////////////////////////////////////////////////////// + + public Coin getRequestedBsq() { + return Coin.valueOf(requestedBsq); + } + + public Address getAddress() throws AddressFormatException { + // Remove leading 'B' + String underlyingBtcAddress = bsqAddress.substring(1, bsqAddress.length()); + return Address.fromBase58(BisqEnvironment.getParameters(), underlyingBtcAddress); + } + + + @Override + public ProposalType getType() { + return ProposalType.REIMBURSEMENT_REQUEST; + } + + @Override + public Param getQuorumParam() { + return Param.QUORUM_REIMBURSEMENT; + } + + @Override + public Param getThresholdParam() { + return Param.THRESHOLD_REIMBURSEMENT; + } + + @Override + public TxType getTxType() { + return TxType.REIMBURSEMENT_REQUEST; + } + + @Override + public Proposal cloneProposalAndAddTxId(String txId) { + return new ReimbursementProposal(getName(), + getLink(), + getBsqAddress(), + getRequestedBsq().value, + getVersion(), + getCreationDate().getTime(), + txId); + } + + @Override + public String toString() { + return "ReimbursementProposal{" + + "\n requestedBsq=" + requestedBsq + + ",\n bsqAddress='" + bsqAddress + '\'' + + "\n} " + super.toString(); + } +} diff --git a/core/src/main/java/bisq/core/dao/governance/proposal/reimbursement/ReimbursementProposalService.java b/core/src/main/java/bisq/core/dao/governance/proposal/reimbursement/ReimbursementProposalService.java new file mode 100644 index 0000000000..c80f3ebe5f --- /dev/null +++ b/core/src/main/java/bisq/core/dao/governance/proposal/reimbursement/ReimbursementProposalService.java @@ -0,0 +1,99 @@ +/* + * 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.reimbursement; + +import bisq.core.btc.exceptions.TransactionVerificationException; +import bisq.core.btc.exceptions.WalletException; +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.Proposal; +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.DaoStateService; +import bisq.core.dao.state.blockchain.OpReturnType; + +import bisq.common.app.Version; + +import org.bitcoinj.core.Coin; +import org.bitcoinj.core.InsufficientMoneyException; +import org.bitcoinj.core.Transaction; + +import javax.inject.Inject; + +import lombok.extern.slf4j.Slf4j; + +/** + * Creates the ReimbursementProposal and the transaction. + */ +@Slf4j +public class ReimbursementProposalService extends BaseProposalService { + + private Coin requestedBsq; + private String bsqAddress; + + @Inject + public ReimbursementProposalService(BsqWalletService bsqWalletService, + BtcWalletService btcWalletService, + DaoStateService daoStateService, + ReimbursementValidator proposalValidator) { + super(bsqWalletService, + btcWalletService, + daoStateService, + proposalValidator); + } + + public ProposalWithTransaction createProposalWithTransaction(String name, + String link, + Coin requestedBsq) + throws ValidationException, InsufficientMoneyException, TxException { + this.requestedBsq = requestedBsq; + this.bsqAddress = bsqWalletService.getUnusedBsqAddressAsString(); + + return super.createProposalWithTransaction(name, link); + } + + @Override + protected ReimbursementProposal createProposalWithoutTxId() { + return new ReimbursementProposal( + name, + link, + requestedBsq, + bsqAddress); + } + + @Override + protected byte[] getOpReturnData(byte[] hashOfPayload) { + return ProposalConsensus.getOpReturnData(hashOfPayload, + OpReturnType.REIMBURSEMENT_REQUEST.getType(), + Version.REIMBURSEMENT_REQUEST); + } + + @Override + protected Transaction completeTx(Transaction preparedBurnFeeTx, byte[] opReturnData, Proposal proposal) + throws WalletException, InsufficientMoneyException, TransactionVerificationException { + ReimbursementProposal reimbursementProposal = (ReimbursementProposal) proposal; + return btcWalletService.completePreparedReimbursementRequestTx( + reimbursementProposal.getRequestedBsq(), + reimbursementProposal.getAddress(), + preparedBurnFeeTx, + opReturnData); + } +} diff --git a/core/src/main/java/bisq/core/dao/governance/proposal/reimbursement/ReimbursementValidator.java b/core/src/main/java/bisq/core/dao/governance/proposal/reimbursement/ReimbursementValidator.java new file mode 100644 index 0000000000..996e1750f1 --- /dev/null +++ b/core/src/main/java/bisq/core/dao/governance/proposal/reimbursement/ReimbursementValidator.java @@ -0,0 +1,65 @@ +/* + * 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.reimbursement; + +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.DaoStateService; +import bisq.core.dao.state.period.PeriodService; + +import org.bitcoinj.core.Coin; + +import javax.inject.Inject; + +import lombok.extern.slf4j.Slf4j; + +import static com.google.common.base.Preconditions.checkArgument; +import static org.apache.commons.lang3.Validate.notEmpty; + +@Slf4j +public class ReimbursementValidator extends ProposalValidator { + + @Inject + public ReimbursementValidator(DaoStateService daoStateService, PeriodService periodService) { + super(daoStateService, periodService); + } + + @Override + public void validateDataFields(Proposal proposal) throws ValidationException { + try { + super.validateDataFields(proposal); + + ReimbursementProposal reimbursementProposal = (ReimbursementProposal) proposal; + String bsqAddress = reimbursementProposal.getBsqAddress(); + notEmpty(bsqAddress, "bsqAddress must not be empty"); + checkArgument(bsqAddress.substring(0, 1).equals("B"), "bsqAddress must start with B"); + reimbursementProposal.getAddress(); // throws AddressFormatException if wrong address + + Coin requestedBsq = reimbursementProposal.getRequestedBsq(); + Coin maxReimbursementRequestAmount = ReimbursementConsensus.getMaxReimbursementRequestAmount(daoStateService, periodService.getChainHeight()); + checkArgument(requestedBsq.compareTo(maxReimbursementRequestAmount) <= 0, + "Requested BSQ must not exceed " + (maxReimbursementRequestAmount.value / 100L) + " BSQ"); + Coin minReimbursementRequestAmount = ReimbursementConsensus.getMinReimbursementRequestAmount(daoStateService, periodService.getChainHeight()); + checkArgument(requestedBsq.compareTo(minReimbursementRequestAmount) >= 0, + "Requested BSQ must not be less than " + (minReimbursementRequestAmount.value / 100L) + " BSQ"); + } catch (Throwable throwable) { + throw new ValidationException(throwable); + } + } +} diff --git a/core/src/main/java/bisq/core/dao/governance/voteresult/VoteResultService.java b/core/src/main/java/bisq/core/dao/governance/voteresult/VoteResultService.java index 4a7394a4f3..522551a1d3 100644 --- a/core/src/main/java/bisq/core/dao/governance/voteresult/VoteResultService.java +++ b/core/src/main/java/bisq/core/dao/governance/voteresult/VoteResultService.java @@ -30,9 +30,9 @@ import bisq.core.dao.governance.blindvote.VoteWithProposalTxId; import bisq.core.dao.governance.blindvote.VoteWithProposalTxIdList; import bisq.core.dao.governance.merit.MeritConsensus; import bisq.core.dao.governance.merit.MeritList; +import bisq.core.dao.governance.proposal.IssuanceProposal; import bisq.core.dao.governance.proposal.Proposal; import bisq.core.dao.governance.proposal.ProposalListPresentation; -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; @@ -564,8 +564,8 @@ public class VoteResultService implements DaoStateListener, DaoSetupService { private void applyIssuance(Set acceptedEvaluatedProposals, int chainHeight) { acceptedEvaluatedProposals.stream() .map(EvaluatedProposal::getProposal) - .filter(proposal -> proposal instanceof CompensationProposal) - .forEach(proposal -> issuanceService.issueBsq((CompensationProposal) proposal, chainHeight)); + .filter(proposal -> proposal instanceof IssuanceProposal) + .forEach(proposal -> issuanceService.issueBsq((IssuanceProposal) proposal, chainHeight)); } private void applyParamChange(Set acceptedEvaluatedProposals, int chainHeight) { diff --git a/core/src/main/java/bisq/core/dao/governance/voteresult/issuance/IssuanceService.java b/core/src/main/java/bisq/core/dao/governance/voteresult/issuance/IssuanceService.java index 1887f3f8f6..a6daf34a1c 100644 --- a/core/src/main/java/bisq/core/dao/governance/voteresult/issuance/IssuanceService.java +++ b/core/src/main/java/bisq/core/dao/governance/voteresult/issuance/IssuanceService.java @@ -17,12 +17,15 @@ package bisq.core.dao.governance.voteresult.issuance; +import bisq.core.dao.governance.proposal.IssuanceProposal; import bisq.core.dao.governance.proposal.compensation.CompensationProposal; +import bisq.core.dao.governance.proposal.reimbursement.ReimbursementProposal; import bisq.core.dao.state.DaoStateService; import bisq.core.dao.state.blockchain.Tx; import bisq.core.dao.state.blockchain.TxInput; import bisq.core.dao.state.blockchain.TxOutput; import bisq.core.dao.state.governance.Issuance; +import bisq.core.dao.state.governance.IssuanceType; import bisq.core.dao.state.period.DaoPhase; import bisq.core.dao.state.period.PeriodService; @@ -32,6 +35,8 @@ import java.util.Optional; import lombok.extern.slf4j.Slf4j; +import static com.google.common.base.Preconditions.checkArgument; + //TODO case that user misses reveal phase not impl. yet @Slf4j @@ -50,42 +55,51 @@ public class IssuanceService { this.periodService = periodService; } - public void issueBsq(CompensationProposal compensationProposal, int chainHeight) { + public void issueBsq(IssuanceProposal issuanceProposal, int chainHeight) { daoStateService.getIssuanceCandidateTxOutputs().stream() - .filter(txOutput -> isValid(txOutput, compensationProposal, periodService, chainHeight)) + .filter(txOutput -> isValid(txOutput, issuanceProposal, periodService, chainHeight)) .forEach(txOutput -> { + IssuanceType issuanceType = IssuanceType.UNDEFINED; + if (issuanceProposal instanceof CompensationProposal) { + issuanceType = IssuanceType.COMPENSATION; + } else if (issuanceProposal instanceof ReimbursementProposal) { + issuanceType = IssuanceType.REIMBURSEMENT; + } + checkArgument(issuanceType != IssuanceType.UNDEFINED, "issuanceType must nto be undefined"); + // We don't check atm if the output is unspent. We cannot use the bsqWallet as that would not // reflect our current block state (could have been spent at later block which is valid and // bsqWallet would show that spent state). We would need to support a spent status for the outputs // which are interpreted as BTC (as a not yet accepted comp. request). - Optional optionalTx = daoStateService.getTx(compensationProposal.getTxId()); + Optional optionalTx = daoStateService.getTx(issuanceProposal.getTxId()); if (optionalTx.isPresent()) { - long amount = compensationProposal.getRequestedBsq().value; + long amount = issuanceProposal.getRequestedBsq().value; Tx tx = optionalTx.get(); // We use key from first input TxInput txInput = tx.getTxInputs().get(0); String pubKey = txInput.getPubKey(); - Issuance issuance = new Issuance(tx.getId(), chainHeight, amount, pubKey); + Issuance issuance = new Issuance(tx.getId(), chainHeight, amount, pubKey, issuanceType); daoStateService.addIssuance(issuance); daoStateService.addUnspentTxOutput(txOutput); StringBuilder sb = new StringBuilder(); sb.append("\n################################################################################\n"); sb.append("We issued new BSQ to tx with ID ").append(txOutput.getTxId()) - .append("\nIssued BSQ: ").append(compensationProposal.getRequestedBsq()) + .append("\nIssued BSQ: ").append(issuanceProposal.getRequestedBsq()) + .append("\nIssuance type: ").append(issuanceType.name()) .append("\n################################################################################\n"); log.info(sb.toString()); } else { //TODO throw exception - log.error("Tx for compensation request not found. txId={}", compensationProposal.getTxId()); + log.error("Tx for compensation request not found. txId={}", issuanceProposal.getTxId()); } }); } - private boolean isValid(TxOutput txOutput, CompensationProposal compensationProposal, PeriodService periodService, int chainHeight) { - return txOutput.getTxId().equals(compensationProposal.getTxId()) - && compensationProposal.getRequestedBsq().value == txOutput.getValue() - && compensationProposal.getBsqAddress().substring(1).equals(txOutput.getAddress()) + private boolean isValid(TxOutput txOutput, IssuanceProposal issuanceProposal, PeriodService periodService, int chainHeight) { + return txOutput.getTxId().equals(issuanceProposal.getTxId()) + && issuanceProposal.getRequestedBsq().value == txOutput.getValue() + && issuanceProposal.getBsqAddress().substring(1).equals(txOutput.getAddress()) && periodService.isTxInPhaseAndCycle(txOutput.getTxId(), DaoPhase.Phase.PROPOSAL, chainHeight); } } diff --git a/core/src/main/java/bisq/core/dao/node/json/JsonTxOutputType.java b/core/src/main/java/bisq/core/dao/node/json/JsonTxOutputType.java index f8187e065a..9ca86c1998 100644 --- a/core/src/main/java/bisq/core/dao/node/json/JsonTxOutputType.java +++ b/core/src/main/java/bisq/core/dao/node/json/JsonTxOutputType.java @@ -27,6 +27,7 @@ enum JsonTxOutputType { BTC_OUTPUT("BTC"), PROPOSAL_OP_RETURN_OUTPUT("Proposal opReturn"), COMP_REQ_OP_RETURN_OUTPUT("Compensation request opReturn"), + REIMBURSEMENT_OP_RETURN_OUTPUT("Reimbursement request opReturn"), CONFISCATE_BOND_OP_RETURN_OUTPUT("Confiscate bond opReturn"), ISSUANCE_CANDIDATE_OUTPUT("Issuance candidate"), BLIND_VOTE_LOCK_STAKE_OUTPUT("Blind vote lock stake"), diff --git a/core/src/main/java/bisq/core/dao/node/json/JsonTxType.java b/core/src/main/java/bisq/core/dao/node/json/JsonTxType.java index 5d44c504c6..56d9233617 100644 --- a/core/src/main/java/bisq/core/dao/node/json/JsonTxType.java +++ b/core/src/main/java/bisq/core/dao/node/json/JsonTxType.java @@ -29,6 +29,7 @@ enum JsonTxType { PAY_TRADE_FEE("Pay trade fee"), PROPOSAL("Proposal"), COMPENSATION_REQUEST("Compensation request"), + REIMBURSEMENT_REQUEST("Reimbursement request"), BLIND_VOTE("Blind vote"), VOTE_REVEAL("Vote reveal"), LOCKUP("Lockup"), diff --git a/core/src/main/java/bisq/core/dao/node/parser/OpReturnParser.java b/core/src/main/java/bisq/core/dao/node/parser/OpReturnParser.java index 832d151a50..5b5a10db3c 100644 --- a/core/src/main/java/bisq/core/dao/node/parser/OpReturnParser.java +++ b/core/src/main/java/bisq/core/dao/node/parser/OpReturnParser.java @@ -90,6 +90,11 @@ class OpReturnParser { return TxOutputType.COMP_REQ_OP_RETURN_OUTPUT; else break; + case REIMBURSEMENT_REQUEST: + if (ProposalConsensus.hasOpReturnDataValidLength(opReturnData)) + return TxOutputType.REIMBURSEMENT_OP_RETURN_OUTPUT; + else + break; case BLIND_VOTE: if (BlindVoteConsensus.hasOpReturnDataValidLength(opReturnData)) return TxOutputType.BLIND_VOTE_OP_RETURN_OUTPUT; diff --git a/core/src/main/java/bisq/core/dao/node/parser/TxInputParser.java b/core/src/main/java/bisq/core/dao/node/parser/TxInputParser.java index f4c5dba4ae..5fbee267ce 100644 --- a/core/src/main/java/bisq/core/dao/node/parser/TxInputParser.java +++ b/core/src/main/java/bisq/core/dao/node/parser/TxInputParser.java @@ -83,6 +83,7 @@ public class TxInputParser { case BTC_OUTPUT: case PROPOSAL_OP_RETURN_OUTPUT: case COMP_REQ_OP_RETURN_OUTPUT: + case REIMBURSEMENT_OP_RETURN_OUTPUT: case CONFISCATE_BOND_OP_RETURN_OUTPUT: case ISSUANCE_CANDIDATE_OUTPUT: break; diff --git a/core/src/main/java/bisq/core/dao/node/parser/TxOutputParser.java b/core/src/main/java/bisq/core/dao/node/parser/TxOutputParser.java index 81d410d8f0..e264fde85a 100644 --- a/core/src/main/java/bisq/core/dao/node/parser/TxOutputParser.java +++ b/core/src/main/java/bisq/core/dao/node/parser/TxOutputParser.java @@ -205,7 +205,8 @@ public class TxOutputParser { if (availableInputValue > 0 && index == 1 && optionalOpReturnType.isPresent() && - optionalOpReturnType.get() == OpReturnType.COMPENSATION_REQUEST) { + (optionalOpReturnType.get() == OpReturnType.COMPENSATION_REQUEST || + optionalOpReturnType.get() == OpReturnType.REIMBURSEMENT_REQUEST)) { optionalIssuanceCandidate = Optional.of(txOutput); } else { txOutput.setTxOutputType(TxOutputType.BTC_OUTPUT); @@ -225,6 +226,8 @@ public class TxOutputParser { return Optional.of(OpReturnType.PROPOSAL); case COMP_REQ_OP_RETURN_OUTPUT: return Optional.of(OpReturnType.COMPENSATION_REQUEST); + case REIMBURSEMENT_OP_RETURN_OUTPUT: + return Optional.of(OpReturnType.REIMBURSEMENT_REQUEST); case BLIND_VOTE_OP_RETURN_OUTPUT: return Optional.of(OpReturnType.BLIND_VOTE); case VOTE_REVEAL_OP_RETURN_OUTPUT: diff --git a/core/src/main/java/bisq/core/dao/node/parser/TxParser.java b/core/src/main/java/bisq/core/dao/node/parser/TxParser.java index 3a755fdad9..9d67edc93b 100644 --- a/core/src/main/java/bisq/core/dao/node/parser/TxParser.java +++ b/core/src/main/java/bisq/core/dao/node/parser/TxParser.java @@ -195,7 +195,8 @@ public class TxParser { processProposal(blockHeight, tempTx, bsqFee); break; case COMPENSATION_REQUEST: - processCompensationRequest(blockHeight, tempTx, bsqFee); + case REIMBURSEMENT_REQUEST: + processIssuance(blockHeight, tempTx, bsqFee); break; case BLIND_VOTE: processBlindVote(blockHeight, tempTx, bsqFee); @@ -211,7 +212,7 @@ public class TxParser { // We need to check if any tempTxOutput is available and if so and the OpReturn data is invalid we // set the output to a BTC output. We must not use `if else` cases here! - if (opReturnType != OpReturnType.COMPENSATION_REQUEST) { + if (opReturnType != OpReturnType.COMPENSATION_REQUEST && opReturnType != OpReturnType.REIMBURSEMENT_REQUEST) { txOutputParser.getOptionalIssuanceCandidate().ifPresent(tempTxOutput -> tempTxOutput.setTxOutputType(TxOutputType.BTC_OUTPUT)); } @@ -235,7 +236,7 @@ public class TxParser { } } - private void processCompensationRequest(int blockHeight, TempTx tempTx, long bsqFee) { + private void processIssuance(int blockHeight, TempTx tempTx, long bsqFee) { boolean isFeeAndPhaseValid = isFeeAndPhaseValid(blockHeight, bsqFee, DaoPhase.Phase.PROPOSAL, Param.PROPOSAL_FEE); Optional optionalIssuanceCandidate = txOutputParser.getOptionalIssuanceCandidate(); if (isFeeAndPhaseValid) { @@ -400,21 +401,24 @@ public class TxParser { case PROPOSAL: return TxType.PROPOSAL; case COMPENSATION_REQUEST: + case REIMBURSEMENT_REQUEST: boolean hasCorrectNumOutputs = tempTx.getTempTxOutputs().size() >= 3; if (!hasCorrectNumOutputs) { - log.warn("Compensation request tx need to have at least 3 outputs"); + log.warn("Compensation/reimbursement request tx need to have at least 3 outputs"); return TxType.INVALID; } TempTxOutput issuanceTxOutput = tempTx.getTempTxOutputs().get(1); boolean hasIssuanceOutput = issuanceTxOutput.getTxOutputType() == TxOutputType.ISSUANCE_CANDIDATE_OUTPUT; if (!hasIssuanceOutput) { - log.warn("Compensation request txOutput type of output at index 1 need to be ISSUANCE_CANDIDATE_OUTPUT. " + + log.warn("Compensation/reimbursement request txOutput type of output at index 1 need to be ISSUANCE_CANDIDATE_OUTPUT. " + "TxOutputType={}", issuanceTxOutput.getTxOutputType()); return TxType.INVALID; } - return TxType.COMPENSATION_REQUEST; + return opReturnType == OpReturnType.COMPENSATION_REQUEST ? + TxType.COMPENSATION_REQUEST : + TxType.REIMBURSEMENT_REQUEST; case BLIND_VOTE: return TxType.BLIND_VOTE; case VOTE_REVEAL: diff --git a/core/src/main/java/bisq/core/dao/state/DaoStateService.java b/core/src/main/java/bisq/core/dao/state/DaoStateService.java index a11fb98433..e31b715e52 100644 --- a/core/src/main/java/bisq/core/dao/state/DaoStateService.java +++ b/core/src/main/java/bisq/core/dao/state/DaoStateService.java @@ -32,6 +32,7 @@ import bisq.core.dao.state.blockchain.TxOutputType; import bisq.core.dao.state.blockchain.TxType; import bisq.core.dao.state.governance.ConfiscateBond; import bisq.core.dao.state.governance.Issuance; +import bisq.core.dao.state.governance.IssuanceType; import bisq.core.dao.state.governance.Param; import bisq.core.dao.state.governance.ParamChange; import bisq.core.dao.state.period.Cycle; @@ -407,6 +408,7 @@ public class DaoStateService implements DaoSetupService { return false; case PROPOSAL_OP_RETURN_OUTPUT: case COMP_REQ_OP_RETURN_OUTPUT: + case REIMBURSEMENT_OP_RETURN_OUTPUT: case ISSUANCE_CANDIDATE_OUTPUT: return true; case BLIND_VOTE_LOCK_STAKE_OUTPUT: @@ -451,6 +453,7 @@ public class DaoStateService implements DaoSetupService { return false; case PROPOSAL_OP_RETURN_OUTPUT: case COMP_REQ_OP_RETURN_OUTPUT: + case REIMBURSEMENT_OP_RETURN_OUTPUT: return true; case ISSUANCE_CANDIDATE_OUTPUT: return isIssuanceTx(txOutput.getTxId()); @@ -502,31 +505,42 @@ public class DaoStateService implements DaoSetupService { daoState.getIssuanceMap().put(issuance.getTxId(), issuance); } - public Set getIssuanceSet() { - return new HashSet<>(daoState.getIssuanceMap().values()); + public Set getIssuanceSet(IssuanceType issuanceType) { + return daoState.getIssuanceMap().values().stream() + .filter(issuance -> issuance.getIssuanceType() == issuanceType) + .collect(Collectors.toSet()); + } + + public Optional getIssuance(String txId, IssuanceType issuanceType) { + return daoState.getIssuanceMap().values().stream() + .filter(issuance -> issuance.getTxId().equals(txId)) + .filter(issuance -> issuance.getIssuanceType() == issuanceType) + .findAny(); } public Optional getIssuance(String txId) { - if (daoState.getIssuanceMap().containsKey(txId)) - return Optional.of(daoState.getIssuanceMap().get(txId)); - else - return Optional.empty(); + return daoState.getIssuanceMap().values().stream() + .filter(issuance -> issuance.getTxId().equals(txId)) + .findAny(); } - //TODO rename acceptedIssuanceTx public boolean isIssuanceTx(String txId) { return getIssuance(txId).isPresent(); } + public boolean isIssuanceTx(String txId, IssuanceType issuanceType) { + return getIssuance(txId, issuanceType).isPresent(); + } + public int getIssuanceBlockHeight(String txId) { return getIssuance(txId) .map(Issuance::getChainHeight) .orElse(0); } - public long getTotalIssuedAmount() { + public long getTotalIssuedAmount(IssuanceType issuanceType) { return getIssuanceCandidateTxOutputs().stream() - .filter(txOutput -> isIssuanceTx(txOutput.getTxId())) + .filter(txOutput -> isIssuanceTx(txOutput.getTxId(), issuanceType)) .mapToLong(TxOutput::getValue) .sum(); } diff --git a/core/src/main/java/bisq/core/dao/state/blockchain/OpReturnType.java b/core/src/main/java/bisq/core/dao/state/blockchain/OpReturnType.java index 296082b10f..b9ce697002 100644 --- a/core/src/main/java/bisq/core/dao/state/blockchain/OpReturnType.java +++ b/core/src/main/java/bisq/core/dao/state/blockchain/OpReturnType.java @@ -30,9 +30,10 @@ public enum OpReturnType { //TODO add undefined ? PROPOSAL((byte) 0x10), COMPENSATION_REQUEST((byte) 0x11), - BLIND_VOTE((byte) 0x12), - VOTE_REVEAL((byte) 0x13), - LOCKUP((byte) 0x14); + REIMBURSEMENT_REQUEST((byte) 0x12), + BLIND_VOTE((byte) 0x13), + VOTE_REVEAL((byte) 0x14), + LOCKUP((byte) 0x15); @Getter private byte type; diff --git a/core/src/main/java/bisq/core/dao/state/blockchain/TxOutputType.java b/core/src/main/java/bisq/core/dao/state/blockchain/TxOutputType.java index a4ed27bbb2..531d82f187 100644 --- a/core/src/main/java/bisq/core/dao/state/blockchain/TxOutputType.java +++ b/core/src/main/java/bisq/core/dao/state/blockchain/TxOutputType.java @@ -28,6 +28,7 @@ public enum TxOutputType { BTC_OUTPUT, PROPOSAL_OP_RETURN_OUTPUT, COMP_REQ_OP_RETURN_OUTPUT, + REIMBURSEMENT_OP_RETURN_OUTPUT, CONFISCATE_BOND_OP_RETURN_OUTPUT, ISSUANCE_CANDIDATE_OUTPUT, BLIND_VOTE_LOCK_STAKE_OUTPUT, diff --git a/core/src/main/java/bisq/core/dao/state/blockchain/TxType.java b/core/src/main/java/bisq/core/dao/state/blockchain/TxType.java index dae5f4f20e..8b3ab45db5 100644 --- a/core/src/main/java/bisq/core/dao/state/blockchain/TxType.java +++ b/core/src/main/java/bisq/core/dao/state/blockchain/TxType.java @@ -34,6 +34,7 @@ public enum TxType { PAY_TRADE_FEE(false, true), PROPOSAL(true, true), COMPENSATION_REQUEST(true, true), + REIMBURSEMENT_REQUEST(true, true), BLIND_VOTE(true, true), VOTE_REVEAL(true, false), LOCKUP(true, false), diff --git a/core/src/main/java/bisq/core/dao/state/governance/Issuance.java b/core/src/main/java/bisq/core/dao/state/governance/Issuance.java index daea557313..2d9b1d5d65 100644 --- a/core/src/main/java/bisq/core/dao/state/governance/Issuance.java +++ b/core/src/main/java/bisq/core/dao/state/governance/Issuance.java @@ -17,13 +17,12 @@ package bisq.core.dao.state.governance; +import bisq.common.proto.ProtoUtil; import bisq.common.proto.network.NetworkPayload; import bisq.common.proto.persistable.PersistablePayload; import io.bisq.generated.protobuffer.PB; -import javax.inject.Inject; - import java.util.Optional; import lombok.Value; @@ -45,12 +44,14 @@ public class Issuance implements PersistablePayload, NetworkPayload { @Nullable private final String pubKey; // sig key as hex of first input in issuance tx - @Inject - public Issuance(String txId, int chainHeight, long amount, @Nullable String pubKey) { + private final IssuanceType issuanceType; + + public Issuance(String txId, int chainHeight, long amount, @Nullable String pubKey, IssuanceType issuanceType) { this.txId = txId; this.chainHeight = chainHeight; this.amount = amount; this.pubKey = pubKey; + this.issuanceType = issuanceType; } @@ -62,7 +63,8 @@ public class Issuance implements PersistablePayload, NetworkPayload { final PB.Issuance.Builder builder = PB.Issuance.newBuilder() .setTxId(txId) .setChainHeight(chainHeight) - .setAmount(amount); + .setAmount(amount) + .setIssuanceType(issuanceType.name()); Optional.ofNullable(pubKey).ifPresent(e -> builder.setPubKey(pubKey)); @@ -73,7 +75,8 @@ public class Issuance implements PersistablePayload, NetworkPayload { return new Issuance(proto.getTxId(), proto.getChainHeight(), proto.getAmount(), - proto.getPubKey().isEmpty() ? null : proto.getPubKey()); + proto.getPubKey().isEmpty() ? null : proto.getPubKey(), + proto.getIssuanceType().isEmpty() ? IssuanceType.UNDEFINED : ProtoUtil.enumFromProto(IssuanceType.class, proto.getIssuanceType())); } @Override @@ -83,6 +86,7 @@ public class Issuance implements PersistablePayload, NetworkPayload { ",\n chainHeight=" + chainHeight + ",\n amount=" + amount + ",\n pubKey='" + pubKey + '\'' + + ",\n issuanceType='" + issuanceType + '\'' + "\n}"; } } diff --git a/core/src/main/java/bisq/core/dao/state/governance/IssuanceType.java b/core/src/main/java/bisq/core/dao/state/governance/IssuanceType.java new file mode 100644 index 0000000000..99778e50e1 --- /dev/null +++ b/core/src/main/java/bisq/core/dao/state/governance/IssuanceType.java @@ -0,0 +1,24 @@ +/* + * 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.state.governance; + +public enum IssuanceType { + UNDEFINED, + COMPENSATION, + REIMBURSEMENT +} 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 a9cbcdc1ec..0377a4b2d3 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 @@ -67,12 +67,15 @@ public enum Param { // As BSQ based validation values can change over time if BSQ value rise we need to support that in the Params as well COMPENSATION_REQUEST_MIN_AMOUNT(1_000), // 10 BSQ COMPENSATION_REQUEST_MAX_AMOUNT(10_000_000), // 100 000 BSQ + REIMBURSEMENT_MIN_AMOUNT(1_000), // 10 BSQ + REIMBURSEMENT_MAX_AMOUNT(1_000_000), // 10 000 BSQ // Quorum required for voting result to be valid. // Quorum is the min. amount of total BSQ (earned+stake) which was used for voting on a request. // E.g. If only 2000 BSQ was used on a vote but 10 000 is required the result is invalid even if the voters voted // 100% for acceptance. This should prevent that changes can be done with low stakeholder participation. QUORUM_COMP_REQUEST(2_000_000), // 20 000 BSQ + QUORUM_REIMBURSEMENT(2_000_000), // 20 000 BSQ QUORUM_CHANGE_PARAM(10_000_000), // 100 000 BSQ QUORUM_ROLE(5_000_000), // 50 000 BSQ QUORUM_CONFISCATION(20_000_000), // 200 000 BSQ @@ -85,6 +88,7 @@ public enum Param { // The result must be larger than the threshold. A 50% vote result for a threshold with 50% is not sufficient, // it requires min. 50.01%. THRESHOLD_COMP_REQUEST(5_000), // 50% + THRESHOLD_REIMBURSEMENT(5_000), // 50% THRESHOLD_CHANGE_PARAM(7_500), // 75% That might change the THRESHOLD_CHANGE_PARAM and QUORUM_CHANGE_PARAM as well. So we have to be careful here! THRESHOLD_ROLE(5_000), // 50% THRESHOLD_CONFISCATION(8_500), // 85% Confiscation is considered an exceptional case and need very high consensus among the stakeholders. diff --git a/core/src/main/java/bisq/core/util/BsqFormatter.java b/core/src/main/java/bisq/core/util/BsqFormatter.java index a5caf9243c..eaa28f760a 100644 --- a/core/src/main/java/bisq/core/util/BsqFormatter.java +++ b/core/src/main/java/bisq/core/util/BsqFormatter.java @@ -134,9 +134,12 @@ public class BsqFormatter extends BSFormatter { case BLIND_VOTE_FEE: case COMPENSATION_REQUEST_MIN_AMOUNT: case COMPENSATION_REQUEST_MAX_AMOUNT: + case REIMBURSEMENT_MIN_AMOUNT: + case REIMBURSEMENT_MAX_AMOUNT: return formatCoinWithCode(Coin.valueOf(value)); case QUORUM_COMP_REQUEST: + case QUORUM_REIMBURSEMENT: case QUORUM_CHANGE_PARAM: case QUORUM_ROLE: case QUORUM_CONFISCATION: @@ -145,6 +148,7 @@ public class BsqFormatter extends BSFormatter { return formatCoinWithCode(Coin.valueOf(value)); case THRESHOLD_COMP_REQUEST: + case THRESHOLD_REIMBURSEMENT: case THRESHOLD_CHANGE_PARAM: case THRESHOLD_ROLE: case THRESHOLD_CONFISCATION: @@ -183,10 +187,13 @@ public class BsqFormatter extends BSFormatter { case BLIND_VOTE_FEE: case COMPENSATION_REQUEST_MIN_AMOUNT: case COMPENSATION_REQUEST_MAX_AMOUNT: + case REIMBURSEMENT_MIN_AMOUNT: + case REIMBURSEMENT_MAX_AMOUNT: return parseToCoin(inputValue).value; case QUORUM_COMP_REQUEST: + case QUORUM_REIMBURSEMENT: case QUORUM_CHANGE_PARAM: case QUORUM_ROLE: case QUORUM_CONFISCATION: @@ -196,6 +203,7 @@ public class BsqFormatter extends BSFormatter { case THRESHOLD_COMP_REQUEST: + case THRESHOLD_REIMBURSEMENT: case THRESHOLD_CHANGE_PARAM: case THRESHOLD_ROLE: case THRESHOLD_CONFISCATION: diff --git a/core/src/main/resources/i18n/displayStrings.properties b/core/src/main/resources/i18n/displayStrings.properties index 9b57a37661..b23c9f6658 100644 --- a/core/src/main/resources/i18n/displayStrings.properties +++ b/core/src/main/resources/i18n/displayStrings.properties @@ -746,7 +746,9 @@ funds.tx.noTxAvailable=No transactions available funds.tx.revert=Revert funds.tx.txSent=Transaction successfully sent to a new address in the local Bisq wallet. funds.tx.direction.self=Sent to yourself -funds.tx.proposal=Proposal +funds.tx.proposalTxFee=Miner fee for proposal +funds.tx.reimbursementRequestTxFee=Reimbursement request +funds.tx.compensationRequestTxFee=Compensation request #################################################################### @@ -1228,12 +1230,18 @@ dao.param.BLIND_VOTE_FEE=Voting fee in BSQ dao.param.COMPENSATION_REQUEST_MIN_AMOUNT=Compensation request min. BSQ amount # suppress inspection "UnusedProperty" dao.param.COMPENSATION_REQUEST_MAX_AMOUNT=Compensation request max. BSQ amount +# suppress inspection "UnusedProperty" +dao.param.REIMBURSEMENT_MIN_AMOUNT=Reimbursement request min. BSQ amount +# suppress inspection "UnusedProperty" +dao.param.REIMBURSEMENT_MAX_AMOUNT=Reimbursement request max. BSQ amount # suppress inspection "UnusedProperty" 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_REIMBURSEMENT=Required quorum in BSQ for reimbursement 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 asset @@ -1249,6 +1257,8 @@ 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_REIMBURSEMENT=Required threshold in % for reimbursement 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 asset @@ -1377,6 +1387,8 @@ dao.phase.separatedPhaseBar.RESULT=Vote result # suppress inspection "UnusedProperty" dao.proposal.type.COMPENSATION_REQUEST=Compensation request # suppress inspection "UnusedProperty" +dao.proposal.type.REIMBURSEMENT_REQUEST=Reimbursement request +# suppress inspection "UnusedProperty" dao.proposal.type.BONDED_ROLE=Proposal for a bonded role # suppress inspection "UnusedProperty" dao.proposal.type.REMOVE_ASSET=Proposal for removing an asset @@ -1390,6 +1402,8 @@ dao.proposal.type.CONFISCATE_BOND=Proposal for confiscating a bond # suppress inspection "UnusedProperty" dao.proposal.type.short.COMPENSATION_REQUEST=Compensation request # suppress inspection "UnusedProperty" +dao.proposal.type.short.REIMBURSEMENT_REQUEST=Reimbursement request +# suppress inspection "UnusedProperty" dao.proposal.type.short.BONDED_ROLE=Bonded role # suppress inspection "UnusedProperty" dao.proposal.type.short.REMOVE_ASSET=Removing an altcoin @@ -1476,6 +1490,7 @@ dao.wallet.dashboard.genesisBlockHeight=Genesis block height: dao.wallet.dashboard.genesisTxId=Genesis transaction ID: dao.wallet.dashboard.genesisIssueAmount=BSQ issued at genesis transaction: dao.wallet.dashboard.compRequestIssueAmount=BSQ issued for compensation requests: +dao.wallet.dashboard.reimbursementAmount=BSQ issued for reimbursement requests: dao.wallet.dashboard.availableAmount=Total available BSQ: dao.wallet.dashboard.burntAmount=Burned BSQ (fees): dao.wallet.dashboard.totalLockedUpAmount=Locked up in bonds: @@ -1483,7 +1498,8 @@ dao.wallet.dashboard.totalUnlockingAmount=Unlocking BSQ from bonds: dao.wallet.dashboard.totalUnlockedAmount=Unlocked BSQ from bonds: dao.wallet.dashboard.allTx=No. of all BSQ transactions: dao.wallet.dashboard.utxo=No. of all unspent transaction outputs: -dao.wallet.dashboard.issuanceTx=No. of all issuance transactions: +dao.wallet.dashboard.compensationIssuanceTx=No. of all compensation request issuance transactions: +dao.wallet.dashboard.reimbursementIssuanceTx=No. of all reimbursement request issuance transactions: dao.wallet.dashboard.burntTx=No. of all fee payments transactions: dao.wallet.dashboard.price=Latest BSQ/BTC trade price (in Bisq): dao.wallet.dashboard.marketCap=Market capitalisation (based on trade price): @@ -1528,6 +1544,8 @@ dao.tx.type.enum.PAY_TRADE_FEE=Trading fee # suppress inspection "UnusedProperty" dao.tx.type.enum.COMPENSATION_REQUEST=Fee for compensation request # suppress inspection "UnusedProperty" +dao.tx.type.enum.REIMBURSEMENT_REQUEST=Fee for reimbursement request +# suppress inspection "UnusedProperty" dao.tx.type.enum.PROPOSAL=Fee for proposal # suppress inspection "UnusedProperty" dao.tx.type.enum.BLIND_VOTE=Fee for blind vote @@ -1538,10 +1556,12 @@ dao.tx.type.enum.LOCKUP=Lock up bond # suppress inspection "UnusedProperty" dao.tx.type.enum.UNLOCK=Unlock bond -dao.tx.issuance=Compensation request/issuance -dao.tx.issuance.tooltip=Compensation request which led to an issuance of new BSQ.\n\ +dao.tx.issuanceFromCompReq=Compensation request/issuance +dao.tx.issuanceFromCompReq.tooltip=Compensation request which led to an issuance of new BSQ.\n\ + Issuance date: {0} +dao.tx.issuanceFromReimbursement=Reimbursement request/issuance +dao.tx.issuanceFromReimbursement.tooltip=Reimbursement request which led to an issuance of new BSQ.\n\ Issuance date: {0} - dao.proposal.create.missingFunds=You don''t have sufficient funds for creating the proposal.\n\ Missing: {0} dao.feeTx.confirm=Confirm {0} transaction diff --git a/core/src/main/resources/i18n/displayStrings_de.properties b/core/src/main/resources/i18n/displayStrings_de.properties index be8e722b56..0f0bb7b784 100644 --- a/core/src/main/resources/i18n/displayStrings_de.properties +++ b/core/src/main/resources/i18n/displayStrings_de.properties @@ -701,7 +701,7 @@ funds.tx.noTxAvailable=Keine Transaktionen verfügbar funds.tx.revert=Umkehren funds.tx.txSent=Transaktion erfolgreich zu einer neuen Adresse in der lokalen Bisq-Brieftasche gesendet. funds.tx.direction.self=An Sie selbst senden -funds.tx.proposal=Vorschlag +funds.tx.proposalTxFee=Vorschlag #################################################################### @@ -1356,8 +1356,8 @@ dao.tx.type.enum.LOCKUP=Sperre Kopplung # suppress inspection "UnusedProperty" dao.tx.type.enum.UNLOCK=Entsperre Kopplung -dao.tx.issuance=Entlohnungsanfrage/ausgabe -dao.tx.issuance.tooltip=Entlohnungsanfrage, die zur Ausgabe neuere BSQ führte.\nAusgabedatum: {0} +dao.tx.issuanceFromCompReq=Entlohnungsanfrage/ausgabe +dao.tx.issuanceFromCompReq.tooltip=Entlohnungsanfrage, die zur Ausgabe neuere BSQ führte.\nAusgabedatum: {0} dao.proposal.create.missingFunds=Sie haben nicht genügend Gelder um den Vorschlag zu erstellen.\nFehlend: {0} dao.feeTx.confirm=Bestätige {0} Transaktion diff --git a/core/src/main/resources/i18n/displayStrings_el.properties b/core/src/main/resources/i18n/displayStrings_el.properties index f3982543e0..21d8f8e38b 100644 --- a/core/src/main/resources/i18n/displayStrings_el.properties +++ b/core/src/main/resources/i18n/displayStrings_el.properties @@ -701,7 +701,7 @@ funds.tx.noTxAvailable=Δεν υπάρχουν διαθέσιμες συναλλ funds.tx.revert=Revert funds.tx.txSent=Η συναλλαγή απεστάλη επιτυχώς σε νέα διεύθυνση στο τοπικό πορτοφόλι Bisq. funds.tx.direction.self=Αποστολή στον εαυτό σου -funds.tx.proposal=Πρόταση +funds.tx.proposalTxFee=Πρόταση #################################################################### @@ -1356,8 +1356,8 @@ dao.tx.type.enum.LOCKUP=Lock up bond # suppress inspection "UnusedProperty" dao.tx.type.enum.UNLOCK=Unlock bond -dao.tx.issuance=Αίτημα/έκδοση αποζημίωσης -dao.tx.issuance.tooltip=Αίτημα αποζημίωσης το οποίο οδήγησε σε έκδοση νέων BSQ.\nΗμερομηνία έκδοσης: {0} +dao.tx.issuanceFromCompReq=Αίτημα/έκδοση αποζημίωσης +dao.tx.issuanceFromCompReq.tooltip=Αίτημα αποζημίωσης το οποίο οδήγησε σε έκδοση νέων BSQ.\nΗμερομηνία έκδοσης: {0} dao.proposal.create.missingFunds=Δεν έχεις επαρκή κεφάλαια για τη δημιουργία της πρότασης.\nΥπολείπονται: {0} dao.feeTx.confirm=Confirm {0} transaction diff --git a/core/src/main/resources/i18n/displayStrings_es.properties b/core/src/main/resources/i18n/displayStrings_es.properties index 922d4157aa..8f1f971309 100644 --- a/core/src/main/resources/i18n/displayStrings_es.properties +++ b/core/src/main/resources/i18n/displayStrings_es.properties @@ -701,7 +701,7 @@ funds.tx.noTxAvailable=Sin transacciones disponibles funds.tx.revert=Revertir funds.tx.txSent=La transacción se ha enviado exitosamente a una nueva dirección en la billetera Bisq local. funds.tx.direction.self=Enviado a usted mismo -funds.tx.proposal=Propuesta +funds.tx.proposalTxFee=Propuesta #################################################################### @@ -1356,8 +1356,8 @@ dao.tx.type.enum.LOCKUP=Lock up bond # suppress inspection "UnusedProperty" dao.tx.type.enum.UNLOCK=Unlock bond -dao.tx.issuance=Solicitud/emisión de compensación -dao.tx.issuance.tooltip=Solicitud de compensación que lleva a emitir nuevos BSQ.\nFecha de emisión: {0} +dao.tx.issuanceFromCompReq=Solicitud/emisión de compensación +dao.tx.issuanceFromCompReq.tooltip=Solicitud de compensación que lleva a emitir nuevos BSQ.\nFecha de emisión: {0} dao.proposal.create.missingFunds=No tiene suficientes fondos para crear la propuesta.\nFaltan: {0} dao.feeTx.confirm=Confirm {0} transaction diff --git a/core/src/main/resources/i18n/displayStrings_fa.properties b/core/src/main/resources/i18n/displayStrings_fa.properties index 9ebaf2d434..fd5e2cbae0 100644 --- a/core/src/main/resources/i18n/displayStrings_fa.properties +++ b/core/src/main/resources/i18n/displayStrings_fa.properties @@ -701,7 +701,7 @@ funds.tx.noTxAvailable=هیچ تراکنشی موجود نیست funds.tx.revert=عودت funds.tx.txSent=تراکنش به طور موفقیت آمیز به یک آدرس جدید در کیف پول محلی Bisq ارسال شد. funds.tx.direction.self=ارسال شده به خودتان -funds.tx.proposal=پیشنهاد +funds.tx.proposalTxFee=پیشنهاد #################################################################### @@ -1356,8 +1356,8 @@ dao.tx.type.enum.LOCKUP=Lock up bond # suppress inspection "UnusedProperty" dao.tx.type.enum.UNLOCK=Unlock bond -dao.tx.issuance=درخواست/صدور خسارت -dao.tx.issuance.tooltip=درخواست خسارت که منجر به یک صدور BSQ جدید می شود.\nتاریخ صدور: {0} +dao.tx.issuanceFromCompReq=درخواست/صدور خسارت +dao.tx.issuanceFromCompReq.tooltip=درخواست خسارت که منجر به یک صدور BSQ جدید می شود.\nتاریخ صدور: {0} dao.proposal.create.missingFunds=شما وجوه کافی برای ایجاد پیشنهاد را ندارید.\nمقدار مورد نیاز: {0} dao.feeTx.confirm=Confirm {0} transaction diff --git a/core/src/main/resources/i18n/displayStrings_fr.properties b/core/src/main/resources/i18n/displayStrings_fr.properties index c87341ec94..ae5205124a 100644 --- a/core/src/main/resources/i18n/displayStrings_fr.properties +++ b/core/src/main/resources/i18n/displayStrings_fr.properties @@ -709,7 +709,7 @@ funds.tx.noTxAvailable=Aucune transaction disponible funds.tx.revert=Défaire funds.tx.txSent=Transaction envoyée avec succès à la nouvelle adresse dans le portefeuille local bisq. funds.tx.direction.self=Sent to yourself -funds.tx.proposal=Proposition +funds.tx.proposalTxFee=Proposition #################################################################### @@ -1076,8 +1076,8 @@ dao.tx.type.enum.BLIND_VOTE=Fee for blind vote dao.tx.type.enum.VOTE_REVEAL=Vote reveal dao.tx.type.enum.LOCK_UP=Lock bonds dao.tx.type.enum.UN_LOCK=Unlock bonds -dao.tx.issuance=Compensation request/issuance -dao.tx.issuance.tooltip=Compensation request which led to an issuance of new BSQ.\nIssuance date: {0} +dao.tx.issuanceFromCompReq=Compensation request/issuance +dao.tx.issuanceFromCompReq.tooltip=Compensation request which led to an issuance of new BSQ.\nIssuance date: {0} dao.proposal.create.confirm.info=Proposal fee: {0}\nMining fee: {1} ({2} satoshis/byte)\nTransaction size: {3} Kb\n\nAre you sure you want to publish the proposal? dao.proposal.create.missingFunds=You don''t have sufficient funds for creating the proposal.\nMissing: {0} diff --git a/core/src/main/resources/i18n/displayStrings_hu.properties b/core/src/main/resources/i18n/displayStrings_hu.properties index 3d8777fd68..7cf07cd230 100644 --- a/core/src/main/resources/i18n/displayStrings_hu.properties +++ b/core/src/main/resources/i18n/displayStrings_hu.properties @@ -701,7 +701,7 @@ funds.tx.noTxAvailable=Nincs hozzáférhető tranzakció funds.tx.revert=Visszaszállás funds.tx.txSent=Tranzakció sikeresen elküldve egy új címre a helyi Bisq pénztárcában. funds.tx.direction.self=Küld saját magadnak. -funds.tx.proposal=Kártérítési kérelem +funds.tx.proposalTxFee=Kártérítési kérelem #################################################################### @@ -1356,8 +1356,8 @@ dao.tx.type.enum.LOCKUP=Lock up bond # suppress inspection "UnusedProperty" dao.tx.type.enum.UNLOCK=Unlock bond -dao.tx.issuance=Compensation request/issuance -dao.tx.issuance.tooltip=Compensation request which led to an issuance of new BSQ.\nIssuance date: {0} +dao.tx.issuanceFromCompReq=Compensation request/issuance +dao.tx.issuanceFromCompReq.tooltip=Compensation request which led to an issuance of new BSQ.\nIssuance date: {0} dao.proposal.create.missingFunds=Nem rendelkezik elegendő összegekkel a kártérítési kérelem létrehozásához.\nHiányzó: {0} dao.feeTx.confirm=Confirm {0} transaction diff --git a/core/src/main/resources/i18n/displayStrings_pt.properties b/core/src/main/resources/i18n/displayStrings_pt.properties index 2e8cd786bf..449fc47d53 100644 --- a/core/src/main/resources/i18n/displayStrings_pt.properties +++ b/core/src/main/resources/i18n/displayStrings_pt.properties @@ -701,7 +701,7 @@ funds.tx.noTxAvailable=Sem transações disponíveis funds.tx.revert=Reverter funds.tx.txSent=Transação enviada com sucesso para um novo endereço em sua carteira Bisq local. funds.tx.direction.self=Enviar para você mesmo -funds.tx.proposal=Proposta +funds.tx.proposalTxFee=Proposta #################################################################### @@ -1356,8 +1356,8 @@ dao.tx.type.enum.LOCKUP=Lock up bond # suppress inspection "UnusedProperty" dao.tx.type.enum.UNLOCK=Unlock bond -dao.tx.issuance=Compensation request/issuance -dao.tx.issuance.tooltip=Compensation request which led to an issuance of new BSQ.\nIssuance date: {0} +dao.tx.issuanceFromCompReq=Compensation request/issuance +dao.tx.issuanceFromCompReq.tooltip=Compensation request which led to an issuance of new BSQ.\nIssuance date: {0} dao.proposal.create.missingFunds=You don''t have sufficient funds for creating the proposal.\nMissing: {0} dao.feeTx.confirm=Confirm {0} transaction diff --git a/core/src/main/resources/i18n/displayStrings_ro.properties b/core/src/main/resources/i18n/displayStrings_ro.properties index 7a65ddd31b..e6c829c28c 100644 --- a/core/src/main/resources/i18n/displayStrings_ro.properties +++ b/core/src/main/resources/i18n/displayStrings_ro.properties @@ -701,7 +701,7 @@ funds.tx.noTxAvailable=Nicio tranzacție disponibilă funds.tx.revert=Revenire funds.tx.txSent=Tranzacția a fost virată cu succes la o nouă adresă în portofelul Bisq local. funds.tx.direction.self=Trimite-ți ție -funds.tx.proposal=Solicitare de despăgubire +funds.tx.proposalTxFee=Solicitare de despăgubire #################################################################### @@ -1356,8 +1356,8 @@ dao.tx.type.enum.LOCKUP=Lock up bond # suppress inspection "UnusedProperty" dao.tx.type.enum.UNLOCK=Unlock bond -dao.tx.issuance=Compensation request/issuance -dao.tx.issuance.tooltip=Compensation request which led to an issuance of new BSQ.\nIssuance date: {0} +dao.tx.issuanceFromCompReq=Compensation request/issuance +dao.tx.issuanceFromCompReq.tooltip=Compensation request which led to an issuance of new BSQ.\nIssuance date: {0} dao.proposal.create.missingFunds=Nu ai suficiente fonduri pentru crearea solicitării de despăgubire.\nLipsesc: {0} dao.feeTx.confirm=Confirm {0} transaction diff --git a/core/src/main/resources/i18n/displayStrings_ru.properties b/core/src/main/resources/i18n/displayStrings_ru.properties index ccc24e0d25..9f405c2aaa 100644 --- a/core/src/main/resources/i18n/displayStrings_ru.properties +++ b/core/src/main/resources/i18n/displayStrings_ru.properties @@ -701,7 +701,7 @@ funds.tx.noTxAvailable=Транзакции недоступны funds.tx.revert=Возврат funds.tx.txSent=Транзакция успешно отправлена на новый адрес локального кошелька Bisq. funds.tx.direction.self=Транзакция внутри кошелька -funds.tx.proposal=Предложение +funds.tx.proposalTxFee=Предложение #################################################################### @@ -1356,8 +1356,8 @@ dao.tx.type.enum.LOCKUP=Запереть гарантийный депозит # suppress inspection "UnusedProperty" dao.tx.type.enum.UNLOCK=Отпереть гарантийный депозит -dao.tx.issuance=Запрос/выдача компенсации -dao.tx.issuance.tooltip=Запрос компенсации, который привел к выпуску новых BSQ.\nДата выпуска: {0} +dao.tx.issuanceFromCompReq=Запрос/выдача компенсации +dao.tx.issuanceFromCompReq.tooltip=Запрос компенсации, который привел к выпуску новых BSQ.\nДата выпуска: {0} dao.proposal.create.missingFunds=У Вас недостаточно средств для создания предложения.\nНехватает: {0} dao.feeTx.confirm=Подтвердить транзакцию {0} diff --git a/core/src/main/resources/i18n/displayStrings_sr.properties b/core/src/main/resources/i18n/displayStrings_sr.properties index a52de95b9a..7eea4a6a7f 100644 --- a/core/src/main/resources/i18n/displayStrings_sr.properties +++ b/core/src/main/resources/i18n/displayStrings_sr.properties @@ -701,7 +701,7 @@ funds.tx.noTxAvailable=Nema dostupnih transakcija funds.tx.revert=Vrati funds.tx.txSent=Transakcija uspešno poslata na novu adresu u lokalnom Bisq novčaniku funds.tx.direction.self=Transakcija unutar novčanika -funds.tx.proposal=Proposal +funds.tx.proposalTxFee=Proposal #################################################################### @@ -1356,8 +1356,8 @@ dao.tx.type.enum.LOCKUP=Lock up bond # suppress inspection "UnusedProperty" dao.tx.type.enum.UNLOCK=Unlock bond -dao.tx.issuance=Compensation request/issuance -dao.tx.issuance.tooltip=Compensation request which led to an issuance of new BSQ.\nIssuance date: {0} +dao.tx.issuanceFromCompReq=Compensation request/issuance +dao.tx.issuanceFromCompReq.tooltip=Compensation request which led to an issuance of new BSQ.\nIssuance date: {0} dao.proposal.create.missingFunds=You don''t have sufficient funds for creating the proposal.\nMissing: {0} dao.feeTx.confirm=Confirm {0} transaction diff --git a/core/src/main/resources/i18n/displayStrings_th.properties b/core/src/main/resources/i18n/displayStrings_th.properties index 7784448501..2588821413 100644 --- a/core/src/main/resources/i18n/displayStrings_th.properties +++ b/core/src/main/resources/i18n/displayStrings_th.properties @@ -701,7 +701,7 @@ funds.tx.noTxAvailable=ไม่มีธุรกรรมใด ๆ funds.tx.revert=กลับสู่สภาพเดิม funds.tx.txSent=ธุรกรรมถูกส่งสำเร็จไปยังที่อยู่ใหม่ใน Bisq wallet ท้องถิ่นแล้ว funds.tx.direction.self=ส่งถึงตัวคุณเอง -funds.tx.proposal=คำขอ +funds.tx.proposalTxFee=คำขอ #################################################################### @@ -1356,8 +1356,8 @@ dao.tx.type.enum.LOCKUP=Lock up bond # suppress inspection "UnusedProperty" dao.tx.type.enum.UNLOCK=Unlock bond -dao.tx.issuance=ค่าชดเชย คำขอ/การออก -dao.tx.issuance.tooltip=คำขอค่าชดเชยซึ่งนำไปสู่การออก BSQ ใหม่\nวันที่ออก: {0} +dao.tx.issuanceFromCompReq=ค่าชดเชย คำขอ/การออก +dao.tx.issuanceFromCompReq.tooltip=คำขอค่าชดเชยซึ่งนำไปสู่การออก BSQ ใหม่\nวันที่ออก: {0} dao.proposal.create.missingFunds=คุณไม่มีเงินเพียงพอสำหรับการสร้างข้อเสนอ\nขาดไป: {0} dao.feeTx.confirm=Confirm {0} transaction diff --git a/core/src/main/resources/i18n/displayStrings_vi.properties b/core/src/main/resources/i18n/displayStrings_vi.properties index 3dc7be94d9..ccf3b6ee19 100644 --- a/core/src/main/resources/i18n/displayStrings_vi.properties +++ b/core/src/main/resources/i18n/displayStrings_vi.properties @@ -701,7 +701,7 @@ funds.tx.noTxAvailable=Không có giao dịch nào funds.tx.revert=Khôi phục funds.tx.txSent=GIao dịch đã gửi thành công tới địa chỉ mới trong ví Bisq nội bộ. funds.tx.direction.self=Gửi cho chính bạn -funds.tx.proposal=Đề xuất +funds.tx.proposalTxFee=Đề xuất #################################################################### @@ -1356,8 +1356,8 @@ dao.tx.type.enum.LOCKUP=Lock up bond # suppress inspection "UnusedProperty" dao.tx.type.enum.UNLOCK=Unlock bond -dao.tx.issuance=Yêu cầu bồi thường/ban hành -dao.tx.issuance.tooltip=Yêu cầu bồi thường dẫn đến ban hành BSQ mới.\nNgày ban hành: {0} +dao.tx.issuanceFromCompReq=Yêu cầu bồi thường/ban hành +dao.tx.issuanceFromCompReq.tooltip=Yêu cầu bồi thường dẫn đến ban hành BSQ mới.\nNgày ban hành: {0} dao.proposal.create.missingFunds=Bạn không có đủ tiền để tạo đề xuất.\nThiếu: {0} dao.feeTx.confirm=Confirm {0} transaction diff --git a/core/src/main/resources/i18n/displayStrings_zh.properties b/core/src/main/resources/i18n/displayStrings_zh.properties index 616e6be285..fd21a8be07 100644 --- a/core/src/main/resources/i18n/displayStrings_zh.properties +++ b/core/src/main/resources/i18n/displayStrings_zh.properties @@ -701,7 +701,7 @@ funds.tx.noTxAvailable=没有可用交易 funds.tx.revert=还原 funds.tx.txSent=交易成功发送到本地Bisq钱包中的新地址。 funds.tx.direction.self=内部钱包交易 -funds.tx.proposal=Proposal +funds.tx.proposalTxFee=Proposal #################################################################### @@ -1356,8 +1356,8 @@ dao.tx.type.enum.LOCKUP=Lock up bond # suppress inspection "UnusedProperty" dao.tx.type.enum.UNLOCK=Unlock bond -dao.tx.issuance=补偿请求/发行 -dao.tx.issuance.tooltip=导致新BSQ发行的补偿请求\n发行日期: {0} +dao.tx.issuanceFromCompReq=补偿请求/发行 +dao.tx.issuanceFromCompReq.tooltip=导致新BSQ发行的补偿请求\n发行日期: {0} dao.proposal.create.missingFunds=You don''t have sufficient funds for creating the proposal.\nMissing: {0} dao.feeTx.confirm=Confirm {0} transaction 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 71b05b043e..0e60c19e46 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 @@ -35,6 +35,7 @@ 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.reimbursement.ReimbursementProposal; import bisq.core.dao.governance.proposal.removeAsset.RemoveAssetProposal; import bisq.core.dao.governance.proposal.role.BondedRoleProposal; import bisq.core.dao.governance.role.BondedRole; @@ -163,6 +164,7 @@ public class ProposalDisplay { switch (proposalType) { case COMPENSATION_REQUEST: + case REIMBURSEMENT_REQUEST: break; case CHANGE_PARAM: titledGroupBgRowSpan = 6; @@ -203,14 +205,21 @@ public class ProposalDisplay { int comboBoxValueTextFieldIndex = -1; switch (proposalType) { case COMPENSATION_REQUEST: + case REIMBURSEMENT_REQUEST: requestedBsqTextField = addLabelInputTextField(gridPane, ++gridRow, Res.get("dao.proposal.display.requestedBsq")).second; - BsqValidator bsqValidator = new BsqValidator(bsqFormatter); - bsqValidator.setMinValue(daoFacade.getMinCompensationRequestAmount()); - bsqValidator.setMaxValue(daoFacade.getMaxCompensationRequestAmount()); checkNotNull(requestedBsqTextField, "requestedBsqTextField must not be null"); - requestedBsqTextField.setValidator(bsqValidator); inputControls.add(requestedBsqTextField); + + BsqValidator bsqValidator = new BsqValidator(bsqFormatter); + if (proposalType == ProposalType.COMPENSATION_REQUEST) { + bsqValidator.setMinValue(daoFacade.getMinCompensationRequestAmount()); + bsqValidator.setMaxValue(daoFacade.getMaxCompensationRequestAmount()); + } else if (proposalType == ProposalType.REIMBURSEMENT_REQUEST) { + bsqValidator.setMinValue(daoFacade.getMinReimbursementRequestAmount()); + bsqValidator.setMaxValue(daoFacade.getMaxReimbursementRequestAmount()); + } + requestedBsqTextField.setValidator(bsqValidator); break; case CHANGE_PARAM: checkNotNull(gridPane, "gridPane must not be null"); @@ -445,6 +454,10 @@ public class ProposalDisplay { CompensationProposal compensationProposal = (CompensationProposal) proposal; checkNotNull(requestedBsqTextField, "requestedBsqTextField must not be null"); requestedBsqTextField.setText(bsqFormatter.formatCoinWithCode(compensationProposal.getRequestedBsq())); + } else if (proposal instanceof ReimbursementProposal) { + ReimbursementProposal reimbursementProposal = (ReimbursementProposal) proposal; + checkNotNull(requestedBsqTextField, "requestedBsqTextField must not be null"); + requestedBsqTextField.setText(bsqFormatter.formatCoinWithCode(reimbursementProposal.getRequestedBsq())); } else if (proposal instanceof ChangeParamProposal) { ChangeParamProposal changeParamProposal = (ChangeParamProposal) proposal; checkNotNull(paramComboBox, "paramComboBox must not be 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 d65c19c622..dfc2b88cc8 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 @@ -263,6 +263,12 @@ public class MakeProposalView extends ActivatableView implements return daoFacade.getCompensationProposalWithTransaction(proposalDisplay.nameTextField.getText(), proposalDisplay.linkInputTextField.getText(), bsqFormatter.parseToCoin(proposalDisplay.requestedBsqTextField.getText())); + case REIMBURSEMENT_REQUEST: + checkNotNull(proposalDisplay.requestedBsqTextField, + "proposalDisplay.requestedBsqTextField must not be null"); + return daoFacade.getReimbursementProposalWithTransaction(proposalDisplay.nameTextField.getText(), + proposalDisplay.linkInputTextField.getText(), + bsqFormatter.parseToCoin(proposalDisplay.requestedBsqTextField.getText())); case CHANGE_PARAM: checkNotNull(proposalDisplay.paramComboBox, "proposalDisplay.paramComboBox must no tbe null"); diff --git a/desktop/src/main/java/bisq/desktop/main/dao/governance/result/CycleListItem.java b/desktop/src/main/java/bisq/desktop/main/dao/governance/result/CycleListItem.java index 0861260a8e..e30bab448e 100644 --- a/desktop/src/main/java/bisq/desktop/main/dao/governance/result/CycleListItem.java +++ b/desktop/src/main/java/bisq/desktop/main/dao/governance/result/CycleListItem.java @@ -17,7 +17,7 @@ package bisq.desktop.main.dao.governance.result; -import bisq.core.dao.governance.proposal.compensation.CompensationProposal; +import bisq.core.dao.governance.proposal.IssuanceProposal; import bisq.core.dao.governance.voteresult.EvaluatedProposal; import bisq.core.dao.state.DaoStateService; import bisq.core.locale.Res; @@ -75,8 +75,8 @@ public class CycleListItem { public String getIssuance() { long totalIssuance = resultsOfCycle.getEvaluatedProposals().stream() .filter(EvaluatedProposal::isAccepted) - .filter(e -> e.getProposal() instanceof CompensationProposal) - .map(e -> (CompensationProposal) e.getProposal()) + .filter(e -> e.getProposal() instanceof IssuanceProposal) + .map(e -> (IssuanceProposal) e.getProposal()) .mapToLong(e -> e.getRequestedBsq().value) .sum(); return bsqFormatter.formatCoinWithCode(Coin.valueOf(totalIssuance)); 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 1b7996f8b1..f84cdbdbcd 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 @@ -25,6 +25,7 @@ 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.reimbursement.ReimbursementProposal; import bisq.core.dao.governance.proposal.removeAsset.RemoveAssetProposal; import bisq.core.dao.governance.proposal.role.BondedRoleProposal; import bisq.core.dao.governance.role.BondedRole; @@ -110,6 +111,10 @@ public class ProposalListItem { CompensationProposal compensationProposal = (CompensationProposal) proposal; Coin requestedBsq = evaluatedProposal.isAccepted() ? compensationProposal.getRequestedBsq() : Coin.ZERO; return bsqFormatter.formatCoinWithCode(requestedBsq); + case REIMBURSEMENT_REQUEST: + ReimbursementProposal reimbursementProposal = (ReimbursementProposal) proposal; + requestedBsq = evaluatedProposal.isAccepted() ? reimbursementProposal.getRequestedBsq() : Coin.ZERO; + return bsqFormatter.formatCoinWithCode(requestedBsq); case CHANGE_PARAM: ChangeParamProposal changeParamProposal = (ChangeParamProposal) proposal; return changeParamProposal.getParam().getDisplayString(); diff --git a/desktop/src/main/java/bisq/desktop/main/dao/wallet/dashboard/BsqDashboardView.java b/desktop/src/main/java/bisq/desktop/main/dao/wallet/dashboard/BsqDashboardView.java index 2912c077e9..513aeddef0 100644 --- a/desktop/src/main/java/bisq/desktop/main/dao/wallet/dashboard/BsqDashboardView.java +++ b/desktop/src/main/java/bisq/desktop/main/dao/wallet/dashboard/BsqDashboardView.java @@ -26,6 +26,7 @@ import bisq.desktop.util.Layout; import bisq.core.dao.DaoFacade; import bisq.core.dao.state.DaoStateListener; import bisq.core.dao.state.blockchain.Block; +import bisq.core.dao.state.governance.IssuanceType; import bisq.core.locale.Res; import bisq.core.monetary.Altcoin; import bisq.core.monetary.Price; @@ -60,10 +61,10 @@ public class BsqDashboardView extends ActivatableView implements private final BsqFormatter bsqFormatter; private int gridRow = 0; - private TextField genesisIssueAmountTextField, compRequestIssueAmountTextField, availableAmountTextField, + private TextField genesisIssueAmountTextField, compRequestIssueAmountTextField, reimbursementAmountTextField, availableAmountTextField, burntAmountTextField, totalLockedUpAmountTextField, totalUnlockingAmountTextField, - totalUnlockedAmountTextField, allTxTextField, burntTxTextField, utxoTextField, issuanceTxTextField, - priceTextField, marketCapTextField; + totalUnlockedAmountTextField, allTxTextField, burntTxTextField, utxoTextField, compensationIssuanceTxTextField, + reimbursementIssuanceTxTextField, priceTextField, marketCapTextField; private ChangeListener priceChangeListener; private HyperlinkWithIcon hyperlinkWithIcon; @@ -89,10 +90,11 @@ public class BsqDashboardView extends ActivatableView implements public void initialize() { gridRow = bsqBalanceUtil.addGroup(root, gridRow); - addTitledGroupBg(root, ++gridRow, 4, Res.get("dao.wallet.dashboard.distribution"), Layout.GROUP_DISTANCE); + addTitledGroupBg(root, ++gridRow, 5, Res.get("dao.wallet.dashboard.distribution"), Layout.GROUP_DISTANCE); genesisIssueAmountTextField = addLabelTextField(root, gridRow, Res.get("dao.wallet.dashboard.genesisIssueAmount"), Layout.FIRST_ROW_AND_GROUP_DISTANCE).second; compRequestIssueAmountTextField = addLabelTextField(root, ++gridRow, Res.get("dao.wallet.dashboard.compRequestIssueAmount")).second; + reimbursementAmountTextField = addLabelTextField(root, ++gridRow, Res.get("dao.wallet.dashboard.reimbursementAmount")).second; burntAmountTextField = addLabelTextField(root, ++gridRow, Res.get("dao.wallet.dashboard.burntAmount")).second; availableAmountTextField = addLabelTextField(root, ++gridRow, Res.get("dao.wallet.dashboard.availableAmount")).second; @@ -107,7 +109,7 @@ public class BsqDashboardView extends ActivatableView implements marketCapTextField = addLabelTextField(root, ++gridRow, Res.get("dao.wallet.dashboard.marketCap")).second; - addTitledGroupBg(root, ++gridRow, 6, Res.get("dao.wallet.dashboard.txDetails"), Layout.GROUP_DISTANCE); + addTitledGroupBg(root, ++gridRow, 7, Res.get("dao.wallet.dashboard.txDetails"), Layout.GROUP_DISTANCE); addLabelTextField(root, gridRow, Res.get("dao.wallet.dashboard.genesisBlockHeight"), String.valueOf(daoFacade.getGenesisBlockHeight()), Layout.FIRST_ROW_AND_GROUP_DISTANCE); hyperlinkWithIcon = addLabelHyperlinkWithIcon(root, ++gridRow, Res.get("dao.wallet.dashboard.genesisTxId"), @@ -115,7 +117,8 @@ public class BsqDashboardView extends ActivatableView implements hyperlinkWithIcon.setTooltip(new Tooltip(Res.get("tooltip.openBlockchainForTx", daoFacade.getGenesisTxId()))); allTxTextField = addLabelTextField(root, ++gridRow, Res.get("dao.wallet.dashboard.allTx")).second; utxoTextField = addLabelTextField(root, ++gridRow, Res.get("dao.wallet.dashboard.utxo")).second; - issuanceTxTextField = addLabelTextField(root, ++gridRow, Res.get("dao.wallet.dashboard.issuanceTx")).second; + compensationIssuanceTxTextField = addLabelTextField(root, ++gridRow, Res.get("dao.wallet.dashboard.compensationIssuanceTx")).second; + reimbursementIssuanceTxTextField = addLabelTextField(root, ++gridRow, Res.get("dao.wallet.dashboard.reimbursementIssuanceTx")).second; burntTxTextField = addLabelTextField(root, ++gridRow, Res.get("dao.wallet.dashboard.burntTx")).second; priceChangeListener = (observable, oldValue, newValue) -> updatePrice(); @@ -166,8 +169,10 @@ public class BsqDashboardView extends ActivatableView implements Coin issuedAmountFromGenesis = daoFacade.getGenesisTotalSupply(); genesisIssueAmountTextField.setText(bsqFormatter.formatAmountWithGroupSeparatorAndCode(issuedAmountFromGenesis)); - Coin issuedAmountFromCompRequests = Coin.valueOf(daoFacade.getTotalIssuedAmountFromCompRequests()); + Coin issuedAmountFromCompRequests = Coin.valueOf(daoFacade.getTotalIssuedAmount(IssuanceType.COMPENSATION)); compRequestIssueAmountTextField.setText(bsqFormatter.formatAmountWithGroupSeparatorAndCode(issuedAmountFromCompRequests)); + Coin issuedAmountFromReimbursementRequests = Coin.valueOf(daoFacade.getTotalIssuedAmount(IssuanceType.REIMBURSEMENT)); + reimbursementAmountTextField.setText(bsqFormatter.formatAmountWithGroupSeparatorAndCode(issuedAmountFromReimbursementRequests)); Coin burntFee = Coin.valueOf(daoFacade.getTotalBurntFee()); Coin totalLockedUpAmount = Coin.valueOf(daoFacade.getTotalLockupAmount()); @@ -182,7 +187,8 @@ public class BsqDashboardView extends ActivatableView implements totalUnlockedAmountTextField.setText(bsqFormatter.formatAmountWithGroupSeparatorAndCode(totalUnlockedAmount)); allTxTextField.setText(String.valueOf(daoFacade.getTxs().size())); utxoTextField.setText(String.valueOf(daoFacade.getUnspentTxOutputs().size())); - issuanceTxTextField.setText(String.valueOf(daoFacade.getIssuanceSet().size())); + compensationIssuanceTxTextField.setText(String.valueOf(daoFacade.getNumIssuanceTransactions(IssuanceType.COMPENSATION))); + reimbursementIssuanceTxTextField.setText(String.valueOf(daoFacade.getNumIssuanceTransactions(IssuanceType.REIMBURSEMENT))); burntTxTextField.setText(String.valueOf(daoFacade.getFeeTxs().size())); } diff --git a/desktop/src/main/java/bisq/desktop/main/dao/wallet/tx/BsqTxView.java b/desktop/src/main/java/bisq/desktop/main/dao/wallet/tx/BsqTxView.java index 45873a4973..7ee026462e 100644 --- a/desktop/src/main/java/bisq/desktop/main/dao/wallet/tx/BsqTxView.java +++ b/desktop/src/main/java/bisq/desktop/main/dao/wallet/tx/BsqTxView.java @@ -35,6 +35,7 @@ import bisq.core.dao.DaoFacade; import bisq.core.dao.state.DaoStateListener; import bisq.core.dao.state.blockchain.Block; import bisq.core.dao.state.blockchain.TxType; +import bisq.core.dao.state.governance.IssuanceType; import bisq.core.locale.Res; import bisq.core.user.Preferences; import bisq.core.util.BsqFormatter; @@ -369,11 +370,19 @@ public class BsqTxView extends ActivatableView implements BsqBal Label label; if (item.getConfirmations() > 0 && txType.ordinal() > TxType.INVALID.ordinal()) { if (txType == TxType.COMPENSATION_REQUEST && - daoFacade.isIssuanceTx(item.getTxId())) { + daoFacade.isIssuanceTx(item.getTxId(), IssuanceType.COMPENSATION)) { if (field != null) field.setOnAction(null); - labelString = Res.get("dao.tx.issuance"); + labelString = Res.get("dao.tx.issuanceFromCompReq"); + label = new AutoTooltipLabel(labelString); + setGraphic(label); + } else if (txType == TxType.REIMBURSEMENT_REQUEST && + daoFacade.isIssuanceTx(item.getTxId(), IssuanceType.REIMBURSEMENT)) { + if (field != null) + field.setOnAction(null); + + labelString = Res.get("dao.tx.issuanceFromReimbursement"); label = new AutoTooltipLabel(labelString); setGraphic(label); } else if (item.isBurnedBsqTx() || item.getAmount().isZero()) { @@ -535,13 +544,27 @@ public class BsqTxView extends ActivatableView implements BsqBal case PROPOSAL: case COMPENSATION_REQUEST: String txId = item.getTxId(); - if (daoFacade.isIssuanceTx(txId)) { + if (daoFacade.isIssuanceTx(txId, IssuanceType.COMPENSATION)) { awesomeIcon = AwesomeIcon.MONEY; style = "dao-tx-type-issuance-icon"; int issuanceBlockHeight = daoFacade.getIssuanceBlockHeight(txId); long blockTime = daoFacade.getBlockTime(issuanceBlockHeight); String formattedDate = bsqFormatter.formatDateTime(new Date(blockTime)); - toolTipText = Res.get("dao.tx.issuance.tooltip", formattedDate); + toolTipText = Res.get("dao.tx.issuanceFromCompReq.tooltip", formattedDate); + } else { + awesomeIcon = AwesomeIcon.FILE_TEXT; + style = "dao-tx-type-proposal-fee-icon"; + } + break; + case REIMBURSEMENT_REQUEST: + txId = item.getTxId(); + if (daoFacade.isIssuanceTx(txId, IssuanceType.REIMBURSEMENT)) { + awesomeIcon = AwesomeIcon.MONEY; + style = "dao-tx-type-issuance-icon"; + int issuanceBlockHeight = daoFacade.getIssuanceBlockHeight(txId); + long blockTime = daoFacade.getBlockTime(issuanceBlockHeight); + String formattedDate = bsqFormatter.formatDateTime(new Date(blockTime)); + toolTipText = Res.get("dao.tx.issuanceFromReimbursement.tooltip", formattedDate); } else { awesomeIcon = AwesomeIcon.FILE_TEXT; style = "dao-tx-type-proposal-fee-icon"; diff --git a/desktop/src/main/java/bisq/desktop/main/funds/transactions/TransactionsListItem.java b/desktop/src/main/java/bisq/desktop/main/funds/transactions/TransactionsListItem.java index e63d20f075..44270ef0cb 100644 --- a/desktop/src/main/java/bisq/desktop/main/funds/transactions/TransactionsListItem.java +++ b/desktop/src/main/java/bisq/desktop/main/funds/transactions/TransactionsListItem.java @@ -132,10 +132,15 @@ class TransactionsListItem { outgoing = false; txFeeForBsqPayment = true; - // - final Optional txTypeOptional = daoFacade.getOptionalTxType(txId); - if (txTypeOptional.isPresent() && txTypeOptional.get().equals(TxType.COMPENSATION_REQUEST)) - details = Res.get("funds.tx.proposal"); + Optional txTypeOptional = daoFacade.getOptionalTxType(txId); + if (txTypeOptional.isPresent()) { + if (txTypeOptional.get().equals(TxType.COMPENSATION_REQUEST)) + details = Res.get("funds.tx.compensationRequestTxFee"); + else if (txTypeOptional.get().equals(TxType.REIMBURSEMENT_REQUEST)) + details = Res.get("funds.tx.reimbursementRequestTxFee"); + else + details = Res.get("funds.tx.proposalTxFee"); + } } else { outgoing = true; } From c4637688566e6576a973ac83be85263703e21e90 Mon Sep 17 00:00:00 2001 From: sqrrm Date: Wed, 24 Oct 2018 18:28:08 -0500 Subject: [PATCH 2/9] Add comment Co-Authored-By: ManfredKarrer --- core/src/main/java/bisq/core/btc/wallet/BtcWalletService.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/main/java/bisq/core/btc/wallet/BtcWalletService.java b/core/src/main/java/bisq/core/btc/wallet/BtcWalletService.java index 145efee40e..cff029e41c 100644 --- a/core/src/main/java/bisq/core/btc/wallet/BtcWalletService.java +++ b/core/src/main/java/bisq/core/btc/wallet/BtcWalletService.java @@ -191,7 +191,7 @@ public class BtcWalletService extends WalletService { // BSQ change outputs from BSQ fee inputs. feeTx.getOutputs().forEach(preparedTx::addOutput); - // + // For generic proposals there is no issuance output, for compensation and reimburse requests there is if (issuanceAmount != null && issuanceAddress != null) { // BSQ issuance output preparedTx.addOutput(issuanceAmount, issuanceAddress); From 7be08fee9cb918adca785ab21c1f6d7467511251 Mon Sep 17 00:00:00 2001 From: sqrrm Date: Wed, 24 Oct 2018 18:28:33 -0500 Subject: [PATCH 3/9] FIx typo Co-Authored-By: ManfredKarrer --- .../dao/governance/voteresult/issuance/IssuanceService.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/main/java/bisq/core/dao/governance/voteresult/issuance/IssuanceService.java b/core/src/main/java/bisq/core/dao/governance/voteresult/issuance/IssuanceService.java index a6daf34a1c..1e1bf3e5e7 100644 --- a/core/src/main/java/bisq/core/dao/governance/voteresult/issuance/IssuanceService.java +++ b/core/src/main/java/bisq/core/dao/governance/voteresult/issuance/IssuanceService.java @@ -65,7 +65,7 @@ public class IssuanceService { } else if (issuanceProposal instanceof ReimbursementProposal) { issuanceType = IssuanceType.REIMBURSEMENT; } - checkArgument(issuanceType != IssuanceType.UNDEFINED, "issuanceType must nto be undefined"); + checkArgument(issuanceType != IssuanceType.UNDEFINED, "issuanceType must not be undefined"); // We don't check atm if the output is unspent. We cannot use the bsqWallet as that would not // reflect our current block state (could have been spent at later block which is valid and From f6e6512c9ed9d4f2d4aa3a4e51466da68e540808 Mon Sep 17 00:00:00 2001 From: Devin Bileck <603793+devinbileck@users.noreply.github.com> Date: Wed, 24 Oct 2018 23:40:24 -0700 Subject: [PATCH 4/9] Refine unix install script --- doc/install_on_unix.sh | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/doc/install_on_unix.sh b/doc/install_on_unix.sh index 40b7bbd5c4..cce35a0fc6 100755 --- a/doc/install_on_unix.sh +++ b/doc/install_on_unix.sh @@ -1,13 +1,22 @@ #!/bin/sh -# not tested script based on what @devinbileck posted in https://github.com/bisq-network/bisq/issues/1791 +JAVA_HOME=/usr/lib/jvm/openjdk-10.0.2 -curl -L -O https://download.java.net/java/GA/jdk10/10.0.2/19aef61b38124481863b1413dce1855f/13/openjdk-10.0.2_linux-x64_bin.tar.gz -sudo mkdir /usr/local/jvm/openjdk-10 -sudo tar -zxf openjdk-10.0.2_linux-x64_bin.tar.gz -C /usr/local/jvm/openjdk-10 -sudo update-alternatives --install "/usr/bin/java" "java" "/usr/local/jvm/openjdk-10/jdk-10.0.2/bin/java" 1500 -sudo update-alternatives --install "/usr/bin/javac" "javac" "/usr/local/jvm/openjdk-10/jdk-10.0.2/bin/javac" 1500 -git clone https://github.com/bisq-network/bisq +if [ ! -d "$JAVA_HOME" ]; then + apt-get -y install curl + + curl -L -O https://download.java.net/java/GA/jdk10/10.0.2/19aef61b38124481863b1413dce1855f/13/openjdk-10.0.2_linux-x64_bin.tar.gz + mkdir -p $JAVA_HOME + tar -zxf openjdk-10.0.2_linux-x64_bin.tar.gz -C $JAVA_HOME --strip 1 + rm openjdk-10.0.2_linux-x64_bin.tar.gz + + update-alternatives --install /usr/bin/java java $JAVA_HOME/bin/java 2000 + update-alternatives --install /usr/bin/javac javac $JAVA_HOME/bin/javac 2000 +fi + +if [ ! -d "bisq" ]; then + apt-get -y install git + git clone https://github.com/bisq-network/bisq.git +fi cd bisq ./gradlew build -java -jar desktop/build/libs/desktop-0.8.0-SNAPSHOT-all.jar From 6b10cf707242cf0abb4181c4fd570f75bb06030b Mon Sep 17 00:00:00 2001 From: Manfred Karrer Date: Thu, 25 Oct 2018 19:59:10 -0500 Subject: [PATCH 5/9] Merge branch 'redesign' of https://github.com/ripcurlx/bisq-desktop into ripcurlx-redesign # Conflicts: # desktop/src/main/java/bisq/desktop/main/dao/governance/ProposalDisplay.java # desktop/src/main/java/bisq/desktop/main/dao/wallet/dashboard/BsqDashboardView.java --- desktop/src/main/java/bisq/desktop/bisq.css | 39 +++++++++++-------- .../desktop/components/BalanceTextField.java | 3 +- .../desktop/components/PasswordTextField.java | 2 +- .../paymentmethods/CashDepositForm.java | 1 - .../main/dao/governance/ProposalDisplay.java | 1 - .../dashboard/ProposalDashboardView.java | 2 +- .../dao/governance/make/MakeProposalView.java | 6 +-- .../governance/proposals/ProposalsView.java | 1 - .../main/dao/wallet/BsqBalanceUtil.java | 1 - .../wallet/dashboard/BsqDashboardView.java | 2 +- .../main/dao/wallet/send/BsqSendView.java | 1 - .../funds/transactions/TransactionsView.fxml | 2 +- .../main/funds/withdrawal/WithdrawalView.fxml | 2 +- .../main/funds/withdrawal/WithdrawalView.java | 3 +- .../overlays/windows/EmptyWalletWindow.java | 2 +- .../windows/SelectDepositTxWindow.java | 3 +- .../closedtrades/ClosedTradesView.java | 1 - .../portfolio/pendingtrades/TradeSubView.java | 1 - .../steps/seller/SellerStep3View.java | 2 +- .../main/settings/about/AboutView.java | 2 +- .../settings/network/NetworkSettingsView.java | 1 - .../java/bisq/desktop/util/FormBuilder.java | 6 +-- 22 files changed, 40 insertions(+), 44 deletions(-) diff --git a/desktop/src/main/java/bisq/desktop/bisq.css b/desktop/src/main/java/bisq/desktop/bisq.css index a0a6647c81..2b97a16b37 100644 --- a/desktop/src/main/java/bisq/desktop/bisq.css +++ b/desktop/src/main/java/bisq/desktop/bisq.css @@ -98,7 +98,7 @@ bg color of non edit textFields: fafafa -bs-rd-white: #ffffff; /* 30 usages */ -bs-rd-white-transparent: rgba(255, 255, 255, 0.31); -bs-rd-grey-light: #D8D8D8; - -bs-rd-grey-medium-light:#E9E9E9; + -bs-rd-grey-medium-light: #E9E9E9; -bs-rd-grey-very-light: #f8f8f8; /* 10 usages */ -bs-rd-grey-background: #F2F2F2; -bs-rd-grey-background-bottom: #f6f6f6; /* 1 usages */ @@ -232,7 +232,7 @@ bg color of non edit textFields: fafafa } .jfx-progress-bar > .bar, -.jfx-progress-bar:indeterminate > .bar{ +.jfx-progress-bar:indeterminate > .bar { -fx-background-color: -bs-rd-green; } @@ -241,7 +241,7 @@ bg color of non edit textFields: fafafa } .jfx-spinner:indeterminate .arc, -.jfx-spinner:determinate .arc{ +.jfx-spinner:determinate .arc { -fx-stroke: -bs-rd-green; } @@ -254,7 +254,7 @@ bg color of non edit textFields: fafafa -fx-pref-height: 32; -fx-min-height: -fx-pref-height; -fx-padding: 0 40 0 40; - -fx-effect: dropshadow( gaussian, -bs-rd-black-transparent, 2, 0, 0, 0, 1); + -fx-effect: dropshadow(gaussian, -bs-rd-black-transparent, 2, 0, 0, 0, 1); } .action-button { @@ -280,7 +280,7 @@ bg color of non edit textFields: fafafa -fx-pref-height: 12; } -.jfx-check-box .mark , +.jfx-check-box .mark, .jfx-check-box .indeterminate-mark { -fx-border-radius: 0; -fx-border-width: 1; @@ -289,7 +289,7 @@ bg color of non edit textFields: fafafa .jfx-combo-box { -jfx-focus-color: -bs-rd-green; -jfx-unfocus-color: -bs-rd-grey-line; - -fx-background-color:-bs-rd-white; + -fx-background-color: -bs-rd-white; } .jfx-combo-box > .list-cell { @@ -305,7 +305,7 @@ bg color of non edit textFields: fafafa .jfx-text-field { -jfx-focus-color: -bs-rd-green; - -fx-background-color:-bs-rd-white; + -fx-background-color: -bs-rd-white; -fx-background-radius: 3 3 0 0; } @@ -394,7 +394,7 @@ bg color of non edit textFields: fafafa } .input-with-border { - -fx-background-color:-bs-rd-white; + -fx-background-color: -bs-rd-white; -fx-border-width: 1; -fx-border-color: -bs-rd-grey-background-dark; -fx-border-radius: 3; @@ -417,48 +417,55 @@ bg color of non edit textFields: fafafa } .input-with-border .icon { - -fx-padding:10; + -fx-padding: 10; } -.scroll-bar{ +.scroll-bar { -fx-background-color: transparent; -fx-background-radius: 0; } + .scroll-bar:horizontal .track, .scroll-bar:vertical .track { -fx-background-color: transparent; - -fx-border-color:transparent; + -fx-border-color: transparent; -fx-background-radius: 0; } + .scroll-bar:vertical .track-background, .scroll-bar:horizontal .track-background { -fx-background-color: transparent; -fx-background-insets: 0; -fx-background-radius: 0; } + .scroll-bar:horizontal .thumb { -fx-background-color: -bs-rd-grey-background-darker; -fx-background-insets: 2 0 2 0; -fx-background-radius: 3; } + .scroll-bar:vertical .thumb { -fx-background-color: -bs-rd-grey-background-darker; -fx-background-insets: 0 2 0 2; -fx-background-radius: 3; } + .scroll-bar:horizontal .thumb:hover, .scroll-bar:vertical .thumb:hover { -fx-background-color: -bs-rd-grey-background-darker-2; } + .scroll-bar:horizontal .thumb:pressed, .scroll-bar:vertical .thumb:pressed { -fx-background-color: -bs-rd-grey-background-darkest; } + .scroll-bar:vertical .increment-button, .scroll-bar:vertical .decrement-button, .scroll-bar:horizontal .increment-button, .scroll-bar:horizontal .decrement-button { - -fx-background-color:transparent; + -fx-background-color: transparent; -fx-padding: 1; } @@ -472,7 +479,7 @@ bg color of non edit textFields: fafafa .scroll-bar:vertical:focused, .scroll-bar:horizontal:focused { - -fx-background-color: transparent, -bs-rd-grey-background-darkest,-bs-rd-grey-background-darkest; + -fx-background-color: transparent, -bs-rd-grey-background-darkest, -bs-rd-grey-background-darkest; } /* Behavior */ @@ -758,11 +765,11 @@ textfield */ } .table-view .filler { - -fx-background-color:-bs-rd-grey-very-light; + -fx-background-color: -bs-rd-grey-very-light; } .table-view { - -fx-control-inner-background-alt: -fx-control-inner-background ; + -fx-control-inner-background-alt: -fx-control-inner-background; } .table-view .column-header .label { @@ -1589,7 +1596,7 @@ textfield */ } #price-feed-combo { - -fx-background-color:none; + -fx-background-color: none; } #price-feed-combo > .list-cell { diff --git a/desktop/src/main/java/bisq/desktop/components/BalanceTextField.java b/desktop/src/main/java/bisq/desktop/components/BalanceTextField.java index e10d250abf..6e18416892 100644 --- a/desktop/src/main/java/bisq/desktop/components/BalanceTextField.java +++ b/desktop/src/main/java/bisq/desktop/components/BalanceTextField.java @@ -23,7 +23,6 @@ import org.bitcoinj.core.Coin; import com.jfoenix.controls.JFXTextField; -import javafx.scene.control.TextField; import javafx.scene.effect.BlurType; import javafx.scene.effect.DropShadow; import javafx.scene.effect.Effect; @@ -86,7 +85,7 @@ public class BalanceTextField extends AnchorPane { if (formatter != null) textField.setText(formatter.formatCoinWithCode(balance)); - //TODO: replace with new validation logic + //TODO: replace with new validation logic // if (targetAmount != null) { // if (balance.compareTo(targetAmount) >= 0) // textField.setEffect(fundedEffect); diff --git a/desktop/src/main/java/bisq/desktop/components/PasswordTextField.java b/desktop/src/main/java/bisq/desktop/components/PasswordTextField.java index a845acf494..8495fbb017 100644 --- a/desktop/src/main/java/bisq/desktop/components/PasswordTextField.java +++ b/desktop/src/main/java/bisq/desktop/components/PasswordTextField.java @@ -19,7 +19,7 @@ package bisq.desktop.components; import com.jfoenix.controls.JFXPasswordField; -public class PasswordTextField extends JFXPasswordField{ +public class PasswordTextField extends JFXPasswordField { public PasswordTextField() { super(); setLabelFloat(true); diff --git a/desktop/src/main/java/bisq/desktop/components/paymentmethods/CashDepositForm.java b/desktop/src/main/java/bisq/desktop/components/paymentmethods/CashDepositForm.java index d58734c482..63adc8564c 100644 --- a/desktop/src/main/java/bisq/desktop/components/paymentmethods/CashDepositForm.java +++ b/desktop/src/main/java/bisq/desktop/components/paymentmethods/CashDepositForm.java @@ -318,7 +318,6 @@ public class CashDepositForm extends GeneralBankForm { } - private void onCountrySelected(Country country) { selectedCountry = country; if (selectedCountry != null) { 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 a414879849..1313fe0a6c 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 @@ -88,7 +88,6 @@ import javax.annotation.Nullable; import static bisq.desktop.util.FormBuilder.addInputTextField; import static bisq.desktop.util.FormBuilder.addLabelHyperlinkWithIcon; -import static bisq.desktop.util.FormBuilder.addTopLabelTextField; import static bisq.desktop.util.FormBuilder.addTitledGroupBg; import static bisq.desktop.util.FormBuilder.addTopLabelTextField; import static com.google.common.base.Preconditions.checkNotNull; diff --git a/desktop/src/main/java/bisq/desktop/main/dao/governance/dashboard/ProposalDashboardView.java b/desktop/src/main/java/bisq/desktop/main/dao/governance/dashboard/ProposalDashboardView.java index e0dbabc62c..841d8460c0 100644 --- a/desktop/src/main/java/bisq/desktop/main/dao/governance/dashboard/ProposalDashboardView.java +++ b/desktop/src/main/java/bisq/desktop/main/dao/governance/dashboard/ProposalDashboardView.java @@ -40,9 +40,9 @@ import java.text.SimpleDateFormat; import java.util.Date; import java.util.Locale; -import static bisq.desktop.util.FormBuilder.addTopLabelTextField; import static bisq.desktop.util.FormBuilder.addMultilineLabel; import static bisq.desktop.util.FormBuilder.addTitledGroupBg; +import static bisq.desktop.util.FormBuilder.addTopLabelTextField; // We use here ChainHeightListener because we are interested in period changes not in the result of a completed // block. The event from the ChainHeightListener is sent before parsing starts. 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 cbc80da79c..2cea9e3d45 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 @@ -46,6 +46,8 @@ import bisq.core.locale.Res; import bisq.core.util.BSFormatter; import bisq.core.util.BsqFormatter; +import bisq.asset.Asset; + import bisq.network.p2p.P2PService; import bisq.common.app.DevEnv; @@ -77,10 +79,6 @@ 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 DaoStateListener { private final DaoFacade daoFacade; diff --git a/desktop/src/main/java/bisq/desktop/main/dao/governance/proposals/ProposalsView.java b/desktop/src/main/java/bisq/desktop/main/dao/governance/proposals/ProposalsView.java index 08a8a85864..9023a6c2a7 100644 --- a/desktop/src/main/java/bisq/desktop/main/dao/governance/proposals/ProposalsView.java +++ b/desktop/src/main/java/bisq/desktop/main/dao/governance/proposals/ProposalsView.java @@ -30,7 +30,6 @@ import bisq.desktop.components.TxIdTextField; import bisq.desktop.main.dao.governance.PhasesView; import bisq.desktop.main.dao.governance.ProposalDisplay; import bisq.desktop.main.overlays.popups.Popup; -import bisq.desktop.util.FormBuilder; import bisq.desktop.util.GUIUtil; import bisq.desktop.util.Layout; import bisq.desktop.util.validation.BsqValidator; diff --git a/desktop/src/main/java/bisq/desktop/main/dao/wallet/BsqBalanceUtil.java b/desktop/src/main/java/bisq/desktop/main/dao/wallet/BsqBalanceUtil.java index 70065db597..54f2fbb87b 100644 --- a/desktop/src/main/java/bisq/desktop/main/dao/wallet/BsqBalanceUtil.java +++ b/desktop/src/main/java/bisq/desktop/main/dao/wallet/BsqBalanceUtil.java @@ -26,7 +26,6 @@ import bisq.core.btc.wallet.BsqWalletService; import bisq.core.locale.Res; import bisq.core.util.BsqFormatter; -import bisq.common.util.Tuple2; import bisq.common.util.Tuple3; import org.bitcoinj.core.Coin; diff --git a/desktop/src/main/java/bisq/desktop/main/dao/wallet/dashboard/BsqDashboardView.java b/desktop/src/main/java/bisq/desktop/main/dao/wallet/dashboard/BsqDashboardView.java index b01c99bb5d..abc45da648 100644 --- a/desktop/src/main/java/bisq/desktop/main/dao/wallet/dashboard/BsqDashboardView.java +++ b/desktop/src/main/java/bisq/desktop/main/dao/wallet/dashboard/BsqDashboardView.java @@ -49,8 +49,8 @@ import javafx.scene.layout.GridPane; import javafx.beans.value.ChangeListener; import static bisq.desktop.util.FormBuilder.addLabelHyperlinkWithIcon; -import static bisq.desktop.util.FormBuilder.addTopLabelTextField; import static bisq.desktop.util.FormBuilder.addTitledGroupBg; +import static bisq.desktop.util.FormBuilder.addTopLabelTextField; @FxmlView public class BsqDashboardView extends ActivatableView implements DaoStateListener { diff --git a/desktop/src/main/java/bisq/desktop/main/dao/wallet/send/BsqSendView.java b/desktop/src/main/java/bisq/desktop/main/dao/wallet/send/BsqSendView.java index 32bf31b231..8aa062f88a 100644 --- a/desktop/src/main/java/bisq/desktop/main/dao/wallet/send/BsqSendView.java +++ b/desktop/src/main/java/bisq/desktop/main/dao/wallet/send/BsqSendView.java @@ -27,7 +27,6 @@ import bisq.desktop.main.dao.wallet.BsqBalanceUtil; import bisq.desktop.main.funds.FundsView; import bisq.desktop.main.funds.deposit.DepositView; import bisq.desktop.main.overlays.popups.Popup; -import bisq.desktop.util.FormBuilder; import bisq.desktop.util.GUIUtil; import bisq.desktop.util.Layout; import bisq.desktop.util.validation.BsqAddressValidator; diff --git a/desktop/src/main/java/bisq/desktop/main/funds/transactions/TransactionsView.fxml b/desktop/src/main/java/bisq/desktop/main/funds/transactions/TransactionsView.fxml index 32503954f5..934241f61b 100644 --- a/desktop/src/main/java/bisq/desktop/main/funds/transactions/TransactionsView.fxml +++ b/desktop/src/main/java/bisq/desktop/main/funds/transactions/TransactionsView.fxml @@ -17,11 +17,11 @@ ~ along with Bisq. If not, see . --> + - diff --git a/desktop/src/main/java/bisq/desktop/main/funds/withdrawal/WithdrawalView.fxml b/desktop/src/main/java/bisq/desktop/main/funds/withdrawal/WithdrawalView.fxml index 49895a0e3f..425101d1b0 100644 --- a/desktop/src/main/java/bisq/desktop/main/funds/withdrawal/WithdrawalView.fxml +++ b/desktop/src/main/java/bisq/desktop/main/funds/withdrawal/WithdrawalView.fxml @@ -17,6 +17,7 @@ ~ along with Bisq. If not, see . --> + @@ -27,7 +28,6 @@ - diff --git a/desktop/src/main/java/bisq/desktop/main/funds/withdrawal/WithdrawalView.java b/desktop/src/main/java/bisq/desktop/main/funds/withdrawal/WithdrawalView.java index 93af2a5e77..db0c45c55b 100644 --- a/desktop/src/main/java/bisq/desktop/main/funds/withdrawal/WithdrawalView.java +++ b/desktop/src/main/java/bisq/desktop/main/funds/withdrawal/WithdrawalView.java @@ -30,8 +30,8 @@ import bisq.desktop.util.GUIUtil; import bisq.core.btc.exceptions.AddressEntryException; import bisq.core.btc.exceptions.InsufficientFundsException; import bisq.core.btc.listeners.BalanceListener; -import bisq.core.btc.setup.WalletsSetup; import bisq.core.btc.model.AddressEntry; +import bisq.core.btc.setup.WalletsSetup; import bisq.core.btc.wallet.BtcWalletService; import bisq.core.btc.wallet.Restrictions; import bisq.core.locale.Res; @@ -65,7 +65,6 @@ import de.jensd.fx.fontawesome.AwesomeIcon; import javafx.fxml.FXML; -import javafx.scene.control.Button; import javafx.scene.control.CheckBox; import javafx.scene.control.Label; import javafx.scene.control.RadioButton; diff --git a/desktop/src/main/java/bisq/desktop/main/overlays/windows/EmptyWalletWindow.java b/desktop/src/main/java/bisq/desktop/main/overlays/windows/EmptyWalletWindow.java index ae4f0409eb..0632e2eaea 100644 --- a/desktop/src/main/java/bisq/desktop/main/overlays/windows/EmptyWalletWindow.java +++ b/desktop/src/main/java/bisq/desktop/main/overlays/windows/EmptyWalletWindow.java @@ -61,8 +61,8 @@ import java.util.concurrent.TimeUnit; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import static bisq.desktop.util.FormBuilder.addTopLabelTextField; import static bisq.desktop.util.FormBuilder.addMultilineLabel; +import static bisq.desktop.util.FormBuilder.addTopLabelTextField; public class EmptyWalletWindow extends Overlay { private static final Logger log = LoggerFactory.getLogger(EmptyWalletWindow.class); diff --git a/desktop/src/main/java/bisq/desktop/main/overlays/windows/SelectDepositTxWindow.java b/desktop/src/main/java/bisq/desktop/main/overlays/windows/SelectDepositTxWindow.java index 8e88647b3e..6777184b48 100644 --- a/desktop/src/main/java/bisq/desktop/main/overlays/windows/SelectDepositTxWindow.java +++ b/desktop/src/main/java/bisq/desktop/main/overlays/windows/SelectDepositTxWindow.java @@ -93,7 +93,8 @@ public class SelectDepositTxWindow extends Overlay { Label label = addMultilineLabel(gridPane, ++rowIndex, Res.get("selectDepositTxWindow.msg"), 10); GridPane.setMargin(label, new Insets(0, 0, 10, 0)); - transactionsComboBox = FormBuilder.addComboBox(gridPane, ++rowIndex, Res.get("selectDepositTxWindow.select"));; + transactionsComboBox = FormBuilder.addComboBox(gridPane, ++rowIndex, Res.get("selectDepositTxWindow.select")); + ; transactionsComboBox.setConverter(new StringConverter<>() { @Override public String toString(Transaction transaction) { diff --git a/desktop/src/main/java/bisq/desktop/main/portfolio/closedtrades/ClosedTradesView.java b/desktop/src/main/java/bisq/desktop/main/portfolio/closedtrades/ClosedTradesView.java index a3fa2ec6c4..577282c8c1 100644 --- a/desktop/src/main/java/bisq/desktop/main/portfolio/closedtrades/ClosedTradesView.java +++ b/desktop/src/main/java/bisq/desktop/main/portfolio/closedtrades/ClosedTradesView.java @@ -54,7 +54,6 @@ import javafx.fxml.FXML; import javafx.stage.Stage; import javafx.scene.Node; -import javafx.scene.control.Button; import javafx.scene.control.TableCell; import javafx.scene.control.TableColumn; import javafx.scene.control.TableView; diff --git a/desktop/src/main/java/bisq/desktop/main/portfolio/pendingtrades/TradeSubView.java b/desktop/src/main/java/bisq/desktop/main/portfolio/pendingtrades/TradeSubView.java index 203a6b6f4f..d22b01408f 100644 --- a/desktop/src/main/java/bisq/desktop/main/portfolio/pendingtrades/TradeSubView.java +++ b/desktop/src/main/java/bisq/desktop/main/portfolio/pendingtrades/TradeSubView.java @@ -26,7 +26,6 @@ import bisq.desktop.util.Layout; import bisq.core.locale.Res; -import javafx.scene.control.Button; import javafx.scene.control.Label; import javafx.scene.layout.AnchorPane; import javafx.scene.layout.GridPane; diff --git a/desktop/src/main/java/bisq/desktop/main/portfolio/pendingtrades/steps/seller/SellerStep3View.java b/desktop/src/main/java/bisq/desktop/main/portfolio/pendingtrades/steps/seller/SellerStep3View.java index 45a4f462ea..e1be63ac4a 100644 --- a/desktop/src/main/java/bisq/desktop/main/portfolio/pendingtrades/steps/seller/SellerStep3View.java +++ b/desktop/src/main/java/bisq/desktop/main/portfolio/pendingtrades/steps/seller/SellerStep3View.java @@ -60,8 +60,8 @@ import org.fxmisc.easybind.Subscription; import java.util.Optional; import static bisq.desktop.util.FormBuilder.addButtonBusyAnimationLabelAfterGroup; -import static bisq.desktop.util.FormBuilder.addTopLabelTextFieldWithCopyIcon; import static bisq.desktop.util.FormBuilder.addTitledGroupBg; +import static bisq.desktop.util.FormBuilder.addTopLabelTextFieldWithCopyIcon; public class SellerStep3View extends TradeStepView { diff --git a/desktop/src/main/java/bisq/desktop/main/settings/about/AboutView.java b/desktop/src/main/java/bisq/desktop/main/settings/about/AboutView.java index 769e79f318..004ba29f76 100644 --- a/desktop/src/main/java/bisq/desktop/main/settings/about/AboutView.java +++ b/desktop/src/main/java/bisq/desktop/main/settings/about/AboutView.java @@ -38,8 +38,8 @@ import javafx.geometry.HPos; import static bisq.desktop.util.FormBuilder.addHyperlinkWithIcon; import static bisq.desktop.util.FormBuilder.addLabel; -import static bisq.desktop.util.FormBuilder.addTopLabelTextField; import static bisq.desktop.util.FormBuilder.addTitledGroupBg; +import static bisq.desktop.util.FormBuilder.addTopLabelTextField; @FxmlView public class AboutView extends ActivatableViewAndModel { diff --git a/desktop/src/main/java/bisq/desktop/main/settings/network/NetworkSettingsView.java b/desktop/src/main/java/bisq/desktop/main/settings/network/NetworkSettingsView.java index e921d4f7ed..504e2ffd35 100644 --- a/desktop/src/main/java/bisq/desktop/main/settings/network/NetworkSettingsView.java +++ b/desktop/src/main/java/bisq/desktop/main/settings/network/NetworkSettingsView.java @@ -50,7 +50,6 @@ import javax.inject.Inject; import javafx.fxml.FXML; -import javafx.scene.control.Button; import javafx.scene.control.CheckBox; import javafx.scene.control.Label; import javafx.scene.control.RadioButton; diff --git a/desktop/src/main/java/bisq/desktop/util/FormBuilder.java b/desktop/src/main/java/bisq/desktop/util/FormBuilder.java index f8c73d5f13..6f5dfb75b8 100644 --- a/desktop/src/main/java/bisq/desktop/util/FormBuilder.java +++ b/desktop/src/main/java/bisq/desktop/util/FormBuilder.java @@ -757,9 +757,9 @@ public class FormBuilder { } @NotNull - public static Tuple2 getTopLabelWithVBox(GridPane gridPane, int rowIndex, - String title, Node node, - double top) { + public static Tuple2 getTopLabelWithVBox(GridPane gridPane, int rowIndex, + String title, Node node, + double top) { Label label = getTopLabel(title); VBox vBox = getTopLabelVBox(0); vBox.getChildren().addAll(label, node); From fb4c0f5105dc5fbf6d4002937ffde737abf8281e Mon Sep 17 00:00:00 2001 From: Manfred Karrer Date: Thu, 25 Oct 2018 20:11:29 -0500 Subject: [PATCH 6/9] Fix merge errors --- .../main/dao/wallet/dashboard/BsqDashboardView.java | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/desktop/src/main/java/bisq/desktop/main/dao/wallet/dashboard/BsqDashboardView.java b/desktop/src/main/java/bisq/desktop/main/dao/wallet/dashboard/BsqDashboardView.java index abc45da648..4ad6f6d2e4 100644 --- a/desktop/src/main/java/bisq/desktop/main/dao/wallet/dashboard/BsqDashboardView.java +++ b/desktop/src/main/java/bisq/desktop/main/dao/wallet/dashboard/BsqDashboardView.java @@ -170,8 +170,10 @@ public class BsqDashboardView extends ActivatableView implements Coin issuedAmountFromGenesis = daoFacade.getGenesisTotalSupply(); genesisIssueAmountTextField.setText(bsqFormatter.formatAmountWithGroupSeparatorAndCode(issuedAmountFromGenesis)); - Coin issuedAmountFromCompRequests = Coin.valueOf(daoFacade.getTotalIssuedAmountFromCompRequests()); + Coin issuedAmountFromCompRequests = Coin.valueOf(daoFacade.getTotalIssuedAmount(IssuanceType.COMPENSATION)); compRequestIssueAmountTextField.setText(bsqFormatter.formatAmountWithGroupSeparatorAndCode(issuedAmountFromCompRequests)); + Coin issuedAmountFromReimbursementRequests = Coin.valueOf(daoFacade.getTotalIssuedAmount(IssuanceType.REIMBURSEMENT)); + reimbursementAmountTextField.setText(bsqFormatter.formatAmountWithGroupSeparatorAndCode(issuedAmountFromReimbursementRequests)); Coin burntFee = Coin.valueOf(daoFacade.getTotalBurntFee()); Coin totalLockedUpAmount = Coin.valueOf(daoFacade.getTotalLockupAmount()); @@ -186,10 +188,6 @@ public class BsqDashboardView extends ActivatableView implements totalUnlockedAmountTextField.setText(bsqFormatter.formatAmountWithGroupSeparatorAndCode(totalUnlockedAmount)); allTxTextField.setText(String.valueOf(daoFacade.getTxs().size())); utxoTextField.setText(String.valueOf(daoFacade.getUnspentTxOutputs().size())); - compensationIssuanceTxTextField.setText(String.valueOf(daoFacade.getIssuanceSet().size())); - Coin issuedAmountFromCompRequests = Coin.valueOf(daoFacade.getTotalIssuedAmount(IssuanceType.COMPENSATION)); - Coin issuedAmountFromReimbursementRequests = Coin.valueOf(daoFacade.getTotalIssuedAmount(IssuanceType.REIMBURSEMENT)); - reimbursementAmountTextField.setText(bsqFormatter.formatAmountWithGroupSeparatorAndCode(issuedAmountFromReimbursementRequests)); compensationIssuanceTxTextField.setText(String.valueOf(daoFacade.getNumIssuanceTransactions(IssuanceType.COMPENSATION))); reimbursementIssuanceTxTextField.setText(String.valueOf(daoFacade.getNumIssuanceTransactions(IssuanceType.REIMBURSEMENT))); burntTxTextField.setText(String.valueOf(daoFacade.getFeeTxs().size())); From 2953b989d1bfb096212aa890551186e71f299322 Mon Sep 17 00:00:00 2001 From: Manfred Karrer Date: Thu, 25 Oct 2018 21:14:49 -0500 Subject: [PATCH 7/9] Fix tab navigation issue --- .../main/java/bisq/desktop/main/account/AccountView.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/desktop/src/main/java/bisq/desktop/main/account/AccountView.java b/desktop/src/main/java/bisq/desktop/main/account/AccountView.java index 8c45b90575..c991be418e 100644 --- a/desktop/src/main/java/bisq/desktop/main/account/AccountView.java +++ b/desktop/src/main/java/bisq/desktop/main/account/AccountView.java @@ -106,9 +106,7 @@ public class AccountView extends ActivatableView { }; tabChangeListener = (ov, oldValue, newValue) -> { - if (arbitratorRegistrationTab != null) { - navigation.navigateTo(MainView.class, AccountView.class, ArbitratorRegistrationView.class); - } else if (newValue == fiatAccountsTab) { + if (newValue == fiatAccountsTab) { navigation.navigateTo(MainView.class, AccountView.class, FiatAccountsView.class); } else if (newValue == altcoinAccountsTab) { navigation.navigateTo(MainView.class, AccountView.class, AltCoinAccountsView.class); @@ -120,6 +118,8 @@ public class AccountView extends ActivatableView { navigation.navigateTo(MainView.class, AccountView.class, SeedWordsView.class); } else if (newValue == backupTab) { navigation.navigateTo(MainView.class, AccountView.class, BackupView.class); + } else if (newValue == arbitratorRegistrationTab) { + navigation.navigateTo(MainView.class, AccountView.class, ArbitratorRegistrationView.class); } else { navigation.navigateTo(MainView.class, AccountView.class, FiatAccountsView.class); } From 80cb50a717f8bdc969de2f721e235d03724af8b1 Mon Sep 17 00:00:00 2001 From: Manfred Karrer Date: Thu, 25 Oct 2018 21:16:21 -0500 Subject: [PATCH 8/9] Remove colons, remove progressbar style in dao phases --- .../resources/i18n/displayStrings.properties | 98 +++++++++---------- .../components/SeparatedPhaseBars.java | 1 - .../bonding/roles/BondedRoleTypeWindow.java | 10 +- .../main/dao/governance/ProposalDisplay.java | 12 +-- .../dao/governance/make/MakeProposalView.java | 2 +- .../governance/proposals/ProposalsView.java | 8 +- .../main/dao/wallet/BsqBalanceUtil.java | 12 +-- .../dao/wallet/receive/BsqReceiveView.java | 2 +- 8 files changed, 72 insertions(+), 73 deletions(-) diff --git a/core/src/main/resources/i18n/displayStrings.properties b/core/src/main/resources/i18n/displayStrings.properties index 2ec5a6580e..7bc7426d8f 100644 --- a/core/src/main/resources/i18n/displayStrings.properties +++ b/core/src/main/resources/i18n/displayStrings.properties @@ -210,8 +210,8 @@ mainView.menu.account=Account mainView.menu.dao=DAO mainView.marketPrice.provider=Price by -mainView.marketPrice.label=Market Price -mainView.marketPriceWithProvider.label=Market Price by {0} +mainView.marketPrice.label=Market price +mainView.marketPriceWithProvider.label=Market price by {0} mainView.marketPrice.tooltip.provider=The displayed price is provided by {0} mainView.marketPrice.bisqInternalPrice=Price of latest Bisq trade mainView.marketPrice.tooltip.bisqInternalPrice=There is no market price from external price feed providers available.\n\ @@ -842,14 +842,14 @@ setting.preferences.useCustomValue=Use custom value setting.preferences.txFeeMin=Transaction fee must be at least {0} satoshis/byte setting.preferences.txFeeTooLarge=Your input is above any reasonable value (>5000 satoshis/byte). Transaction fee is usually in the range of 50-400 satoshis/byte. setting.preferences.ignorePeers=Ignore peers with onion address (comma sep.) -setting.preferences.refererId=Referral ID: +setting.preferences.refererId=Referral ID setting.preferences.refererId.prompt=Optional referral ID setting.preferences.currenciesInList=Currencies in market price feed list -setting.preferences.prefCurrency=Preferred currency: +setting.preferences.prefCurrency=Preferred currency setting.preferences.displayFiat=Display national currencies setting.preferences.noFiat=There are no national currencies selected setting.preferences.cannotRemovePrefCurrency=You cannot remove your selected preferred display currency -setting.preferences.displayAltcoins=Display altcoins: +setting.preferences.displayAltcoins=Display altcoins setting.preferences.noAltcoins=There are no altcoins selected setting.preferences.addFiat=Add national currency setting.preferences.addAltcoin=Add altcoin @@ -863,7 +863,7 @@ settings.preferences.languageChange=To apply the language change to all screens settings.preferences.arbitrationLanguageWarning=In case of a dispute, please note that arbitration is handled in {0}. settings.preferences.selectCurrencyNetwork=Select network setting.preferences.daoOptions=DAO options -setting.preferences.dao.resync.label=Rebuild DAO state from genesis tx: +setting.preferences.dao.resync.label=Rebuild DAO state from genesis tx setting.preferences.dao.resync.button=Resync setting.preferences.dao.resync.popup=After an application restart the BSQ consensus state will be rebuilt from the genesis transaction. setting.preferences.dao.isDaoFullNode=Run Bisq as DAO full node @@ -963,7 +963,7 @@ account.menu.seedWords=Wallet seed account.menu.backup=Backup account.menu.notifications=Notifications -account.arbitratorRegistration.pubKey=Public key: +account.arbitratorRegistration.pubKey=Public key account.arbitratorRegistration.register=Register arbitrator account.arbitratorRegistration.revoke=Revoke registration @@ -1175,12 +1175,12 @@ dao.proposal.menuItem.vote=Vote on proposals dao.proposal.menuItem.result=Vote results dao.cycle.headline=Voting cycle dao.cycle.overview.headline=Voting cycle overview -dao.cycle.currentPhase=Current phase: -dao.cycle.currentBlockHeight=Current block height: -dao.cycle.proposal=Proposal phase: -dao.cycle.blindVote=Blind vote phase: -dao.cycle.voteReveal=Vote reveal phase: -dao.cycle.voteResult=Vote result: +dao.cycle.currentPhase=Current phase +dao.cycle.currentBlockHeight=Current block height +dao.cycle.proposal=Proposal phase +dao.cycle.blindVote=Blind vote phase +dao.cycle.voteReveal=Vote reveal phase +dao.cycle.voteResult=Vote result dao.cycle.phaseDuration={0} blocks (≈{1}); Block {2} - {3} (≈{4} - ≈{5}) dao.cycle.info.headline=Information @@ -1310,10 +1310,10 @@ dao.bonding.menuItem.bondedRoles=Bonded roles dao.bonding.menuItem.lockupBSQ=Lockup BSQ dao.bonding.menuItem.unlockBSQ=Unlock BSQ dao.bonding.lock.lockBSQ=Lockup BSQ -dao.bonding.lock.amount=Amount of BSQ to lockup: -dao.bonding.lock.time=Unlock time in blocks: -dao.bonding.lock.type=Type of bond: -dao.bonding.lock.bondedRoles=Bonded roles: +dao.bonding.lock.amount=Amount of BSQ to lockup +dao.bonding.lock.time=Unlock time in blocks +dao.bonding.lock.type=Type of bond +dao.bonding.lock.bondedRoles=Bonded roles dao.bonding.lock.setAmount=Set BSQ amount to lockup (min. amount is {0}) dao.bonding.lock.setTime=Number of blocks when locked funds become spendable after the unlock transaction ({0} - {1}) dao.bonding.lock.lockupButton=Lockup @@ -1324,8 +1324,8 @@ dao.bonding.unlock.unlock=Unlock dao.bonding.unlock.sendTx.headline=Confirm unlock transaction dao.bonding.unlock.sendTx.details=Unlock amount: {0}\nLockup time: {1} block(s)\n\nAre you sure you want to proceed? dao.bonding.dashboard.bondsHeadline=Bonded BSQ -dao.bonding.dashboard.lockupAmount=Lockup funds: -dao.bonding.dashboard.unlockingAmount=Unlocking funds (wait until lock time is over): +dao.bonding.dashboard.lockupAmount=Lockup funds +dao.bonding.dashboard.unlockingAmount=Unlocking funds (wait until lock time is over) # suppress inspection "UnusedProperty" dao.bond.lockupType.BONDED_ROLE=Bonded role @@ -1444,15 +1444,15 @@ dao.proposal.create.createNew=Make new proposal dao.proposal.create.create.button=Make proposal dao.proposal=proposal dao.proposal.display.type=Proposal type -dao.proposal.display.name=Name/nickname: -dao.proposal.display.link=Link to detail info: +dao.proposal.display.name=Name/nickname +dao.proposal.display.link=Link to detail info dao.proposal.display.link.prompt=Link to Github issue (https://github.com/bisq-network/compensation/issues) -dao.proposal.display.requestedBsq=Requested amount in BSQ: -dao.proposal.display.bsqAddress=BSQ address: -dao.proposal.display.txId=Proposal transaction ID: -dao.proposal.display.proposalFee=Proposal fee: -dao.proposal.display.myVote=My vote: -dao.proposal.display.voteResult=Vote result summary: +dao.proposal.display.requestedBsq=Requested amount in BSQ +dao.proposal.display.bsqAddress=BSQ address +dao.proposal.display.txId=Proposal transaction ID +dao.proposal.display.proposalFee=Proposal fee +dao.proposal.display.myVote=My vote +dao.proposal.display.voteResult=Vote result summary dao.proposal.display.bondedRoleComboBox.label=Bonded role type dao.proposal.display.requiredBondForRole.label=Required bond for role dao.proposal.display.tickerSymbol.label=Ticker Symbol @@ -1472,7 +1472,7 @@ dao.proposal.voteResult.failed=Rejected dao.proposal.voteResult.summary=Result: {0}; Threshold: {1} (required > {2}); Quorum: {3} (required > {4}) dao.proposal.display.paramComboBox.label=Parameter -dao.proposal.display.paramValue=Parameter value: +dao.proposal.display.paramValue=Parameter value dao.proposal.display.confiscateBondComboBox.label=Choose bond dao.proposal.display.assetComboBox.label=Asset to remove @@ -1491,23 +1491,23 @@ dao.wallet.dashboard.distribution=Distribution of all BSQ dao.wallet.dashboard.locked=Global state of locked BSQ dao.wallet.dashboard.market=Market data dao.wallet.dashboard.txDetails=BSQ transactions details -dao.wallet.dashboard.genesisBlockHeight=Genesis block height: -dao.wallet.dashboard.genesisTxId=Genesis transaction ID: -dao.wallet.dashboard.genesisIssueAmount=BSQ issued at genesis transaction: -dao.wallet.dashboard.compRequestIssueAmount=BSQ issued for compensation requests: -dao.wallet.dashboard.reimbursementAmount=BSQ issued for reimbursement requests: -dao.wallet.dashboard.availableAmount=Total available BSQ: -dao.wallet.dashboard.burntAmount=Burned BSQ (fees): -dao.wallet.dashboard.totalLockedUpAmount=Locked up in bonds: -dao.wallet.dashboard.totalUnlockingAmount=Unlocking BSQ from bonds: -dao.wallet.dashboard.totalUnlockedAmount=Unlocked BSQ from bonds: -dao.wallet.dashboard.allTx=No. of all BSQ transactions: -dao.wallet.dashboard.utxo=No. of all unspent transaction outputs: -dao.wallet.dashboard.compensationIssuanceTx=No. of all compensation request issuance transactions: -dao.wallet.dashboard.reimbursementIssuanceTx=No. of all reimbursement request issuance transactions: -dao.wallet.dashboard.burntTx=No. of all fee payments transactions: -dao.wallet.dashboard.price=Latest BSQ/BTC trade price (in Bisq): -dao.wallet.dashboard.marketCap=Market capitalisation (based on trade price): +dao.wallet.dashboard.genesisBlockHeight=Genesis block height +dao.wallet.dashboard.genesisTxId=Genesis transaction ID +dao.wallet.dashboard.genesisIssueAmount=BSQ issued at genesis transaction +dao.wallet.dashboard.compRequestIssueAmount=BSQ issued for compensation requests +dao.wallet.dashboard.reimbursementAmount=BSQ issued for reimbursement requests +dao.wallet.dashboard.availableAmount=Total available BSQ +dao.wallet.dashboard.burntAmount=Burned BSQ (fees) +dao.wallet.dashboard.totalLockedUpAmount=Locked up in bonds +dao.wallet.dashboard.totalUnlockingAmount=Unlocking BSQ from bonds +dao.wallet.dashboard.totalUnlockedAmount=Unlocked BSQ from bonds +dao.wallet.dashboard.allTx=No. of all BSQ transactions +dao.wallet.dashboard.utxo=No. of all unspent transaction outputs +dao.wallet.dashboard.compensationIssuanceTx=No. of all compensation request issuance transactions +dao.wallet.dashboard.reimbursementIssuanceTx=No. of all reimbursement request issuance transactions +dao.wallet.dashboard.burntTx=No. of all fee payments transactions +dao.wallet.dashboard.price=Latest BSQ/BTC trade price (in Bisq) +dao.wallet.dashboard.marketCap=Market capitalisation (based on trade price) dao.wallet.receive.fundBSQWallet=Fund Bisq BSQ wallet dao.wallet.receive.fundYourWallet=Fund your BSQ wallet @@ -1515,12 +1515,12 @@ dao.wallet.receive.bsqAddress=BSQ address dao.wallet.send.sendFunds=Send funds dao.wallet.send.sendBtcFunds=Send non-BSQ funds (BTC) -dao.wallet.send.amount=Amount in BSQ: -dao.wallet.send.btcAmount=Amount in BTC (non-BSQ funds): +dao.wallet.send.amount=Amount in BSQ +dao.wallet.send.btcAmount=Amount in BTC (non-BSQ funds) dao.wallet.send.setAmount=Set amount to withdraw (min. amount is {0}) dao.wallet.send.setBtcAmount=Set amount in BTC to withdraw (min. amount is {0}) -dao.wallet.send.receiverAddress=Receiver's BSQ address: -dao.wallet.send.receiverBtcAddress=Receiver's BTC address: +dao.wallet.send.receiverAddress=Receiver's BSQ address +dao.wallet.send.receiverBtcAddress=Receiver's BTC address dao.wallet.send.setDestinationAddress=Fill in your destination address dao.wallet.send.send=Send BSQ funds dao.wallet.send.sendBtc=Send BTC funds diff --git a/desktop/src/main/java/bisq/desktop/components/SeparatedPhaseBars.java b/desktop/src/main/java/bisq/desktop/components/SeparatedPhaseBars.java index 5b17bdbbfb..d74283c2ee 100644 --- a/desktop/src/main/java/bisq/desktop/components/SeparatedPhaseBars.java +++ b/desktop/src/main/java/bisq/desktop/components/SeparatedPhaseBars.java @@ -69,7 +69,6 @@ public class SeparatedPhaseBars extends VBox { ProgressBar progressBar = new ProgressBar(); progressBar.setMinHeight(9); progressBar.setMaxHeight(9); - progressBar.setStyle("-fx-accent: -bs-green;"); progressBar.progressProperty().bind(item.progressProperty); progressBar.setOpacity(item.isShowBlocks() ? 1 : 0.25); progressBars.getChildren().add(progressBar); diff --git a/desktop/src/main/java/bisq/desktop/main/dao/bonding/roles/BondedRoleTypeWindow.java b/desktop/src/main/java/bisq/desktop/main/dao/bonding/roles/BondedRoleTypeWindow.java index b3fed0d065..bc5f164c7c 100644 --- a/desktop/src/main/java/bisq/desktop/main/dao/bonding/roles/BondedRoleTypeWindow.java +++ b/desktop/src/main/java/bisq/desktop/main/dao/bonding/roles/BondedRoleTypeWindow.java @@ -74,19 +74,19 @@ class BondedRoleTypeWindow extends Overlay { } private void addContent() { - FormBuilder.addTopLabelTextField(gridPane, ++rowIndex, Res.getWithCol("dao.bond.bondedRoleType.details.role"), + FormBuilder.addTopLabelTextField(gridPane, ++rowIndex, Res.get("dao.bond.bondedRoleType.details.role"), bondedRoleType.getDisplayString()); - FormBuilder.addTopLabelTextField(gridPane, ++rowIndex, Res.getWithCol("dao.bond.bondedRoleType.details.requiredBond"), + FormBuilder.addTopLabelTextField(gridPane, ++rowIndex, Res.get("dao.bond.bondedRoleType.details.requiredBond"), bsqFormatter.formatCoinWithCode(Coin.valueOf(bondedRoleType.getRequiredBond()))); - FormBuilder.addTopLabelTextField(gridPane, ++rowIndex, Res.getWithCol("dao.bond.bondedRoleType.details.unlockTime"), + FormBuilder.addTopLabelTextField(gridPane, ++rowIndex, Res.get("dao.bond.bondedRoleType.details.unlockTime"), Res.get("dao.bond.bondedRoleType.details.blocks", bondedRoleType.getUnlockTime())); - FormBuilder.addLabelHyperlinkWithIcon(gridPane, ++rowIndex, Res.getWithCol("dao.bond.bondedRoleType.details.link"), + FormBuilder.addLabelHyperlinkWithIcon(gridPane, ++rowIndex, Res.get("dao.bond.bondedRoleType.details.link"), bondedRoleType.getLink(), bondedRoleType.getLink()); - FormBuilder.addTopLabelTextField(gridPane, ++rowIndex, Res.getWithCol("dao.bond.bondedRoleType.details.isSingleton"), + FormBuilder.addTopLabelTextField(gridPane, ++rowIndex, Res.get("dao.bond.bondedRoleType.details.isSingleton"), bsqFormatter.booleanToYesNo(bondedRoleType.isAllowMultipleHolders())); } } 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 1313fe0a6c..cd2fdc7376 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 @@ -183,7 +183,7 @@ public class ProposalDisplay { titledGroupBg = addTitledGroupBg(gridPane, gridRow, titledGroupBgRowSpan, title, top); double proposalTypeTop = top == Layout.GROUP_DISTANCE ? Layout.FIRST_ROW_AND_GROUP_DISTANCE : Layout.FIRST_ROW_DISTANCE; proposalTypeTextField = FormBuilder.addTopLabelTextField(gridPane, gridRow, - Res.getWithCol("dao.proposal.display.type"), proposalType.getDisplayName(), proposalTypeTop).second; + Res.get("dao.proposal.display.type"), proposalType.getDisplayName(), proposalTypeTop).second; nameTextField = addInputTextField(gridPane, ++gridRow, Res.get("dao.proposal.display.name")); nameTextField.setValidator(new InputValidator()); @@ -222,7 +222,7 @@ public class ProposalDisplay { case CHANGE_PARAM: checkNotNull(gridPane, "gridPane must not be null"); paramComboBox = FormBuilder.addComboBox(gridPane, ++gridRow, - Res.getWithCol("dao.proposal.display.paramComboBox.label")); + Res.get("dao.proposal.display.paramComboBox.label")); comboBoxValueTextFieldIndex = gridRow; checkNotNull(paramComboBox, "paramComboBox must not be null"); List list = Arrays.stream(Param.values()) @@ -260,7 +260,7 @@ public class ProposalDisplay { break; case BONDED_ROLE: bondedRoleTypeComboBox = FormBuilder.addComboBox(gridPane, ++gridRow, - Res.getWithCol("dao.proposal.display.bondedRoleComboBox.label")); + Res.get("dao.proposal.display.bondedRoleComboBox.label")); comboBoxValueTextFieldIndex = gridRow; checkNotNull(bondedRoleTypeComboBox, "bondedRoleTypeComboBox must not be null"); bondedRoleTypeComboBox.setItems(FXCollections.observableArrayList(BondedRoleType.values())); @@ -277,7 +277,7 @@ public class ProposalDisplay { }); comboBoxes.add(bondedRoleTypeComboBox); requiredBondForRoleTextField = addTopLabelTextField(gridPane, ++gridRow, - Res.getWithCol("dao.proposal.display.requiredBondForRole.label")).second; + Res.get("dao.proposal.display.requiredBondForRole.label")).second; requiredBondForRoleListener = (observable, oldValue, newValue) -> { if (newValue != null) { @@ -289,7 +289,7 @@ public class ProposalDisplay { break; case CONFISCATE_BOND: confiscateBondComboBox = FormBuilder.addComboBox(gridPane, ++gridRow, - Res.getWithCol("dao.proposal.display.confiscateBondComboBox.label")); + Res.get("dao.proposal.display.confiscateBondComboBox.label")); comboBoxValueTextFieldIndex = gridRow; checkNotNull(confiscateBondComboBox, "confiscateBondComboBox must not be null"); confiscateBondComboBox.setItems(FXCollections.observableArrayList(daoFacade.getValidBondedRoleList())); @@ -310,7 +310,7 @@ public class ProposalDisplay { break; case REMOVE_ASSET: assetComboBox = FormBuilder.addComboBox(gridPane, ++gridRow, - Res.getWithCol("dao.proposal.display.assetComboBox.label")); + Res.get("dao.proposal.display.assetComboBox.label")); comboBoxValueTextFieldIndex = gridRow; checkNotNull(assetComboBox, "assetComboBox must not be null"); List assetList = CurrencyUtil.getAssetRegistry().stream() 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 2cea9e3d45..56ad6bb2d3 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 @@ -130,7 +130,7 @@ public class MakeProposalView extends ActivatableView implements addTitledGroupBg(root, ++gridRow, 1, Res.get("dao.proposal.create.selectProposalType"), Layout.GROUP_DISTANCE); proposalTypeComboBox = FormBuilder.addComboBox(root, gridRow, - Res.getWithCol("dao.proposal.create.proposalType"), Layout.FIRST_ROW_AND_GROUP_DISTANCE); + Res.get("dao.proposal.create.proposalType"), Layout.FIRST_ROW_AND_GROUP_DISTANCE); proposalTypeComboBox.setConverter(new StringConverter<>() { @Override public String toString(ProposalType proposalType) { diff --git a/desktop/src/main/java/bisq/desktop/main/dao/governance/proposals/ProposalsView.java b/desktop/src/main/java/bisq/desktop/main/dao/governance/proposals/ProposalsView.java index 9023a6c2a7..b878aafc62 100644 --- a/desktop/src/main/java/bisq/desktop/main/dao/governance/proposals/ProposalsView.java +++ b/desktop/src/main/java/bisq/desktop/main/dao/governance/proposals/ProposalsView.java @@ -667,7 +667,7 @@ public class ProposalsView extends ActivatableView implements Bs voteFields.add(voteTitledGroupBg); Tuple3 meritTuple = addTopLabelTextField(root, gridRow, - Res.getWithCol("dao.proposal.myVote.merit"), 40); + Res.get("dao.proposal.myVote.merit"), 40); Label meritLabel = meritTuple.first; meritTextField = meritTuple.second; meritTextField.setText(bsqFormatter.formatCoinWithCode(Coin.ZERO)); @@ -675,12 +675,12 @@ public class ProposalsView extends ActivatableView implements Bs voteFields.add(meritTextField); stakeInputTextField = addInputTextField(root, ++gridRow, - Res.getWithCol("dao.proposal.myVote.stake")); + Res.get("dao.proposal.myVote.stake")); stakeInputTextField.setValidator(new BsqValidator(bsqFormatter)); voteFields.add(stakeInputTextField); Tuple2 blindVoteTxIdTuple = addLabelTxIdTextField(root, ++gridRow, - Res.getWithCol("dao.proposal.myVote.blindVoteTxId")); + Res.get("dao.proposal.myVote.blindVoteTxId")); blindVoteTxIdLabel = blindVoteTxIdTuple.first; blindVoteTxIdTextField = blindVoteTxIdTuple.second; blindVoteTxIdTextField.setBsq(true); @@ -688,7 +688,7 @@ public class ProposalsView extends ActivatableView implements Bs voteFields.add(blindVoteTxIdTextField); Tuple2 revealTxIdTuple = addLabelTxIdTextField(root, ++gridRow, - Res.getWithCol("dao.proposal.myVote.revealTxId")); + Res.get("dao.proposal.myVote.revealTxId")); revealTxIdLabel = revealTxIdTuple.first; revealTxIdTextField = revealTxIdTuple.second; revealTxIdTextField.setBsq(true); diff --git a/desktop/src/main/java/bisq/desktop/main/dao/wallet/BsqBalanceUtil.java b/desktop/src/main/java/bisq/desktop/main/dao/wallet/BsqBalanceUtil.java index 54f2fbb87b..d2af854077 100644 --- a/desktop/src/main/java/bisq/desktop/main/dao/wallet/BsqBalanceUtil.java +++ b/desktop/src/main/java/bisq/desktop/main/dao/wallet/BsqBalanceUtil.java @@ -65,30 +65,30 @@ public class BsqBalanceUtil implements BsqBalanceListener { public int addGroup(GridPane gridPane, int gridRow) { titledGroupBg = addTitledGroupBg(gridPane, gridRow, 5, Res.get("dao.wallet.dashboard.myBalance")); availableBalanceTextField = FormBuilder.addTopLabelTextField(gridPane, gridRow, - Res.getWithCol("dao.availableBsqBalance"), + Res.get("dao.availableBsqBalance"), Layout.FIRST_ROW_DISTANCE).second; availableBalanceTextField.setMouseTransparent(false); unverifiedBalanceTextField = FormBuilder.addTopLabelTextField(gridPane, ++gridRow, - Res.getWithCol("dao.unverifiedBsqBalance")).second; + Res.get("dao.unverifiedBsqBalance")).second; unverifiedBalanceTextField.setMouseTransparent(false); lockedForVoteBalanceTextField = FormBuilder.addTopLabelTextField(gridPane, ++gridRow, - Res.getWithCol("dao.lockedForVoteBalance")).second; + Res.get("dao.lockedForVoteBalance")).second; lockedForVoteBalanceTextField.setMouseTransparent(false); - lockedInBondsBalanceTextField = FormBuilder.addTopLabelTextField(gridPane, ++gridRow, Res.getWithCol( + lockedInBondsBalanceTextField = FormBuilder.addTopLabelTextField(gridPane, ++gridRow, Res.get( "dao.lockedInBonds")).second; lockedInBondsBalanceTextField.setMouseTransparent(false); // TODO add unlockingBondsBalanceTextField totalBalanceTextField = FormBuilder.addTopLabelTextField(gridPane, ++gridRow, - Res.getWithCol("dao.totalBsqBalance")).second; + Res.get("dao.totalBsqBalance")).second; totalBalanceTextField.setMouseTransparent(false); Tuple3 tuple3 = FormBuilder.addTopLabelTextField(gridPane, ++gridRow, - Res.getWithCol("dao.availableNonBsqBalance")); + Res.get("dao.availableNonBsqBalance")); availableNonBsqBalanceLabel = tuple3.first; availableNonBsqBalanceTextField = tuple3.second; availableNonBsqBalanceTextField.setMouseTransparent(false); diff --git a/desktop/src/main/java/bisq/desktop/main/dao/wallet/receive/BsqReceiveView.java b/desktop/src/main/java/bisq/desktop/main/dao/wallet/receive/BsqReceiveView.java index 2facfdcaf3..aeba65211e 100644 --- a/desktop/src/main/java/bisq/desktop/main/dao/wallet/receive/BsqReceiveView.java +++ b/desktop/src/main/java/bisq/desktop/main/dao/wallet/receive/BsqReceiveView.java @@ -62,7 +62,7 @@ public class BsqReceiveView extends ActivatableView { addTitledGroupBg(root, ++gridRow, 1, Res.get("dao.wallet.receive.fundYourWallet"), Layout.GROUP_DISTANCE); - addressTextField = addLabelBsqAddressTextField(root, gridRow, Res.getWithCol("dao.wallet.receive.bsqAddress"), + addressTextField = addLabelBsqAddressTextField(root, gridRow, Res.get("dao.wallet.receive.bsqAddress"), Layout.FIRST_ROW_AND_GROUP_DISTANCE).second; addressTextField.setPaymentLabel(paymentLabelString); } From 4f52f227d67f1d1127b6559495f23787a0526e05 Mon Sep 17 00:00:00 2001 From: Manfred Karrer Date: Thu, 25 Oct 2018 21:52:41 -0500 Subject: [PATCH 9/9] Small UI improvements - Remove arrow for show all and edit list - Remove colons - Remove progressbar style in dao phases --- .../resources/i18n/displayStrings.properties | 2 ++ .../bonding/roles/BondedRoleTypeWindow.java | 10 +++---- .../main/dao/governance/ProposalDisplay.java | 12 ++++---- .../dao/governance/make/MakeProposalView.java | 2 +- .../governance/proposals/ProposalsView.java | 8 ++--- .../main/dao/wallet/BsqBalanceUtil.java | 12 ++++---- .../dao/wallet/receive/BsqReceiveView.java | 2 +- .../market/trades/TradesChartsViewModel.java | 2 +- .../offer/offerbook/OfferBookViewModel.java | 4 +-- .../main/java/bisq/desktop/util/GUIUtil.java | 30 +++++++++---------- 10 files changed, 42 insertions(+), 42 deletions(-) diff --git a/core/src/main/resources/i18n/displayStrings.properties b/core/src/main/resources/i18n/displayStrings.properties index 7bc7426d8f..9c8efad41a 100644 --- a/core/src/main/resources/i18n/displayStrings.properties +++ b/core/src/main/resources/i18n/displayStrings.properties @@ -189,6 +189,8 @@ shared.tradingFeeInBsqInfo=equivalent to {0} used as mining fee shared.openURL=Open {0} shared.fiat=Fiat shared.crypto=Crypto +shared.all=All +shared.edit=Edit #################################################################### diff --git a/desktop/src/main/java/bisq/desktop/main/dao/bonding/roles/BondedRoleTypeWindow.java b/desktop/src/main/java/bisq/desktop/main/dao/bonding/roles/BondedRoleTypeWindow.java index bc5f164c7c..b3fed0d065 100644 --- a/desktop/src/main/java/bisq/desktop/main/dao/bonding/roles/BondedRoleTypeWindow.java +++ b/desktop/src/main/java/bisq/desktop/main/dao/bonding/roles/BondedRoleTypeWindow.java @@ -74,19 +74,19 @@ class BondedRoleTypeWindow extends Overlay { } private void addContent() { - FormBuilder.addTopLabelTextField(gridPane, ++rowIndex, Res.get("dao.bond.bondedRoleType.details.role"), + FormBuilder.addTopLabelTextField(gridPane, ++rowIndex, Res.getWithCol("dao.bond.bondedRoleType.details.role"), bondedRoleType.getDisplayString()); - FormBuilder.addTopLabelTextField(gridPane, ++rowIndex, Res.get("dao.bond.bondedRoleType.details.requiredBond"), + FormBuilder.addTopLabelTextField(gridPane, ++rowIndex, Res.getWithCol("dao.bond.bondedRoleType.details.requiredBond"), bsqFormatter.formatCoinWithCode(Coin.valueOf(bondedRoleType.getRequiredBond()))); - FormBuilder.addTopLabelTextField(gridPane, ++rowIndex, Res.get("dao.bond.bondedRoleType.details.unlockTime"), + FormBuilder.addTopLabelTextField(gridPane, ++rowIndex, Res.getWithCol("dao.bond.bondedRoleType.details.unlockTime"), Res.get("dao.bond.bondedRoleType.details.blocks", bondedRoleType.getUnlockTime())); - FormBuilder.addLabelHyperlinkWithIcon(gridPane, ++rowIndex, Res.get("dao.bond.bondedRoleType.details.link"), + FormBuilder.addLabelHyperlinkWithIcon(gridPane, ++rowIndex, Res.getWithCol("dao.bond.bondedRoleType.details.link"), bondedRoleType.getLink(), bondedRoleType.getLink()); - FormBuilder.addTopLabelTextField(gridPane, ++rowIndex, Res.get("dao.bond.bondedRoleType.details.isSingleton"), + FormBuilder.addTopLabelTextField(gridPane, ++rowIndex, Res.getWithCol("dao.bond.bondedRoleType.details.isSingleton"), bsqFormatter.booleanToYesNo(bondedRoleType.isAllowMultipleHolders())); } } 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 cd2fdc7376..1313fe0a6c 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 @@ -183,7 +183,7 @@ public class ProposalDisplay { titledGroupBg = addTitledGroupBg(gridPane, gridRow, titledGroupBgRowSpan, title, top); double proposalTypeTop = top == Layout.GROUP_DISTANCE ? Layout.FIRST_ROW_AND_GROUP_DISTANCE : Layout.FIRST_ROW_DISTANCE; proposalTypeTextField = FormBuilder.addTopLabelTextField(gridPane, gridRow, - Res.get("dao.proposal.display.type"), proposalType.getDisplayName(), proposalTypeTop).second; + Res.getWithCol("dao.proposal.display.type"), proposalType.getDisplayName(), proposalTypeTop).second; nameTextField = addInputTextField(gridPane, ++gridRow, Res.get("dao.proposal.display.name")); nameTextField.setValidator(new InputValidator()); @@ -222,7 +222,7 @@ public class ProposalDisplay { case CHANGE_PARAM: checkNotNull(gridPane, "gridPane must not be null"); paramComboBox = FormBuilder.addComboBox(gridPane, ++gridRow, - Res.get("dao.proposal.display.paramComboBox.label")); + Res.getWithCol("dao.proposal.display.paramComboBox.label")); comboBoxValueTextFieldIndex = gridRow; checkNotNull(paramComboBox, "paramComboBox must not be null"); List list = Arrays.stream(Param.values()) @@ -260,7 +260,7 @@ public class ProposalDisplay { break; case BONDED_ROLE: bondedRoleTypeComboBox = FormBuilder.addComboBox(gridPane, ++gridRow, - Res.get("dao.proposal.display.bondedRoleComboBox.label")); + Res.getWithCol("dao.proposal.display.bondedRoleComboBox.label")); comboBoxValueTextFieldIndex = gridRow; checkNotNull(bondedRoleTypeComboBox, "bondedRoleTypeComboBox must not be null"); bondedRoleTypeComboBox.setItems(FXCollections.observableArrayList(BondedRoleType.values())); @@ -277,7 +277,7 @@ public class ProposalDisplay { }); comboBoxes.add(bondedRoleTypeComboBox); requiredBondForRoleTextField = addTopLabelTextField(gridPane, ++gridRow, - Res.get("dao.proposal.display.requiredBondForRole.label")).second; + Res.getWithCol("dao.proposal.display.requiredBondForRole.label")).second; requiredBondForRoleListener = (observable, oldValue, newValue) -> { if (newValue != null) { @@ -289,7 +289,7 @@ public class ProposalDisplay { break; case CONFISCATE_BOND: confiscateBondComboBox = FormBuilder.addComboBox(gridPane, ++gridRow, - Res.get("dao.proposal.display.confiscateBondComboBox.label")); + Res.getWithCol("dao.proposal.display.confiscateBondComboBox.label")); comboBoxValueTextFieldIndex = gridRow; checkNotNull(confiscateBondComboBox, "confiscateBondComboBox must not be null"); confiscateBondComboBox.setItems(FXCollections.observableArrayList(daoFacade.getValidBondedRoleList())); @@ -310,7 +310,7 @@ public class ProposalDisplay { break; case REMOVE_ASSET: assetComboBox = FormBuilder.addComboBox(gridPane, ++gridRow, - Res.get("dao.proposal.display.assetComboBox.label")); + Res.getWithCol("dao.proposal.display.assetComboBox.label")); comboBoxValueTextFieldIndex = gridRow; checkNotNull(assetComboBox, "assetComboBox must not be null"); List assetList = CurrencyUtil.getAssetRegistry().stream() 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 56ad6bb2d3..2cea9e3d45 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 @@ -130,7 +130,7 @@ public class MakeProposalView extends ActivatableView implements addTitledGroupBg(root, ++gridRow, 1, Res.get("dao.proposal.create.selectProposalType"), Layout.GROUP_DISTANCE); proposalTypeComboBox = FormBuilder.addComboBox(root, gridRow, - Res.get("dao.proposal.create.proposalType"), Layout.FIRST_ROW_AND_GROUP_DISTANCE); + Res.getWithCol("dao.proposal.create.proposalType"), Layout.FIRST_ROW_AND_GROUP_DISTANCE); proposalTypeComboBox.setConverter(new StringConverter<>() { @Override public String toString(ProposalType proposalType) { diff --git a/desktop/src/main/java/bisq/desktop/main/dao/governance/proposals/ProposalsView.java b/desktop/src/main/java/bisq/desktop/main/dao/governance/proposals/ProposalsView.java index b878aafc62..9023a6c2a7 100644 --- a/desktop/src/main/java/bisq/desktop/main/dao/governance/proposals/ProposalsView.java +++ b/desktop/src/main/java/bisq/desktop/main/dao/governance/proposals/ProposalsView.java @@ -667,7 +667,7 @@ public class ProposalsView extends ActivatableView implements Bs voteFields.add(voteTitledGroupBg); Tuple3 meritTuple = addTopLabelTextField(root, gridRow, - Res.get("dao.proposal.myVote.merit"), 40); + Res.getWithCol("dao.proposal.myVote.merit"), 40); Label meritLabel = meritTuple.first; meritTextField = meritTuple.second; meritTextField.setText(bsqFormatter.formatCoinWithCode(Coin.ZERO)); @@ -675,12 +675,12 @@ public class ProposalsView extends ActivatableView implements Bs voteFields.add(meritTextField); stakeInputTextField = addInputTextField(root, ++gridRow, - Res.get("dao.proposal.myVote.stake")); + Res.getWithCol("dao.proposal.myVote.stake")); stakeInputTextField.setValidator(new BsqValidator(bsqFormatter)); voteFields.add(stakeInputTextField); Tuple2 blindVoteTxIdTuple = addLabelTxIdTextField(root, ++gridRow, - Res.get("dao.proposal.myVote.blindVoteTxId")); + Res.getWithCol("dao.proposal.myVote.blindVoteTxId")); blindVoteTxIdLabel = blindVoteTxIdTuple.first; blindVoteTxIdTextField = blindVoteTxIdTuple.second; blindVoteTxIdTextField.setBsq(true); @@ -688,7 +688,7 @@ public class ProposalsView extends ActivatableView implements Bs voteFields.add(blindVoteTxIdTextField); Tuple2 revealTxIdTuple = addLabelTxIdTextField(root, ++gridRow, - Res.get("dao.proposal.myVote.revealTxId")); + Res.getWithCol("dao.proposal.myVote.revealTxId")); revealTxIdLabel = revealTxIdTuple.first; revealTxIdTextField = revealTxIdTuple.second; revealTxIdTextField.setBsq(true); diff --git a/desktop/src/main/java/bisq/desktop/main/dao/wallet/BsqBalanceUtil.java b/desktop/src/main/java/bisq/desktop/main/dao/wallet/BsqBalanceUtil.java index d2af854077..54f2fbb87b 100644 --- a/desktop/src/main/java/bisq/desktop/main/dao/wallet/BsqBalanceUtil.java +++ b/desktop/src/main/java/bisq/desktop/main/dao/wallet/BsqBalanceUtil.java @@ -65,30 +65,30 @@ public class BsqBalanceUtil implements BsqBalanceListener { public int addGroup(GridPane gridPane, int gridRow) { titledGroupBg = addTitledGroupBg(gridPane, gridRow, 5, Res.get("dao.wallet.dashboard.myBalance")); availableBalanceTextField = FormBuilder.addTopLabelTextField(gridPane, gridRow, - Res.get("dao.availableBsqBalance"), + Res.getWithCol("dao.availableBsqBalance"), Layout.FIRST_ROW_DISTANCE).second; availableBalanceTextField.setMouseTransparent(false); unverifiedBalanceTextField = FormBuilder.addTopLabelTextField(gridPane, ++gridRow, - Res.get("dao.unverifiedBsqBalance")).second; + Res.getWithCol("dao.unverifiedBsqBalance")).second; unverifiedBalanceTextField.setMouseTransparent(false); lockedForVoteBalanceTextField = FormBuilder.addTopLabelTextField(gridPane, ++gridRow, - Res.get("dao.lockedForVoteBalance")).second; + Res.getWithCol("dao.lockedForVoteBalance")).second; lockedForVoteBalanceTextField.setMouseTransparent(false); - lockedInBondsBalanceTextField = FormBuilder.addTopLabelTextField(gridPane, ++gridRow, Res.get( + lockedInBondsBalanceTextField = FormBuilder.addTopLabelTextField(gridPane, ++gridRow, Res.getWithCol( "dao.lockedInBonds")).second; lockedInBondsBalanceTextField.setMouseTransparent(false); // TODO add unlockingBondsBalanceTextField totalBalanceTextField = FormBuilder.addTopLabelTextField(gridPane, ++gridRow, - Res.get("dao.totalBsqBalance")).second; + Res.getWithCol("dao.totalBsqBalance")).second; totalBalanceTextField.setMouseTransparent(false); Tuple3 tuple3 = FormBuilder.addTopLabelTextField(gridPane, ++gridRow, - Res.get("dao.availableNonBsqBalance")); + Res.getWithCol("dao.availableNonBsqBalance")); availableNonBsqBalanceLabel = tuple3.first; availableNonBsqBalanceTextField = tuple3.second; availableNonBsqBalanceTextField.setMouseTransparent(false); diff --git a/desktop/src/main/java/bisq/desktop/main/dao/wallet/receive/BsqReceiveView.java b/desktop/src/main/java/bisq/desktop/main/dao/wallet/receive/BsqReceiveView.java index aeba65211e..2facfdcaf3 100644 --- a/desktop/src/main/java/bisq/desktop/main/dao/wallet/receive/BsqReceiveView.java +++ b/desktop/src/main/java/bisq/desktop/main/dao/wallet/receive/BsqReceiveView.java @@ -62,7 +62,7 @@ public class BsqReceiveView extends ActivatableView { addTitledGroupBg(root, ++gridRow, 1, Res.get("dao.wallet.receive.fundYourWallet"), Layout.GROUP_DISTANCE); - addressTextField = addLabelBsqAddressTextField(root, gridRow, Res.get("dao.wallet.receive.bsqAddress"), + addressTextField = addLabelBsqAddressTextField(root, gridRow, Res.getWithCol("dao.wallet.receive.bsqAddress"), Layout.FIRST_ROW_AND_GROUP_DISTANCE).second; addressTextField.setPaymentLabel(paymentLabelString); } diff --git a/desktop/src/main/java/bisq/desktop/main/market/trades/TradesChartsViewModel.java b/desktop/src/main/java/bisq/desktop/main/market/trades/TradesChartsViewModel.java index bea7282c0e..2994974069 100644 --- a/desktop/src/main/java/bisq/desktop/main/market/trades/TradesChartsViewModel.java +++ b/desktop/src/main/java/bisq/desktop/main/market/trades/TradesChartsViewModel.java @@ -103,7 +103,7 @@ class TradesChartsViewModel extends ActivatableViewModel { final ObjectProperty selectedTradeCurrencyProperty = new SimpleObjectProperty<>(); final BooleanProperty showAllTradeCurrenciesProperty = new SimpleBooleanProperty(false); private final CurrencyList currencyListItems; - private final CurrencyListItem showAllCurrencyListItem = new CurrencyListItem(new CryptoCurrency(GUIUtil.SHOW_ALL_FLAG, GUIUtil.SHOW_ALL_FLAG), -1); + private final CurrencyListItem showAllCurrencyListItem = new CurrencyListItem(new CryptoCurrency(GUIUtil.SHOW_ALL_FLAG, ""), -1); final ObservableList tradeStatisticsByCurrency = FXCollections.observableArrayList(); final ObservableList> priceItems = FXCollections.observableArrayList(); final ObservableList> volumeItems = FXCollections.observableArrayList(); diff --git a/desktop/src/main/java/bisq/desktop/main/offer/offerbook/OfferBookViewModel.java b/desktop/src/main/java/bisq/desktop/main/offer/offerbook/OfferBookViewModel.java index 04b8c0aea6..f7e7f41533 100644 --- a/desktop/src/main/java/bisq/desktop/main/offer/offerbook/OfferBookViewModel.java +++ b/desktop/src/main/java/bisq/desktop/main/offer/offerbook/OfferBookViewModel.java @@ -491,9 +491,9 @@ class OfferBookViewModel extends ActivatableViewModel { private void fillAllTradeCurrencies() { allTradeCurrencies.clear(); // Used for ignoring filter (show all) - allTradeCurrencies.add(new CryptoCurrency(GUIUtil.SHOW_ALL_FLAG, GUIUtil.SHOW_ALL_FLAG)); + allTradeCurrencies.add(new CryptoCurrency(GUIUtil.SHOW_ALL_FLAG, "")); allTradeCurrencies.addAll(preferences.getTradeCurrenciesAsObservable()); - allTradeCurrencies.add(new CryptoCurrency(GUIUtil.EDIT_FLAG, GUIUtil.EDIT_FLAG)); + allTradeCurrencies.add(new CryptoCurrency(GUIUtil.EDIT_FLAG, "")); } /////////////////////////////////////////////////////////////////////////////////////////// diff --git a/desktop/src/main/java/bisq/desktop/util/GUIUtil.java b/desktop/src/main/java/bisq/desktop/util/GUIUtil.java index 1fc092e9f1..912ca8df42 100644 --- a/desktop/src/main/java/bisq/desktop/util/GUIUtil.java +++ b/desktop/src/main/java/bisq/desktop/util/GUIUtil.java @@ -128,8 +128,8 @@ import static com.google.common.base.Preconditions.checkArgument; @Slf4j public class GUIUtil { - public final static String SHOW_ALL_FLAG = "SHOW_ALL_FLAG"; - public final static String EDIT_FLAG = "EDIT_FLAG"; + public final static String SHOW_ALL_FLAG = "list.currency.showAll"; // Used for accessing the i18n resource + public final static String EDIT_FLAG = "list.currency.editList"; // Used for accessing the i18n resource public final static int FIAT_DECIMALS_WITH_ZEROS = 0; public final static int FIAT_PRICE_DECIMALS_WITH_ZEROS = 3; @@ -295,10 +295,10 @@ public class GUIUtil { switch (code) { case GUIUtil.SHOW_ALL_FLAG: - currency.setText("▶ " + Res.get("list.currency.showAll")); + currency.setText(Res.get("list.currency.showAll")); break; case GUIUtil.EDIT_FLAG: - currency.setText(Res.get("▼ " + "list.currency.editList")); + currency.setText(Res.get("list.currency.editList")); break; default: if (preferences.isSortMarketCurrenciesNumerically()) { @@ -347,11 +347,11 @@ public class GUIUtil { switch (code) { case GUIUtil.SHOW_ALL_FLAG: - currencyType.setText("▶"); + currencyType.setText(Res.get("shared.all")); currency.setText(Res.get("list.currency.showAll")); break; case GUIUtil.EDIT_FLAG: - currencyType.setText("▼"); + currencyType.setText(Res.get("shared.edit")); currency.setText(Res.get("list.currency.editList")); break; default: @@ -392,10 +392,10 @@ public class GUIUtil { switch (code) { case GUIUtil.SHOW_ALL_FLAG: - currency.setText("▶ " + Res.get("list.currency.showAll")); + currency.setText(Res.get("list.currency.showAll")); break; case GUIUtil.EDIT_FLAG: - currency.setText(Res.get("▼ " + "list.currency.editList")); + currency.setText(Res.get("list.currency.editList")); break; default: if (offerCountOptional.isPresent()) { @@ -447,18 +447,16 @@ public class GUIUtil { switch (code) { case GUIUtil.SHOW_ALL_FLAG: - currencyType.setText("▶"); + currencyType.setText(Res.get("shared.all")); currency.setText(Res.get("list.currency.showAll")); break; case GUIUtil.EDIT_FLAG: - currencyType.setText("▼"); + currencyType.setText(Res.get("shared.edit")); currency.setText(Res.get("list.currency.editList")); break; default: - if (offerCountOptional.isPresent()) { - offers.setText(offers.getText() + " (" + offerCountOptional.get() + " " + - (offerCountOptional.get() == 1 ? postFixSingle : postFixMulti) + ")"); - } + offerCountOptional.ifPresent(numOffer -> offers.setText(offers.getText() + " (" + numOffer + " " + + (numOffer == 1 ? postFixSingle : postFixMulti) + ")")); } setGraphic(box); @@ -483,7 +481,7 @@ public class GUIUtil { this.getStyleClass().add("currency-label-selected"); if (id.equals(GUIUtil.SHOW_ALL_FLAG)) { - setText("▶ " + Res.get("list.currency.showAll")); + setText(Res.get("list.currency.showAll")); } else { setText(Res.get(id)); } @@ -516,7 +514,7 @@ public class GUIUtil { box.getChildren().addAll(paymentType, paymentMethod); if (id.equals(GUIUtil.SHOW_ALL_FLAG)) { - paymentType.setText("▶"); + paymentType.setText(Res.get("shared.all")); paymentMethod.setText(Res.get("list.currency.showAll")); }