Skip to content

Commit

Permalink
fix --dump-tx for reveal-pk; dump serialized reveal-pk transaction wh…
Browse files Browse the repository at this point in the history
…en it is needed for an account
  • Loading branch information
dan-u410 committed Jul 19, 2024
1 parent 22a4839 commit 9e32c43
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions crates/apps_lib/src/client/tx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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?;

Expand Down

0 comments on commit 9e32c43

Please sign in to comment.