Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Respect force option for proposal vote transaction #1889

Merged
merged 3 commits into from
Sep 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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/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 Expand Up @@ -1724,7 +1728,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