Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix --dump-tx for reveal-pk; dump serialized reveal-pk transaction wh… #3538

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading