Skip to content
This repository was archived by the owner on Mar 11, 2025. It is now read-only.
This repository was archived by the owner on Mar 11, 2025. It is now read-only.

spl-token CLI ignores the Solana config's confirmation field #7590

@acheroncrypto

Description

@acheroncrypto

Problem

spl-token CLI loads the Solana config:

let cli_config = if let Some(config_file) = matches.value_of("config_file") {
solana_cli_config::Config::load(config_file).unwrap_or_else(|_| {
eprintln!("error: Could not find config file `{}`", config_file);
exit(1);
})
} else if let Some(config_file) = &*solana_cli_config::CONFIG_FILE {
solana_cli_config::Config::load(config_file).unwrap_or_default()
} else {
solana_cli_config::Config::default()
};

but it hardcodes the commitment to be confirmed during RPC client creation (instead of respecting the specified commitment):

let rpc_client = Arc::new(RpcClient::new_with_timeouts_and_commitment(
json_rpc_url,
DEFAULT_RPC_TIMEOUT,
CommitmentConfig::confirmed(),
DEFAULT_CONFIRM_TX_TIMEOUT,
));

Solution

Use the confirmation field from the Solana config.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions