Skip to content
This repository has been archived by the owner on Jan 22, 2025. It is now read-only.

log signature after successful feature activation #33488

Merged
merged 2 commits into from
Oct 6, 2023
Merged
Changes from 1 commit
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
4 changes: 2 additions & 2 deletions cli/src/feature.rs
Original file line number Diff line number Diff line change
Expand Up @@ -957,6 +957,6 @@ fn process_activate(
FEATURE_NAMES.get(&feature_id).unwrap(),
feature_id
);
rpc_client.send_and_confirm_transaction_with_spinner(&transaction)?;
Ok("".to_string())
let signature = rpc_client.send_and_confirm_transaction_with_spinner(&transaction)?;
Ok(format!("Signature: {signature}"))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are actually a couple options here that would be more consistent with other parts of solana-cli, and automatically support --output json:

Suggested change
let signature = rpc_client.send_and_confirm_transaction_with_spinner(&transaction)?;
Ok(format!("Signature: {signature}"))
let signature = rpc_client.send_and_confirm_transaction_with_spinner(&transaction)?;
let signature = CliSignature {
signature: signature.to_string(),
};
Ok(config.output_format.formatted_string(&signature))

This is also an option, and is cool because it adds nice parsing for instruction errors, but will need to be rewritten in the near future when we start using a bpf program for feature gate activations:

Suggested change
let signature = rpc_client.send_and_confirm_transaction_with_spinner(&transaction)?;
Ok(format!("Signature: {signature}"))
let result = rpc_client.send_and_confirm_transaction_with_spinner(&transaction);
log_instruction_custom_error::<SystemError>(result, config)

(PS. I've never tried putting two suggestions in one comment before. Hopefully it Just Works ™️ )

}