Skip to content

Commit

Permalink
Second u64 cast cannot fail
Browse files Browse the repository at this point in the history
  • Loading branch information
Shaptic committed Feb 20, 2024
1 parent 59e8abf commit 783dc98
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions cmd/crates/soroban-rpc/src/txn.rs
Original file line number Diff line number Diff line change
Expand Up @@ -317,17 +317,15 @@ pub fn assemble(
let classic_transaction_fees = crate::DEFAULT_TRANSACTION_FEES;

// Pad the fees up by 15% for a bit of wiggle room
let padded_fee = u64::try_from(
let padded_fee = u64::from(
tx.fee.max(
classic_transaction_fees
+ u32::try_from(simulation.min_resource_fee)
.map_err(|_| Error::LargeFee(simulation.min_resource_fee))?,
),
)
.map_err(|_| Error::LargeFee(simulation.min_resource_fee))
/ 100
) / 100
* 115;
tx.fee(u32::try_from(padded_fee).map_err(|_| Error::LargeFee(padded_fee)));
tx.fee = u32::try_from(padded_fee).map_err(|_| Error::LargeFee(padded_fee))?;

tx.operations = vec![op].try_into()?;
tx.ext = TransactionExt::V1(transaction_data);
Expand Down

0 comments on commit 783dc98

Please sign in to comment.