diff --git a/.changelog/unreleased/bug-fixes/4061-dump-reveal-pk.md b/.changelog/unreleased/bug-fixes/4061-dump-reveal-pk.md new file mode 100644 index 0000000000..1df19801e4 --- /dev/null +++ b/.changelog/unreleased/bug-fixes/4061-dump-reveal-pk.md @@ -0,0 +1,4 @@ +- fix the cli command 'namada client reveal_pk' to respect the + '--dump-tx' and '--dump-wrapper-tx' flags when present. this + allows offline accounts to reveal their public keys to the network + ([\#4061](https://github.com/anoma/namada/pull/4061)) \ No newline at end of file diff --git a/crates/apps_lib/src/client/tx.rs b/crates/apps_lib/src/client/tx.rs index 01a8097c8a..26b2dd0df5 100644 --- a/crates/apps_lib/src/client/tx.rs +++ b/crates/apps_lib/src/client/tx.rs @@ -1203,12 +1203,19 @@ pub async fn submit_reveal_pk( where ::Error: std::fmt::Display, { - let tx_data = - submit_reveal_aux(namada, &args.tx, &(&args.public_key).into()).await?; + if args.tx.dump_tx || args.tx.dump_wrapper_tx { + let tx_data = + tx::build_reveal_pk(namada, &args.tx, &args.public_key).await?; + tx::dump_tx(namada.io(), &args.tx, tx_data.0.clone())?; + } else { + let tx_data = + submit_reveal_aux(namada, &args.tx, &(&args.public_key).into()) + .await?; - if let Some((mut tx, signing_data)) = tx_data { - sign(namada, &mut tx, &args.tx, signing_data).await?; - namada.submit(tx, &args.tx).await?; + if let Some((mut tx, signing_data)) = tx_data { + sign(namada, &mut tx, &args.tx, signing_data).await?; + namada.submit(tx, &args.tx).await?; + } } Ok(())