diff --git a/cmd/soroban-rpc/lib/preflight/src/fees.rs b/cmd/soroban-rpc/lib/preflight/src/fees.rs index dca3fbd33..f0fe9e0de 100644 --- a/cmd/soroban-rpc/lib/preflight/src/fees.rs +++ b/cmd/soroban-rpc/lib/preflight/src/fees.rs @@ -43,8 +43,6 @@ pub(crate) fn compute_host_function_transaction_data_and_min_fee( calculate_host_function_soroban_resources(&ledger_changes, &post_storage.footprint, budget) .context("cannot compute host function resources")?; - let read_write_entries = u32::try_from(soroban_resources.footprint.read_write.as_vec().len())?; - let contract_events_size = calculate_contract_events_size_bytes(events).context("cannot calculate events size")?; let invocation_return_size = u32::try_from(invocation_result.to_xdr()?.len())?; @@ -53,9 +51,8 @@ pub(crate) fn compute_host_function_transaction_data_and_min_fee( let transaction_resources = TransactionResources { instructions: soroban_resources.instructions, - read_entries: u32::try_from(soroban_resources.footprint.read_only.as_vec().len())? - + read_write_entries, - write_entries: read_write_entries, + read_entries: u32::try_from(soroban_resources.footprint.read_only.as_vec().len())?, + write_entries: u32::try_from(soroban_resources.footprint.read_write.as_vec().len())?, read_bytes: soroban_resources.read_bytes, write_bytes: soroban_resources.write_bytes, // Note: we could get a better transaction size if the full transaction was passed down to libpreflight