Skip to content

Commit

Permalink
Merge branch 'aleks/respect-force-option' (#1889)
Browse files Browse the repository at this point in the history
* origin/aleks/respect-force-option:
  Add changelog
  Fix typo
  Respect force option for proposal vote transactions
  • Loading branch information
Fraccaman committed Sep 25, 2023
2 parents ea8746d + d993c23 commit aa40b71
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
2 changes: 2 additions & 0 deletions .changelog/unreleased/bug-fixes/1889-respect-force-option.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- Respect force option for proposal vote transaction
([\#1889](https://github.com/anoma/namada/pull/1889))
12 changes: 8 additions & 4 deletions shared/src/sdk/tx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1221,9 +1221,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 Expand Up @@ -1803,7 +1807,7 @@ pub async fn build_transfer<
// inner tx will fail, so abort tx creation
if fee_unshield_epoch != transfer_unshield_epoch && !args.tx.force {
return Err(Error::Other(
"Fee unshilding masp tx and inner tx masp transaction \
"Fee unshielding masp tx and inner tx masp transaction \
were crafted on an epoch boundary"
.to_string(),
));
Expand Down

0 comments on commit aa40b71

Please sign in to comment.