Skip to content

Commit

Permalink
Merge 'grarco/fix-pgf-payment-crash' (#1991)
Browse files Browse the repository at this point in the history
* origin/grarco/fix-pgf-payment-crash:
  Changelog #1991
  Handles a failure in pgf payment
  • Loading branch information
Fraccaman committed Oct 17, 2023
2 parents 3f979bf + 4ab3267 commit e4cfa4e
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 8 deletions.
2 changes: 2 additions & 0 deletions .changelog/unreleased/bug-fixes/1991-fix-pgf-payment-crash.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- Fixed a bug that would cause the ledger to crash on a failed PGF payment.
([\#1991](https://github.com/anoma/namada/pull/1991))
25 changes: 17 additions & 8 deletions apps/src/lib/node/ledger/shell/governance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -374,19 +374,28 @@ where
}
},
PGFAction::Retro(target) => {
token::transfer(
match token::transfer(
storage,
token,
&ADDRESS,
&target.target,
target.amount,
)?;
tracing::info!(
"Execute RetroPgf from proposal id {}: sent {} to {}.",
proposal_id,
target.amount.to_string_native(),
target.target
);
) {
Ok(()) => tracing::info!(
"Execute RetroPgf from proposal id {}: sent {} to {}.",
proposal_id,
target.amount.to_string_native(),
target.target
),
Err(e) => tracing::warn!(
"Error in RetroPgf transfer from proposal id {}, \
amount {} to {}: {}",
proposal_id,
target.amount.to_string_native(),
target.target,
e
),
}
}
}
}
Expand Down

0 comments on commit e4cfa4e

Please sign in to comment.