Search in sources :

Example 1 with BondedRole

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);
    }
}
Also used : ValidationException(bisq.core.dao.exceptions.ValidationException) BondedRole(bisq.core.dao.governance.role.BondedRole)

Example 2 with BondedRole

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());
        }
    });
}
Also used : BondedRoleProposal(bisq.core.dao.governance.proposal.role.BondedRoleProposal) BondedRole(bisq.core.dao.governance.role.BondedRole)

Aggregations

BondedRole (bisq.core.dao.governance.role.BondedRole)2 ValidationException (bisq.core.dao.exceptions.ValidationException)1 BondedRoleProposal (bisq.core.dao.governance.proposal.role.BondedRoleProposal)1