Skip to content

Commit

Permalink
governance: refactor proposal tx error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
tzemanovic committed Sep 2, 2024
1 parent 12cb786 commit 79e4783
Showing 1 changed file with 14 additions and 11 deletions.
25 changes: 14 additions & 11 deletions crates/node/src/shell/finalize_block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1172,25 +1172,28 @@ where
Ok(extended_tx_result) => match extended_tx_result
.tx_result
.get_inner_tx_result(None, either::Right(&cmt))
.expect("Proposal tx must have a result")
{
Some(Ok(batched_result))
if batched_result.is_accepted() =>
{
state.write_log_mut().commit_batch_and_current_tx();
Ok(true)
Ok(batched_result) => {
if batched_result.is_accepted() {
state.write_log_mut().commit_batch_and_current_tx();
Ok(true)
} else {
tracing::warn!(
"Governance proposal rejected by VP(s): {}",
batched_result.vps_result
);
state.write_log_mut().drop_batch();
Ok(false)
}
}
Some(Err(e)) => {
Err(e) => {
tracing::warn!(
"Error executing governance proposal {e}",
);
state.write_log_mut().drop_batch();
Ok(false)
}
_ => {
tracing::warn!("not sure what happen");
state.write_log_mut().drop_batch();
Ok(false)
}
},
Err(e) => {
tracing::warn!(
Expand Down

0 comments on commit 79e4783

Please sign in to comment.