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

Commit 6be5398

Browse files
committed
Use ProgramRpcClientSendTransaction::new_with_confirmation everywhere else
This is done in order to keep the changes minimal and behavior the same.
1 parent 5e0d030 commit 6be5398

File tree

5 files changed

+33
-23
lines changed

5 files changed

+33
-23
lines changed

single-pool/cli/src/config.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ impl Config {
6565
// and program client
6666
let program_client = Arc::new(ProgramRpcClient::new(
6767
rpc_client.clone(),
68-
ProgramRpcClientSendTransaction,
68+
ProgramRpcClientSendTransaction::new_with_confirmation(),
6969
));
7070

7171
// resolve default signer

single-pool/cli/tests/test.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ async fn setup(initialize: bool) -> Env {
5656
let rpc_client = Arc::new(validator.get_async_rpc_client());
5757
let program_client: PClient = Arc::new(ProgramRpcClient::new(
5858
rpc_client.clone(),
59-
ProgramRpcClientSendTransaction,
59+
ProgramRpcClientSendTransaction::new_with_confirmation(),
6060
));
6161

6262
// write the payer to disk

token-upgrade/cli/src/main.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ async fn process_create_escrow_account(
8989

9090
let program_client = Arc::new(ProgramRpcClient::new(
9191
rpc_client.clone(),
92-
ProgramRpcClientSendTransaction,
92+
ProgramRpcClientSendTransaction::new_with_confirmation(),
9393
));
9494
let token = Token::new(
9595
program_client.clone(),
@@ -545,7 +545,7 @@ mod test {
545545
let rpc_client = Arc::new(test_validator.get_async_rpc_client());
546546
let client = Arc::new(ProgramRpcClient::new(
547547
rpc_client.clone(),
548-
ProgramRpcClientSendTransaction,
548+
ProgramRpcClientSendTransaction::new_with_confirmation(),
549549
));
550550

551551
let mint_authority = Keypair::new();
@@ -614,7 +614,7 @@ mod test {
614614
let rpc_client = Arc::new(test_validator.get_async_rpc_client());
615615
let client = Arc::new(ProgramRpcClient::new(
616616
rpc_client.clone(),
617-
ProgramRpcClientSendTransaction,
617+
ProgramRpcClientSendTransaction::new_with_confirmation(),
618618
));
619619

620620
let mint_authority = Keypair::new();
@@ -721,7 +721,7 @@ mod test {
721721
let rpc_client = Arc::new(test_validator.get_async_rpc_client());
722722
let client = Arc::new(ProgramRpcClient::new(
723723
rpc_client.clone(),
724-
ProgramRpcClientSendTransaction,
724+
ProgramRpcClientSendTransaction::new_with_confirmation(),
725725
));
726726

727727
let mint_authority = Keypair::new();

token/cli/tests/command.rs

Lines changed: 26 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -190,9 +190,11 @@ fn test_config_with_default_signer<'a>(
190190
) -> Config<'a> {
191191
let websocket_url = test_validator.rpc_pubsub_url();
192192
let rpc_client = Arc::new(test_validator.get_async_rpc_client());
193-
let program_client: Arc<dyn ProgramClient<ProgramRpcClientSendTransaction>> = Arc::new(
194-
ProgramRpcClient::new(rpc_client.clone(), ProgramRpcClientSendTransaction),
195-
);
193+
let program_client: Arc<dyn ProgramClient<ProgramRpcClientSendTransaction>> =
194+
Arc::new(ProgramRpcClient::new(
195+
rpc_client.clone(),
196+
ProgramRpcClientSendTransaction::new_with_confirmation(),
197+
));
196198
Config {
197199
rpc_client,
198200
program_client,
@@ -219,9 +221,11 @@ fn test_config_without_default_signer<'a>(
219221
) -> Config<'a> {
220222
let websocket_url = test_validator.rpc_pubsub_url();
221223
let rpc_client = Arc::new(test_validator.get_async_rpc_client());
222-
let program_client: Arc<dyn ProgramClient<ProgramRpcClientSendTransaction>> = Arc::new(
223-
ProgramRpcClient::new(rpc_client.clone(), ProgramRpcClientSendTransaction),
224-
);
224+
let program_client: Arc<dyn ProgramClient<ProgramRpcClientSendTransaction>> =
225+
Arc::new(ProgramRpcClient::new(
226+
rpc_client.clone(),
227+
ProgramRpcClientSendTransaction::new_with_confirmation(),
228+
));
225229
Config {
226230
rpc_client,
227231
program_client,
@@ -3132,7 +3136,7 @@ async fn do_offline_multisig_transfer(
31323136
let offline_program_client: Arc<dyn ProgramClient<ProgramRpcClientSendTransaction>> =
31333137
Arc::new(ProgramOfflineClient::new(
31343138
blockhash,
3135-
ProgramRpcClientSendTransaction,
3139+
ProgramRpcClientSendTransaction::new_with_confirmation(),
31363140
));
31373141
let mut args = vec![
31383142
"spl-token".to_string(),
@@ -3192,9 +3196,11 @@ async fn do_offline_multisig_transfer(
31923196
assert!(!absent_signers.contains(&token.to_string()));
31933197

31943198
// now send the transaction
3195-
let rpc_program_client: Arc<dyn ProgramClient<ProgramRpcClientSendTransaction>> = Arc::new(
3196-
ProgramRpcClient::new(config.rpc_client.clone(), ProgramRpcClientSendTransaction),
3197-
);
3199+
let rpc_program_client: Arc<dyn ProgramClient<ProgramRpcClientSendTransaction>> =
3200+
Arc::new(ProgramRpcClient::new(
3201+
config.rpc_client.clone(),
3202+
ProgramRpcClientSendTransaction::new_with_confirmation(),
3203+
));
31983204
config.program_client = rpc_program_client;
31993205
let mut args = vec![
32003206
"spl-token".to_string(),
@@ -3849,9 +3855,11 @@ async fn transfer_hook(test_validator: &TestValidator, payer: &Keypair) {
38493855
// Make sure that parsing transfer hook accounts works
38503856
let real_program_client = config.program_client;
38513857
let blockhash = Hash::default();
3852-
let program_client: Arc<dyn ProgramClient<ProgramRpcClientSendTransaction>> = Arc::new(
3853-
ProgramOfflineClient::new(blockhash, ProgramRpcClientSendTransaction),
3854-
);
3858+
let program_client: Arc<dyn ProgramClient<ProgramRpcClientSendTransaction>> =
3859+
Arc::new(ProgramOfflineClient::new(
3860+
blockhash,
3861+
ProgramRpcClientSendTransaction::new_with_confirmation(),
3862+
));
38553863
config.program_client = program_client;
38563864
let _result = exec_test_cmd(
38573865
&config,
@@ -3965,9 +3973,11 @@ async fn transfer_hook_with_transfer_fee(test_validator: &TestValidator, payer:
39653973

39663974
// Make sure that parsing transfer hook accounts and expected-fee works
39673975
let blockhash = Hash::default();
3968-
let program_client: Arc<dyn ProgramClient<ProgramRpcClientSendTransaction>> = Arc::new(
3969-
ProgramOfflineClient::new(blockhash, ProgramRpcClientSendTransaction),
3970-
);
3976+
let program_client: Arc<dyn ProgramClient<ProgramRpcClientSendTransaction>> =
3977+
Arc::new(ProgramOfflineClient::new(
3978+
blockhash,
3979+
ProgramRpcClientSendTransaction::new_with_confirmation(),
3980+
));
39713981
config.program_client = program_client;
39723982

39733983
let _result = exec_test_cmd(

token/transfer-hook/cli/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -601,7 +601,7 @@ mod test {
601601
let rpc_client = Arc::new(test_validator.get_async_rpc_client());
602602
let client = Arc::new(ProgramRpcClient::new(
603603
rpc_client.clone(),
604-
ProgramRpcClientSendTransaction,
604+
ProgramRpcClientSendTransaction::new_with_confirmation(),
605605
));
606606

607607
let token = Token::new(

0 commit comments

Comments
 (0)