Skip to content

Commit

Permalink
Reputation BSQ added to BSQ Wallet screen (bisq-network#3366)
Browse files Browse the repository at this point in the history
* BSQ Merit now displayed - fixes issue bisq-network#3352

* Broke merit text setting to 2 lines.

* Fix formatting
  • Loading branch information
ripcurlx authored Nov 26, 2019
2 parents 46eef93 + 8cfe221 commit 06f0d6b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
1 change: 1 addition & 0 deletions core/src/main/resources/i18n/displayStrings.properties
Original file line number Diff line number Diff line change
Expand Up @@ -1525,6 +1525,7 @@ dao.lockedForVoteBalance=Used for voting
dao.lockedInBonds=Locked in bonds
dao.availableNonBsqBalance=Available non-BSQ balance (BTC)
dao.totalBsqBalance=Total BSQ balance
dao.reputationBalance=Merit Value (not spendable)

dao.tx.published.success=Your transaction has been successfully published.
dao.proposal.menuItem.make=Make proposal
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@

import bisq.core.btc.listeners.BsqBalanceListener;
import bisq.core.btc.wallet.BsqWalletService;
import bisq.core.dao.DaoFacade;
import bisq.core.dao.state.DaoStateListener;
import bisq.core.dao.state.DaoStateService;
import bisq.core.dao.state.model.blockchain.Block;
Expand All @@ -49,11 +50,12 @@ public class BsqBalanceUtil implements BsqBalanceListener, DaoStateListener {
private final BsqWalletService bsqWalletService;
private final DaoStateService daoStateService;
private final BsqFormatter bsqFormatter;
private final DaoFacade daoFacade;

// Displaying general BSQ info
private TextField availableBalanceTextField, verifiedBalanceTextField, availableNonBsqBalanceTextField,
unverifiedBalanceTextField, lockedForVoteBalanceTextField,
lockedInBondsBalanceTextField, unconfirmedChangTextField;
lockedInBondsBalanceTextField, unconfirmedChangTextField, reputationBalanceTextField;

// Displaying bond dashboard info
private TextField lockupAmountTextField, unlockingAmountTextField;
Expand All @@ -62,10 +64,12 @@ public class BsqBalanceUtil implements BsqBalanceListener, DaoStateListener {
@Inject
private BsqBalanceUtil(BsqWalletService bsqWalletService,
DaoStateService daoStateService,
BsqFormatter bsqFormatter) {
BsqFormatter bsqFormatter,
DaoFacade daoFacade) {
this.bsqWalletService = bsqWalletService;
this.daoStateService = daoStateService;
this.bsqFormatter = bsqFormatter;
this.daoFacade = daoFacade;
}


Expand Down Expand Up @@ -125,6 +129,8 @@ public void onUpdateBalances(Coin availableBalance,
availableNonBsqBalanceTextField.setVisible(isNonBsqBalanceAvailable);
availableNonBsqBalanceTextField.setManaged(isNonBsqBalanceAvailable);
availableNonBsqBalanceTextField.setText(bsqFormatter.formatBTCWithCode(availableNonBsqBalance.value));
String bsqSatoshi = bsqFormatter.formatBSQSatoshisWithCode(daoFacade.getAvailableMerit());
reputationBalanceTextField.setText(bsqSatoshi);
}


Expand Down Expand Up @@ -162,6 +168,8 @@ public int addGroup(GridPane gridPane, int gridRow) {
Res.get("dao.lockedForVoteBalance"), Layout.FIRST_ROW_DISTANCE).second;
lockedInBondsBalanceTextField = FormBuilder.addTopLabelReadOnlyTextField(gridPane, ++gridRow, columnIndex,
Res.get("dao.lockedInBonds")).second;
reputationBalanceTextField = FormBuilder.addTopLabelReadOnlyTextField(gridPane, ++gridRow, columnIndex,
Res.get("dao.reputationBalance")).second;
Tuple3<Label, TextField, VBox> tuple3 = FormBuilder.addTopLabelReadOnlyTextField(gridPane, ++gridRow, columnIndex,
Res.get("dao.availableNonBsqBalance"));
// Match left column
Expand Down

0 comments on commit 06f0d6b

Please sign in to comment.