Skip to content
This repository has been archived by the owner on Aug 21, 2024. It is now read-only.

Commit

Permalink
chore: remove final f64s (#1574)
Browse files Browse the repository at this point in the history
Signed-off-by: Dori Medini <dori@starkware.co>
  • Loading branch information
dorimedini-starkware committed Feb 22, 2024
1 parent 3b21b36 commit c61d883
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions crates/blockifier/src/fee/gas_usage_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use crate::fee::gas_usage::{get_da_gas_cost, get_message_segment_length, get_tx_
use crate::state::cached_state::StateChangesCount;
use crate::transaction::objects::GasVector;
use crate::utils::u128_from_usize;
use crate::versioned_constants::VersionedConstants;
use crate::versioned_constants::{ResourceCost, VersionedConstants};
#[fixture]
fn versioned_constants() -> &'static VersionedConstants {
VersionedConstants::latest_constants()
Expand Down Expand Up @@ -157,9 +157,9 @@ fn test_onchain_data_discount() {

let cost_without_discount = (state_changes_count.n_storage_updates * 2) * (512 + 100);
let actual_cost = get_da_gas_cost(state_changes_count, use_kzg_da).l1_gas;
let cost_ratio = (actual_cost as f64) / (cost_without_discount as f64);
assert!(cost_ratio <= 0.9);
assert!(cost_ratio >= 0.88);
let cost_ratio = ResourceCost::new(actual_cost, u128_from_usize(cost_without_discount));
assert!(cost_ratio <= ResourceCost::new(9, 10));
assert!(cost_ratio >= ResourceCost::new(88, 100));
}

#[rstest]
Expand Down

0 comments on commit c61d883

Please sign in to comment.