use of bisq.core.dao.governance.role.BondedRole in project bisq-core by bisq-network.
the class BondedRoleValidator method validateDataFields.
@Override
public void validateDataFields(Proposal proposal) throws ValidationException {
try {
super.validateDataFields(proposal);
BondedRoleProposal bondedRoleProposal = (BondedRoleProposal) proposal;
BondedRole bondedRole = bondedRoleProposal.getBondedRole();
// TODO
notEmpty(bondedRole.getName(), "bondedRole.name must not be empty");
} catch (Throwable throwable) {
throw new ValidationException(throwable);
}
}
use of bisq.core.dao.governance.role.BondedRole in project bisq-core by bisq-network.
the class VoteResultService method applyBondedRole.
private void applyBondedRole(Set<EvaluatedProposal> acceptedEvaluatedProposals, int chainHeight) {
acceptedEvaluatedProposals.forEach(evaluatedProposal -> {
if (evaluatedProposal.getProposal() instanceof BondedRoleProposal) {
BondedRoleProposal bondedRoleProposal = (BondedRoleProposal) evaluatedProposal.getProposal();
BondedRole bondedRole = bondedRoleProposal.getBondedRole();
bondedRolesService.addAcceptedBondedRole(bondedRole);
StringBuilder sb = new StringBuilder();
sb.append("\n################################################################################\n");
sb.append("We added a bonded role. ProposalTxId=").append(bondedRoleProposal.getTxId()).append("\nfor bondedRoleProposal with UID ").append(bondedRoleProposal.getTxId()).append("\nBondedRole: ").append(bondedRole.getDisplayString()).append("\n################################################################################\n");
log.info(sb.toString());
}
});
}
Aggregations