20
20
self ,
21
21
account_info:: TransferAccountInfo ,
22
22
instruction:: {
23
- TransferSplitContextStateAccounts , TransferWithFeeSplitContextStateAccounts ,
23
+ CloseSplitContextStateAccounts , TransferSplitContextStateAccounts ,
24
+ TransferWithFeeSplitContextStateAccounts ,
24
25
} ,
25
26
ConfidentialTransferAccount , MAXIMUM_DEPOSIT_TRANSFER_AMOUNT ,
26
27
} ,
@@ -2668,21 +2669,33 @@ async fn confidential_transfer_transfer_with_split_proof_contexts_in_parallel()
2668
2669
let ciphertext_validity_proof_context_state_account = Keypair :: new ( ) ;
2669
2670
let range_proof_context_state_account = Keypair :: new ( ) ;
2670
2671
2672
+ let lamport_destination = Pubkey :: new_unique ( ) ;
2673
+
2674
+ let close_split_context_state_accounts = CloseSplitContextStateAccounts {
2675
+ lamport_destination : & lamport_destination,
2676
+ zk_token_proof_program : & zk_token_proof_program:: id ( ) ,
2677
+ } ;
2678
+
2671
2679
let transfer_context_state_accounts = TransferSplitContextStateAccounts {
2672
2680
equality_proof : & equality_proof_context_state_account. pubkey ( ) ,
2673
2681
ciphertext_validity_proof : & ciphertext_validity_proof_context_state_account. pubkey ( ) ,
2674
2682
range_proof : & range_proof_context_state_account. pubkey ( ) ,
2675
2683
authority : & context_state_authority. pubkey ( ) ,
2676
2684
no_op_on_uninitialized_split_context_state : true ,
2677
- close_split_context_state_accounts : None ,
2685
+ close_split_context_state_accounts : Some ( close_split_context_state_accounts ) ,
2678
2686
} ;
2679
2687
2680
2688
let equality_and_ciphertext_proof_signers = vec ! [
2681
2689
& alice,
2682
2690
& equality_proof_context_state_account,
2683
2691
& ciphertext_validity_proof_context_state_account,
2692
+ & context_state_authority,
2693
+ ] ;
2694
+ let range_proof_signers = vec ! [
2695
+ & alice,
2696
+ & range_proof_context_state_account,
2697
+ & context_state_authority,
2684
2698
] ;
2685
- let range_proof_signers = vec ! [ & alice, & range_proof_context_state_account] ;
2686
2699
token
2687
2700
. confidential_transfer_transfer_with_split_proofs_in_parallel (
2688
2701
& alice_meta. token_account ,
@@ -2724,6 +2737,27 @@ async fn confidential_transfer_transfer_with_split_proof_contexts_in_parallel()
2724
2737
} ,
2725
2738
)
2726
2739
. await ;
2740
+
2741
+ let error = token
2742
+ . get_account ( equality_proof_context_state_account. pubkey ( ) )
2743
+ . await
2744
+ . unwrap_err ( ) ;
2745
+ assert_eq ! ( error, TokenClientError :: AccountNotFound ) ;
2746
+
2747
+ let error = token
2748
+ . get_account ( ciphertext_validity_proof_context_state_account. pubkey ( ) )
2749
+ . await
2750
+ . unwrap_err ( ) ;
2751
+ assert_eq ! ( error, TokenClientError :: AccountNotFound ) ;
2752
+
2753
+ let error = token
2754
+ . get_account ( range_proof_context_state_account. pubkey ( ) )
2755
+ . await
2756
+ . unwrap_err ( ) ;
2757
+ assert_eq ! ( error, TokenClientError :: AccountNotFound ) ;
2758
+
2759
+ let lamport_destination = token. get_account ( lamport_destination) . await . unwrap ( ) ;
2760
+ assert ! ( lamport_destination. lamports > 0 ) ;
2727
2761
}
2728
2762
2729
2763
#[ tokio:: test]
@@ -3043,6 +3077,13 @@ async fn confidential_transfer_transfer_with_fee_and_split_proof_context_in_para
3043
3077
let fee_ciphertext_validity_proof_context_state_account = Keypair :: new ( ) ;
3044
3078
let range_proof_context_state_account = Keypair :: new ( ) ;
3045
3079
3080
+ let lamport_destination = Pubkey :: new_unique ( ) ;
3081
+
3082
+ let close_split_context_state_accounts = CloseSplitContextStateAccounts {
3083
+ lamport_destination : & lamport_destination,
3084
+ zk_token_proof_program : & zk_token_proof_program:: id ( ) ,
3085
+ } ;
3086
+
3046
3087
let transfer_context_state_accounts = TransferWithFeeSplitContextStateAccounts {
3047
3088
equality_proof : & equality_proof_context_state_account. pubkey ( ) ,
3048
3089
transfer_amount_ciphertext_validity_proof :
@@ -3053,20 +3094,26 @@ async fn confidential_transfer_transfer_with_fee_and_split_proof_context_in_para
3053
3094
range_proof : & range_proof_context_state_account. pubkey ( ) ,
3054
3095
authority : & context_state_authority. pubkey ( ) ,
3055
3096
no_op_on_uninitialized_split_context_state : true ,
3056
- close_split_context_state_accounts : None ,
3097
+ close_split_context_state_accounts : Some ( close_split_context_state_accounts ) ,
3057
3098
} ;
3058
3099
3059
3100
let equality_and_ciphertext_proof_signers = vec ! [
3060
3101
& alice,
3061
3102
& equality_proof_context_state_account,
3062
3103
& transfer_amount_ciphertext_validity_proof_context_state_account,
3104
+ & context_state_authority,
3063
3105
] ;
3064
3106
let fee_sigma_proof_signers = vec ! [
3065
3107
& alice,
3066
3108
& fee_sigma_proof_context_state_account,
3067
3109
& fee_ciphertext_validity_proof_context_state_account,
3110
+ & context_state_authority,
3111
+ ] ;
3112
+ let range_proof_signers = vec ! [
3113
+ & alice,
3114
+ & range_proof_context_state_account,
3115
+ & context_state_authority,
3068
3116
] ;
3069
- let range_proof_signers = vec ! [ & alice, & range_proof_context_state_account] ;
3070
3117
token
3071
3118
. confidential_transfer_transfer_with_fee_and_split_proofs_in_parallel (
3072
3119
& alice_meta. token_account ,
@@ -3113,4 +3160,37 @@ async fn confidential_transfer_transfer_with_fee_and_split_proof_context_in_para
3113
3160
} ,
3114
3161
)
3115
3162
. await ;
3163
+
3164
+ let error = token
3165
+ . get_account ( equality_proof_context_state_account. pubkey ( ) )
3166
+ . await
3167
+ . unwrap_err ( ) ;
3168
+ assert_eq ! ( error, TokenClientError :: AccountNotFound ) ;
3169
+
3170
+ let error = token
3171
+ . get_account ( transfer_amount_ciphertext_validity_proof_context_state_account. pubkey ( ) )
3172
+ . await
3173
+ . unwrap_err ( ) ;
3174
+ assert_eq ! ( error, TokenClientError :: AccountNotFound ) ;
3175
+
3176
+ let error = token
3177
+ . get_account ( fee_sigma_proof_context_state_account. pubkey ( ) )
3178
+ . await
3179
+ . unwrap_err ( ) ;
3180
+ assert_eq ! ( error, TokenClientError :: AccountNotFound ) ;
3181
+
3182
+ let error = token
3183
+ . get_account ( fee_ciphertext_validity_proof_context_state_account. pubkey ( ) )
3184
+ . await
3185
+ . unwrap_err ( ) ;
3186
+ assert_eq ! ( error, TokenClientError :: AccountNotFound ) ;
3187
+
3188
+ let error = token
3189
+ . get_account ( range_proof_context_state_account. pubkey ( ) )
3190
+ . await
3191
+ . unwrap_err ( ) ;
3192
+ assert_eq ! ( error, TokenClientError :: AccountNotFound ) ;
3193
+
3194
+ let lamport_destination = token. get_account ( lamport_destination) . await . unwrap ( ) ;
3195
+ assert ! ( lamport_destination. lamports > 0 ) ;
3116
3196
}
0 commit comments