@@ -28,14 +28,11 @@ use solana_cli_output::{
28
28
use solana_client:: rpc_request:: TokenAccountsFilter ;
29
29
use solana_remote_wallet:: remote_wallet:: RemoteWalletManager ;
30
30
use solana_sdk:: {
31
- instruction:: Instruction ,
32
- message:: Message ,
33
31
native_token:: * ,
34
32
program_option:: COption ,
35
33
pubkey:: Pubkey ,
36
34
signature:: { Keypair , Signer } ,
37
35
system_program,
38
- transaction:: Transaction ,
39
36
} ;
40
37
use spl_associated_token_account:: get_associated_token_address_with_program_id;
41
38
use spl_token_2022:: {
@@ -66,25 +63,6 @@ mod bench;
66
63
use bench:: * ;
67
64
use spl_token_2022:: generic_token_account:: GenericTokenAccount ;
68
65
69
- struct CliSignerInfo {
70
- pub signers : Vec < Arc < dyn Signer > > ,
71
- }
72
-
73
- impl CliSignerInfo {
74
- pub fn signers_for_message ( & self , message : & Message ) -> Vec < & dyn Signer > {
75
- self . signers
76
- . iter ( )
77
- . filter_map ( |k| {
78
- if message. signer_keys ( ) . contains ( & & k. pubkey ( ) ) {
79
- Some ( k. as_ref ( ) )
80
- } else {
81
- None
82
- }
83
- } )
84
- . collect ( )
85
- }
86
- }
87
-
88
66
pub const OWNER_ADDRESS_ARG : ArgConstant < ' static > = ArgConstant {
89
67
name : "owner" ,
90
68
long : "owner" ,
@@ -3418,63 +3396,6 @@ enum TransactionReturnData {
3418
3396
CliSignOnlyData ( CliSignOnlyData ) ,
3419
3397
}
3420
3398
3421
- // XXX this goes away once everything is converted to token client
3422
- async fn handle_tx < ' a > (
3423
- signer_info : & CliSignerInfo ,
3424
- config : & Config < ' a > ,
3425
- no_wait : bool ,
3426
- minimum_balance_for_rent_exemption : u64 ,
3427
- instructions : Vec < Instruction > ,
3428
- ) -> Result < TransactionReturnData , Error > {
3429
- let fee_payer_pubkey = config. fee_payer . pubkey ( ) ;
3430
- let fee_payer = Some ( & fee_payer_pubkey) ;
3431
-
3432
- let recent_blockhash = config. program_client . get_latest_blockhash ( ) . await ?;
3433
- let message = if let Some ( nonce_account) = config. nonce_account . as_ref ( ) {
3434
- let mut message = Message :: new_with_nonce (
3435
- instructions,
3436
- fee_payer,
3437
- nonce_account,
3438
- config. nonce_authority . as_ref ( ) . unwrap ( ) ,
3439
- ) ;
3440
- message. recent_blockhash = recent_blockhash;
3441
- message
3442
- } else {
3443
- Message :: new_with_blockhash ( & instructions, fee_payer, & recent_blockhash)
3444
- } ;
3445
-
3446
- if !config. sign_only {
3447
- let fee = config. rpc_client . get_fee_for_message ( & message) . await ?;
3448
- check_fee_payer_balance ( config, minimum_balance_for_rent_exemption + fee) . await ?;
3449
- }
3450
-
3451
- let signers = signer_info. signers_for_message ( & message) ;
3452
- let mut transaction = Transaction :: new_unsigned ( message) ;
3453
-
3454
- if config. sign_only {
3455
- transaction. try_partial_sign ( & signers, recent_blockhash) ?;
3456
- Ok ( TransactionReturnData :: CliSignOnlyData ( return_signers_data (
3457
- & transaction,
3458
- & ReturnSignersConfig {
3459
- dump_transaction_message : config. dump_transaction_message ,
3460
- } ,
3461
- ) ) )
3462
- } else {
3463
- transaction. try_sign ( & signers, recent_blockhash) ?;
3464
- let signature = if no_wait {
3465
- config. rpc_client . send_transaction ( & transaction) . await ?
3466
- } else {
3467
- config
3468
- . rpc_client
3469
- . send_and_confirm_transaction_with_spinner ( & transaction)
3470
- . await ?
3471
- } ;
3472
- Ok ( TransactionReturnData :: CliSignature ( CliSignature {
3473
- signature : signature. to_string ( ) ,
3474
- } ) )
3475
- }
3476
- }
3477
-
3478
3399
async fn finish_tx < ' a > (
3479
3400
config : & Config < ' a > ,
3480
3401
rpc_response : & RpcClientResponse ,
0 commit comments