@@ -30,6 +30,17 @@ const FEE_AMOUNT_HI_BITS: usize = 32;
30
30
const REMAINING_BALANCE_BIT_LENGTH : usize = 64 ;
31
31
const DELTA_BIT_LENGTH : usize = 48 ;
32
32
33
+ /// The proof data required for a confidential transfer instruction when the mint is extended for
34
+ /// fees
35
+ pub struct TransferWithFeeProofData {
36
+ pub equality_proof_data : CiphertextCommitmentEqualityProofData ,
37
+ pub transfer_amount_ciphertext_validity_proof_data :
38
+ BatchedGroupedCiphertext3HandlesValidityProofData ,
39
+ pub percentage_with_cap_proof_data : PercentageWithCapProofData ,
40
+ pub fee_ciphertext_validity_proof_data : BatchedGroupedCiphertext2HandlesValidityProofData ,
41
+ pub range_proof_data : BatchedRangeProofU256Data ,
42
+ }
43
+
33
44
#[ allow( clippy:: too_many_arguments) ]
34
45
pub fn transfer_with_fee_split_proof_data (
35
46
current_available_balance : & ElGamalCiphertext ,
@@ -42,16 +53,7 @@ pub fn transfer_with_fee_split_proof_data(
42
53
withdraw_withheld_authority_elgamal_pubkey : & ElGamalPubkey ,
43
54
fee_rate_basis_points : u16 ,
44
55
maximum_fee : u64 ,
45
- ) -> Result <
46
- (
47
- CiphertextCommitmentEqualityProofData ,
48
- BatchedGroupedCiphertext3HandlesValidityProofData ,
49
- PercentageWithCapProofData ,
50
- BatchedGroupedCiphertext2HandlesValidityProofData ,
51
- BatchedRangeProofU256Data ,
52
- ) ,
53
- TokenProofGenerationError ,
54
- > {
56
+ ) -> Result < TransferWithFeeProofData , TokenProofGenerationError > {
55
57
let default_auditor_pubkey = ElGamalPubkey :: default ( ) ;
56
58
let auditor_elgamal_pubkey = auditor_elgamal_pubkey. unwrap_or ( & default_auditor_pubkey) ;
57
59
@@ -294,13 +296,13 @@ pub fn transfer_with_fee_split_proof_data(
294
296
)
295
297
. map_err ( TokenProofGenerationError :: from) ?;
296
298
297
- Ok ( (
299
+ Ok ( TransferWithFeeProofData {
298
300
equality_proof_data,
299
301
transfer_amount_ciphertext_validity_proof_data,
300
302
percentage_with_cap_proof_data,
301
303
fee_ciphertext_validity_proof_data,
302
304
range_proof_data,
303
- ) )
305
+ } )
304
306
}
305
307
306
308
fn calculate_fee ( transfer_amount : u64 , fee_rate_basis_points : u16 ) -> Option < ( u64 , u64 ) > {
0 commit comments