diff --git a/crates/papyrus_execution/Cargo.toml b/crates/papyrus_execution/Cargo.toml index d64cb3e9c0..5572fa4862 100644 --- a/crates/papyrus_execution/Cargo.toml +++ b/crates/papyrus_execution/Cargo.toml @@ -44,3 +44,6 @@ papyrus_test_utils.workspace = true [package.metadata.cargo-machete] # The `rand` crate is used in the `testing` feature, which is optional. ignored = ["rand"] + +[lints] +workspace = true diff --git a/crates/papyrus_execution/src/objects.rs b/crates/papyrus_execution/src/objects.rs index 01c08e84ff..860d03e5bb 100644 --- a/crates/papyrus_execution/src/objects.rs +++ b/crates/papyrus_execution/src/objects.rs @@ -10,6 +10,7 @@ use blockifier::execution::call_info::{ }; use blockifier::execution::entry_point::CallType as BlockifierCallType; use blockifier::transaction::objects::{FeeType, TransactionExecutionInfo}; +use blockifier::utils::u64_from_usize; use cairo_vm::types::builtin_name::BuiltinName; use cairo_vm::vm::runners::cairo_runner::ExecutionResources as VmExecutionResources; use indexmap::IndexMap; @@ -368,7 +369,7 @@ fn vm_resources_to_execution_resources( if count == 0 { continue; } - let count: u64 = count as u64; + let count = u64_from_usize(count); match builtin_name { BuiltinName::output => continue, BuiltinName::pedersen => builtin_instance_counter.insert(Builtin::Pedersen, count), @@ -391,9 +392,9 @@ fn vm_resources_to_execution_resources( }; } Ok(ExecutionResources { - steps: vm_resources.n_steps as u64, + steps: u64_from_usize(vm_resources.n_steps), builtin_instance_counter, - memory_holes: vm_resources.n_memory_holes as u64, + memory_holes: u64_from_usize(vm_resources.n_memory_holes), da_gas_consumed: StarknetApiGasVector { l1_gas, l2_gas, l1_data_gas }, gas_consumed: StarknetApiGasVector::default(), })