From 9e32c43b842ef91dd24d6a56d1e0043cbdf46770 Mon Sep 17 00:00:00 2001 From: Daniel Maclean Date: Fri, 19 Jul 2024 15:36:55 -0500 Subject: [PATCH] fix --dump-tx for reveal-pk; dump serialized reveal-pk transaction when it is needed for an account --- crates/apps_lib/src/client/tx.rs | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/crates/apps_lib/src/client/tx.rs b/crates/apps_lib/src/client/tx.rs index 083076a28f..4579fd6620 100644 --- a/crates/apps_lib/src/client/tx.rs +++ b/crates/apps_lib/src/client/tx.rs @@ -195,10 +195,6 @@ pub async fn submit_reveal_aux( args: args::Tx, address: &Address, ) -> Result<(), error::Error> { - if args.dump_tx { - return Ok(()); - } - if let Address::Implicit(ImplicitAddress(pkh)) = address { let public_key = context .wallet_mut() @@ -207,13 +203,24 @@ pub async fn submit_reveal_aux( .map_err(|e| error::Error::Other(e.to_string()))?; if tx::is_reveal_pk_needed(context.client(), address).await? { + let (mut tx, signing_data) = + tx::build_reveal_pk(context, &args, &public_key).await?; + + if args.dump_tx { + display_line!( + context.io(), + "A tx to reveal the public key for address \ + {address} is needed..." + ); + tx::dump_tx(context.io(), &args, tx.clone()); + return Ok(()); + } + display_line!( context.io(), "Submitting a tx to reveal the public key for address \ {address}..." ); - let (mut tx, signing_data) = - tx::build_reveal_pk(context, &args, &public_key).await?; sign(context, &mut tx, &args, signing_data).await?;