@@ -139,7 +139,8 @@ pub fn transfer_with_fee_split_proof_data(
139
139
let ( raw_fee_amount, delta_fee) = calculate_fee ( transfer_amount, transfer_fee_basis_points)
140
140
. ok_or ( TokenProofGenerationError :: FeeCalculation ) ?;
141
141
142
- // if raw fee is greater than the maximum fee, then use the maximum fee for the fee amount
142
+ // if raw fee is greater than the maximum fee, then use the maximum fee for the
143
+ // fee amount
143
144
let fee_amount = std:: cmp:: min ( transfer_fee_maximum_fee, raw_fee_amount) ;
144
145
145
146
// split and encrypt fee
@@ -302,10 +303,11 @@ pub fn transfer_with_fee_split_proof_data(
302
303
fn calculate_fee ( transfer_amount : u64 , fee_rate_basis_points : u16 ) -> Option < ( u64 , u64 ) > {
303
304
let numerator = ( transfer_amount as u128 ) . checked_mul ( fee_rate_basis_points as u128 ) ?;
304
305
305
- // Warning: Division may involve CPU opcodes that have variable execution times. This
306
- // non-constant-time execution of the fee calculation can theoretically reveal information
307
- // about the transfer amount. For transfers that invole extremely sensitive data, additional
308
- // care should be put into how the fees are calculated.
306
+ // Warning: Division may involve CPU opcodes that have variable execution times.
307
+ // This non-constant-time execution of the fee calculation can theoretically
308
+ // reveal information about the transfer amount. For transfers that invole
309
+ // extremely sensitive data, additional care should be put into how the fees
310
+ // are calculated.
309
311
let fee = numerator
310
312
. checked_add ( ONE_IN_BASIS_POINTS ) ?
311
313
. checked_sub ( 1 ) ?
0 commit comments