-
Notifications
You must be signed in to change notification settings - Fork 4.6k
log signature after successful feature activation #33488
log signature after successful feature activation #33488
Conversation
Codecov Report
@@ Coverage Diff @@
## master #33488 +/- ##
=======================================
Coverage 81.7% 81.7%
=======================================
Files 802 802
Lines 217786 217786
=======================================
+ Hits 178082 178093 +11
+ Misses 39704 39693 -11 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. I'm going to add @CriesofCarrots as a reviewer to ensure someone that knows the whole CLI stuffs take a look for correctness/consistency/UX.
cli/src/feature.rs
Outdated
let signature = rpc_client.send_and_confirm_transaction_with_spinner(&transaction)?; | ||
Ok(format!("Signature: {signature}")) |
There was a problem hiding this comment.
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
:
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:
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 ™️ )
Problem
When activating a feature the transaction
Signature
is not logged in the final result.It is only logged temporarily in the progress bar during during transaction finalization.
If it activates quickly, The user misses the signature and has to find it manually.
Summary of Changes
Return the signature in the
ProcessResult
which is used to print final results.Fixes #