mirror of
https://github.com/bisq-network/bisq.git
synced 2024-11-20 10:22:18 +01:00
Cleanup ballot domain
This commit is contained in:
parent
4fddc5d089
commit
185eee2fcb
@ -185,7 +185,7 @@ public class ProposalsView extends ActivatableView<GridPane, Void> implements Bs
|
||||
sortedList.comparatorProperty().bind(tableView.comparatorProperty());
|
||||
|
||||
daoFacade.getActiveOrMyUnconfirmedProposals().addListener(proposalListChangeListener);
|
||||
daoFacade.getValidAndConfirmedBallots().addListener(ballotListChangeListener);
|
||||
daoFacade.getBallots().addListener(ballotListChangeListener);
|
||||
daoFacade.addBsqStateListener(this);
|
||||
bsqWalletService.addBsqBalanceListener(this);
|
||||
|
||||
@ -213,7 +213,7 @@ public class ProposalsView extends ActivatableView<GridPane, Void> implements Bs
|
||||
sortedList.comparatorProperty().unbind();
|
||||
|
||||
daoFacade.getActiveOrMyUnconfirmedProposals().removeListener(proposalListChangeListener);
|
||||
daoFacade.getValidAndConfirmedBallots().removeListener(ballotListChangeListener);
|
||||
daoFacade.getBallots().removeListener(ballotListChangeListener);
|
||||
daoFacade.removeBsqStateListener(this);
|
||||
bsqWalletService.removeBsqBalanceListener(this);
|
||||
|
||||
@ -284,7 +284,7 @@ public class ProposalsView extends ActivatableView<GridPane, Void> implements Bs
|
||||
.collect(Collectors.toSet()));
|
||||
} else {
|
||||
// blind vote phase
|
||||
List<Ballot> ballotList = daoFacade.getValidAndConfirmedBallots();
|
||||
List<Ballot> ballotList = daoFacade.getBallots();
|
||||
listItems.setAll(ballotList.stream()
|
||||
.map(ballot -> new ProposalsListItem(ballot, daoFacade, bsqFormatter))
|
||||
.collect(Collectors.toSet()));
|
||||
|
@ -70,7 +70,7 @@ public class VoteListItem {
|
||||
public Tuple2<AwesomeIcon, String> getIconStyleTuple() {
|
||||
Optional<Boolean> isAccepted;
|
||||
isAccepted = decryptedVote.getBallotList().stream()
|
||||
.filter(ballot -> ballot.getProposalTxId().equals(proposalTxId))
|
||||
.filter(ballot -> ballot.getTxId().equals(proposalTxId))
|
||||
.map(Ballot::getVote)
|
||||
.filter(vote -> vote instanceof BooleanVote)
|
||||
.map(vote -> (BooleanVote) vote)
|
||||
|
@ -225,8 +225,8 @@ public class VoteResultView extends ActivatableView<GridPane, Void> implements B
|
||||
if (selectedProposalListItem != null) {
|
||||
|
||||
EvaluatedProposal evaluatedProposal = selectedProposalListItem.getEvaluatedProposal();
|
||||
Optional<Ballot> optionalBallot = daoFacade.getAllBallots().stream()
|
||||
.filter(ballot -> ballot.getProposalTxId().equals(evaluatedProposal.getProposalTxId()))
|
||||
Optional<Ballot> optionalBallot = daoFacade.getBallots().stream()
|
||||
.filter(ballot -> ballot.getTxId().equals(evaluatedProposal.getProposalTxId()))
|
||||
.findAny();
|
||||
Ballot ballot = optionalBallot.orElse(null);
|
||||
createProposalDisplay(evaluatedProposal, ballot);
|
||||
@ -330,9 +330,9 @@ public class VoteResultView extends ActivatableView<GridPane, Void> implements B
|
||||
proposalList.clear();
|
||||
proposalList.forEach(ProposalListItem::resetTableRow);
|
||||
|
||||
Map<String, Ballot> ballotByProposalTxIdMap = daoFacade.getAllBallots()
|
||||
Map<String, Ballot> ballotByProposalTxIdMap = daoFacade.getBallots()
|
||||
.stream()
|
||||
.collect(Collectors.toMap(Ballot::getProposalTxId, ballot -> ballot));
|
||||
.collect(Collectors.toMap(Ballot::getTxId, ballot -> ballot));
|
||||
proposalList.setAll(resultsOfCycle.getEvaluatedProposals().stream()
|
||||
.map(evaluatedProposal -> new ProposalListItem(evaluatedProposal,
|
||||
ballotByProposalTxIdMap.get(evaluatedProposal.getProposalTxId()),
|
||||
|
Loading…
Reference in New Issue
Block a user