Skip to content

Commit

Permalink
test-validator: Improve expect messages (#2583)
Browse files Browse the repository at this point in the history
#### Problem

As pointed out at
#2480 (comment), the
expect messages in solana-test-validator are a bit strange since clap
ensure that the rpc client will be there.

#### Summary of changes

Improve the messages with some more information.
  • Loading branch information
joncinque authored Aug 13, 2024
1 parent 272cddb commit 743c345
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions validator/src/bin/solana-test-validator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,7 @@ fn main() {
accounts_to_clone,
cluster_rpc_client
.as_ref()
.expect("bug: --url argument missing?"),
.expect("--clone-account requires --json-rpc-url argument"),
false,
) {
println!("Error: clone_accounts failed: {e}");
Expand All @@ -493,7 +493,7 @@ fn main() {
accounts_to_maybe_clone,
cluster_rpc_client
.as_ref()
.expect("bug: --url argument missing?"),
.expect("--maybe-clone requires --json-rpc-url argument"),
true,
) {
println!("Error: clone_accounts failed: {e}");
Expand All @@ -506,7 +506,7 @@ fn main() {
upgradeable_programs_to_clone,
cluster_rpc_client
.as_ref()
.expect("bug: --url argument missing?"),
.expect("--clone-upgradeable-program requires --json-rpc-url argument"),
) {
println!("Error: clone_upgradeable_programs failed: {e}");
exit(1);
Expand All @@ -517,7 +517,7 @@ fn main() {
if let Err(e) = genesis.clone_feature_set(
cluster_rpc_client
.as_ref()
.expect("bug: --url argument missing?"),
.expect("--clone-feature-set requires --json-rpc-url argument"),
) {
println!("Error: clone_feature_set failed: {e}");
exit(1);
Expand Down

0 comments on commit 743c345

Please sign in to comment.