@@ -3129,14 +3129,16 @@ async fn do_offline_multisig_transfer(
3129
3129
. await
3130
3130
. unwrap ( ) ;
3131
3131
3132
- let program_client: Arc < dyn ProgramClient < ProgramRpcClientSendTransaction > > = Arc :: new (
3133
- ProgramOfflineClient :: new ( blockhash, ProgramRpcClientSendTransaction ) ,
3134
- ) ;
3132
+ let offline_program_client: Arc < dyn ProgramClient < ProgramRpcClientSendTransaction > > =
3133
+ Arc :: new ( ProgramOfflineClient :: new (
3134
+ blockhash,
3135
+ ProgramRpcClientSendTransaction ,
3136
+ ) ) ;
3135
3137
let mut args = vec ! [
3136
3138
"spl-token" . to_string( ) ,
3137
3139
CommandName :: Transfer . as_ref( ) . to_string( ) ,
3138
3140
token. to_string( ) ,
3139
- "10 " . to_string( ) ,
3141
+ "100 " . to_string( ) ,
3140
3142
destination. to_string( ) ,
3141
3143
"--blockhash" . to_string( ) ,
3142
3144
blockhash. to_string( ) ,
@@ -3166,7 +3168,7 @@ async fn do_offline_multisig_transfer(
3166
3168
args. push ( "--with-compute-unit-limit" . to_string ( ) ) ;
3167
3169
args. push ( 10_000 . to_string ( ) ) ;
3168
3170
}
3169
- config. program_client = program_client ;
3171
+ config. program_client = offline_program_client ;
3170
3172
let result = exec_test_cmd ( & config, & args) . await . unwrap ( ) ;
3171
3173
// the provided signer has a signature, denoted by the pubkey followed
3172
3174
// by "=" and the signature
@@ -3190,15 +3192,15 @@ async fn do_offline_multisig_transfer(
3190
3192
assert ! ( !absent_signers. contains( & token. to_string( ) ) ) ;
3191
3193
3192
3194
// now send the transaction
3193
- let program_client : Arc < dyn ProgramClient < ProgramRpcClientSendTransaction > > = Arc :: new (
3195
+ let rpc_program_client : Arc < dyn ProgramClient < ProgramRpcClientSendTransaction > > = Arc :: new (
3194
3196
ProgramRpcClient :: new ( config. rpc_client . clone ( ) , ProgramRpcClientSendTransaction ) ,
3195
3197
) ;
3196
- config. program_client = program_client ;
3198
+ config. program_client = rpc_program_client ;
3197
3199
let mut args = vec ! [
3198
3200
"spl-token" . to_string( ) ,
3199
3201
CommandName :: Transfer . as_ref( ) . to_string( ) ,
3200
3202
token. to_string( ) ,
3201
- "10 " . to_string( ) ,
3203
+ "100 " . to_string( ) ,
3202
3204
destination. to_string( ) ,
3203
3205
"--blockhash" . to_string( ) ,
3204
3206
blockhash. to_string( ) ,
@@ -3233,12 +3235,46 @@ async fn do_offline_multisig_transfer(
3233
3235
3234
3236
let account = config. rpc_client . get_account ( & source) . await . unwrap ( ) ;
3235
3237
let token_account = StateWithExtensionsOwned :: < Account > :: unpack ( account. data ) . unwrap ( ) ;
3236
- let amount = spl_token:: ui_amount_to_amount ( 90 .0, TEST_DECIMALS ) ;
3238
+ let amount = spl_token:: ui_amount_to_amount ( 0 .0, TEST_DECIMALS ) ;
3237
3239
assert_eq ! ( token_account. base. amount, amount) ;
3238
3240
let account = config. rpc_client . get_account ( & destination) . await . unwrap ( ) ;
3239
3241
let token_account = StateWithExtensionsOwned :: < Account > :: unpack ( account. data ) . unwrap ( ) ;
3240
- let amount = spl_token:: ui_amount_to_amount ( 10 .0, TEST_DECIMALS ) ;
3242
+ let amount = spl_token:: ui_amount_to_amount ( 100 .0, TEST_DECIMALS ) ;
3241
3243
assert_eq ! ( token_account. base. amount, amount) ;
3244
+
3245
+ // get new nonce
3246
+ let nonce_account = config. rpc_client . get_account ( & nonce) . await . unwrap ( ) ;
3247
+ let blockhash = Hash :: new ( & nonce_account. data [ start_hash_index..start_hash_index + 32 ] ) ;
3248
+ let mut args = vec ! [
3249
+ "spl-token" . to_string( ) ,
3250
+ CommandName :: Close . as_ref( ) . to_string( ) ,
3251
+ "--address" . to_string( ) ,
3252
+ source. to_string( ) ,
3253
+ "--blockhash" . to_string( ) ,
3254
+ blockhash. to_string( ) ,
3255
+ "--nonce" . to_string( ) ,
3256
+ nonce. to_string( ) ,
3257
+ "--nonce-authority" . to_string( ) ,
3258
+ fee_payer_keypair_file. path( ) . to_str( ) . unwrap( ) . to_string( ) ,
3259
+ "--multisig-signer" . to_string( ) ,
3260
+ multisig_paths[ 1 ] . path( ) . to_str( ) . unwrap( ) . to_string( ) ,
3261
+ "--multisig-signer" . to_string( ) ,
3262
+ multisig_paths[ 2 ] . path( ) . to_str( ) . unwrap( ) . to_string( ) ,
3263
+ "--owner" . to_string( ) ,
3264
+ multisig_pubkey. to_string( ) ,
3265
+ "--fee-payer" . to_string( ) ,
3266
+ fee_payer_keypair_file. path( ) . to_str( ) . unwrap( ) . to_string( ) ,
3267
+ "--program-id" . to_string( ) ,
3268
+ program_id. to_string( ) ,
3269
+ ] ;
3270
+ if let Some ( compute_unit_price) = compute_unit_price {
3271
+ args. push ( "--with-compute-unit-price" . to_string ( ) ) ;
3272
+ args. push ( compute_unit_price. to_string ( ) ) ;
3273
+ args. push ( "--with-compute-unit-limit" . to_string ( ) ) ;
3274
+ args. push ( 10_000 . to_string ( ) ) ;
3275
+ }
3276
+ exec_test_cmd ( & config, & args) . await . unwrap ( ) ;
3277
+ let _ = config. rpc_client . get_account ( & source) . await . unwrap_err ( ) ;
3242
3278
}
3243
3279
}
3244
3280
0 commit comments