Enable commitment arg on solana deploy (#12532)
This commit is contained in:
@ -15,7 +15,7 @@ pub fn commitment_arg_with_default<'a, 'b>(default_value: &'static str) -> Arg<'
|
|||||||
Arg::with_name(COMMITMENT_ARG.name)
|
Arg::with_name(COMMITMENT_ARG.name)
|
||||||
.long(COMMITMENT_ARG.long)
|
.long(COMMITMENT_ARG.long)
|
||||||
.takes_value(true)
|
.takes_value(true)
|
||||||
.possible_values(&["recent", "single", "root", "max"])
|
.possible_values(&["recent", "single", "singleGossip", "root", "max"])
|
||||||
.default_value(default_value)
|
.default_value(default_value)
|
||||||
.value_name("COMMITMENT_LEVEL")
|
.value_name("COMMITMENT_LEVEL")
|
||||||
.help(COMMITMENT_ARG.help)
|
.help(COMMITMENT_ARG.help)
|
||||||
|
@ -1016,6 +1016,7 @@ fn send_and_confirm_transactions_with_spinner<T: Signers>(
|
|||||||
rpc_client: &RpcClient,
|
rpc_client: &RpcClient,
|
||||||
mut transactions: Vec<Transaction>,
|
mut transactions: Vec<Transaction>,
|
||||||
signer_keys: &T,
|
signer_keys: &T,
|
||||||
|
commitment: CommitmentConfig,
|
||||||
) -> Result<(), Box<dyn error::Error>> {
|
) -> Result<(), Box<dyn error::Error>> {
|
||||||
let progress_bar = new_spinner_progress_bar();
|
let progress_bar = new_spinner_progress_bar();
|
||||||
let mut send_retries = 5;
|
let mut send_retries = 5;
|
||||||
@ -1037,7 +1038,7 @@ fn send_and_confirm_transactions_with_spinner<T: Signers>(
|
|||||||
.send_transaction_with_config(
|
.send_transaction_with_config(
|
||||||
&transaction,
|
&transaction,
|
||||||
RpcSendTransactionConfig {
|
RpcSendTransactionConfig {
|
||||||
skip_preflight: true,
|
preflight_commitment: Some(commitment.commitment),
|
||||||
..RpcSendTransactionConfig::default()
|
..RpcSendTransactionConfig::default()
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
@ -1199,9 +1200,15 @@ fn process_deploy(
|
|||||||
}
|
}
|
||||||
|
|
||||||
trace!("Writing program data");
|
trace!("Writing program data");
|
||||||
send_and_confirm_transactions_with_spinner(&rpc_client, write_transactions, &signers).map_err(
|
send_and_confirm_transactions_with_spinner(
|
||||||
|_| CliError::DynamicProgramError("Data writes to program account failed".to_string()),
|
&rpc_client,
|
||||||
)?;
|
write_transactions,
|
||||||
|
&signers,
|
||||||
|
config.commitment,
|
||||||
|
)
|
||||||
|
.map_err(|_| {
|
||||||
|
CliError::DynamicProgramError("Data writes to program account failed".to_string())
|
||||||
|
})?;
|
||||||
|
|
||||||
let (blockhash, _, _) = rpc_client
|
let (blockhash, _, _) = rpc_client
|
||||||
.get_recent_blockhash_with_commitment(config.commitment)?
|
.get_recent_blockhash_with_commitment(config.commitment)?
|
||||||
@ -2103,7 +2110,8 @@ pub fn app<'ab, 'v>(name: &str, about: &'ab str, version: &'v str) -> App<'ab, '
|
|||||||
.takes_value(false)
|
.takes_value(false)
|
||||||
.hidden(true) // Don't document this argument to discourage its use
|
.hidden(true) // Don't document this argument to discourage its use
|
||||||
.help("Use the deprecated BPF loader")
|
.help("Use the deprecated BPF loader")
|
||||||
),
|
)
|
||||||
|
.arg(commitment_arg_with_default("max")),
|
||||||
)
|
)
|
||||||
.subcommand(
|
.subcommand(
|
||||||
SubCommand::with_name("pay")
|
SubCommand::with_name("pay")
|
||||||
|
Reference in New Issue
Block a user