From b8132db602b3af71c2a2f911ac4245d50c5ed972 Mon Sep 17 00:00:00 2001 From: acheron <98934430+acheroncrypto@users.noreply.github.com> Date: Mon, 16 Dec 2024 20:46:28 +0100 Subject: [PATCH] token-cli: Use the `commitment` field from Solana config (#7591) --- token/cli/src/config.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/token/cli/src/config.rs b/token/cli/src/config.rs index ee3a4dc903d..74116217121 100644 --- a/token/cli/src/config.rs +++ b/token/cli/src/config.rs @@ -100,10 +100,12 @@ impl<'a> Config<'a> { .unwrap_or(&cli_config.json_rpc_url), ); let websocket_url = solana_cli_config::Config::compute_websocket_url(&json_rpc_url); + let commitment_config = CommitmentConfig::from_str(&cli_config.commitment) + .unwrap_or_else(|_| CommitmentConfig::confirmed()); let rpc_client = Arc::new(RpcClient::new_with_timeouts_and_commitment( json_rpc_url, DEFAULT_RPC_TIMEOUT, - CommitmentConfig::confirmed(), + commitment_config, DEFAULT_CONFIRM_TX_TIMEOUT, )); let sign_only = matches.try_contains_id(SIGN_ONLY_ARG.name).unwrap_or(false);