Skip to content
This repository was archived by the owner on Mar 11, 2025. It is now read-only.

Commit abfb964

Browse files
committed
cargo fmt
1 parent de97337 commit abfb964

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

token/confidential-transfer/proof-generation/src/transfer_with_fee.rs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,8 @@ pub fn transfer_with_fee_split_proof_data(
139139
let (raw_fee_amount, delta_fee) = calculate_fee(transfer_amount, transfer_fee_basis_points)
140140
.ok_or(TokenProofGenerationError::FeeCalculation)?;
141141

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
143144
let fee_amount = std::cmp::min(transfer_fee_maximum_fee, raw_fee_amount);
144145

145146
// split and encrypt fee
@@ -302,10 +303,11 @@ pub fn transfer_with_fee_split_proof_data(
302303
fn calculate_fee(transfer_amount: u64, fee_rate_basis_points: u16) -> Option<(u64, u64)> {
303304
let numerator = (transfer_amount as u128).checked_mul(fee_rate_basis_points as u128)?;
304305

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.
309311
let fee = numerator
310312
.checked_add(ONE_IN_BASIS_POINTS)?
311313
.checked_sub(1)?

0 commit comments

Comments
 (0)