Skip to content

Commit

Permalink
Respect force option for proposal vote transactions
Browse files Browse the repository at this point in the history
  • Loading branch information
karbyshev committed Sep 12, 2023
1 parent 9b67281 commit 3aae3f6
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions shared/src/ledger/tx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1154,9 +1154,13 @@ pub async fn build_vote_proposal<
let is_validator = rpc::is_validator(client, &voter).await?;

if !proposal.can_be_voted(epoch, is_validator) {
return Err(Error::from(TxError::InvalidProposalVotingPeriod(
proposal_id,
)));
if tx.force {
eprintln!("Invalid proposal {} vote period.", proposal_id);
} else {
return Err(Error::from(TxError::InvalidProposalVotingPeriod(
proposal_id,
)));
}
}

let delegations = rpc::get_delegators_delegation_at(
Expand Down

0 comments on commit 3aae3f6

Please sign in to comment.