Skip to content

Commit

Permalink
feat: fix bugs in the tests and remove debug prints
Browse files Browse the repository at this point in the history
  • Loading branch information
varex83 authored and rodrigo-pino committed Oct 26, 2024
1 parent 4fe754e commit b38c400
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
3 changes: 0 additions & 3 deletions crates/blockifier/src/execution/execution_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,6 @@ pub fn execute_entry_point_call_wrapper(
let current_tracked_resource =
context.tracked_resource_stack.pop().expect("Unexpected empty tracked resource.");

println!("enable_reverts: {:?}", context.versioned_constants().enable_reverts);
println!("res: {:?}", res);

match res {
Ok(call_info) => {
if call_info.execution.failed && !context.versioned_constants().enable_reverts {
Expand Down
6 changes: 5 additions & 1 deletion crates/blockifier/src/execution/native/syscall_handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,11 @@ impl<'state> StarknetSyscallHandler for &mut NativeSyscallHandler<'state> {
deploy_from_zero: bool,
remaining_gas: &mut u128,
) -> SyscallResult<(Felt, Vec<Felt>)> {
self.substract_syscall_gas_cost(remaining_gas, self.context.gas_costs().deploy_gas_cost)?;
self.substract_syscall_gas_cost(
remaining_gas,
SyscallSelector::Deploy,
self.context.gas_costs().deploy_gas_cost,
)?;

let deployer_address = self.contract_address;
let deployer_address_for_calculation =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ use crate::test_utils::initial_test_state::test_state;
use crate::test_utils::{calldata_for_deploy_test, trivial_external_entry_point_new, CairoVersion};

#[test_case(FeatureContract::TestContract(CairoVersion::Cairo1), 206800;"VM")]
#[test_case(FeatureContract::TestContract(CairoVersion::Native), 216800;"Native")]
fn no_constructor(deployer_contract: FeatureContract, expected_gas: u64) {
// TODO(Yoni): share the init code of the tests in this file.

Expand Down Expand Up @@ -88,7 +89,7 @@ fn no_constructor_nonempty_calldata(deployer_contract: FeatureContract) {
constructor."
));
}
#[test_case(FeatureContract::TestContract(CairoVersion::Native),226750, 5210;"Native")]
#[test_case(FeatureContract::TestContract(CairoVersion::Native),236750, 15210;"Native")]
#[test_case(FeatureContract::TestContract(CairoVersion::Cairo1),216750, 5210;"VM")]
fn with_constructor(
deployer_contract: FeatureContract,
Expand Down

0 comments on commit b38c400

Please sign in to comment.