seedelf_cli::transaction

Function computation_fee

Source
pub fn computation_fee(mem_units: u64, cpu_units: u64) -> u64
Expand description

Computes the computation fee for a transaction.

This function calculates the total computation fee based on the memory and CPU units consumed. It applies a cost model where memory and CPU costs are scaled using pre-defined numerators and denominators.

§Arguments

  • mem_units - The number of memory units consumed.
  • cpu_units - The number of CPU units consumed.

§Returns

  • u64 - The total computation fee as a sum of the memory and CPU costs.