From 4435883993271ccd53ef67a8dffe5b55b5179dba Mon Sep 17 00:00:00 2001 From: Marco Granelli Date: Mon, 16 Oct 2023 18:22:23 +0200 Subject: [PATCH 1/2] Handles a failure in pgf payment --- apps/src/lib/node/ledger/shell/governance.rs | 25 +++++++++++++------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/apps/src/lib/node/ledger/shell/governance.rs b/apps/src/lib/node/ledger/shell/governance.rs index cc79c9a9f0..3cd4cf2757 100644 --- a/apps/src/lib/node/ledger/shell/governance.rs +++ b/apps/src/lib/node/ledger/shell/governance.rs @@ -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 + ), + } } } } From 4ab326787861f04527eed3ada6dfd8246182d721 Mon Sep 17 00:00:00 2001 From: Marco Granelli Date: Mon, 16 Oct 2023 18:27:24 +0200 Subject: [PATCH 2/2] Changelog #1991 --- .changelog/unreleased/bug-fixes/1991-fix-pgf-payment-crash.md | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 .changelog/unreleased/bug-fixes/1991-fix-pgf-payment-crash.md diff --git a/.changelog/unreleased/bug-fixes/1991-fix-pgf-payment-crash.md b/.changelog/unreleased/bug-fixes/1991-fix-pgf-payment-crash.md new file mode 100644 index 0000000000..226fe081a5 --- /dev/null +++ b/.changelog/unreleased/bug-fixes/1991-fix-pgf-payment-crash.md @@ -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)) \ No newline at end of file