From f8885f59d8213d164841f380056c671ef66c95a9 Mon Sep 17 00:00:00 2001 From: Aviv Greenburg Date: Tue, 22 Oct 2024 15:50:15 +0300 Subject: [PATCH] chore(blockifier): replace sierra_program with casm field for NativeContractClassV1 --- crates/blockifier/src/execution/contract_class.rs | 10 ++++------ crates/tests-integration/src/integration_test_utils.rs | 2 +- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/crates/blockifier/src/execution/contract_class.rs b/crates/blockifier/src/execution/contract_class.rs index 48ec3d607ef..5288fd63e3f 100644 --- a/crates/blockifier/src/execution/contract_class.rs +++ b/crates/blockifier/src/execution/contract_class.rs @@ -11,7 +11,7 @@ use cairo_lang_starknet_classes::contract_class::{ ContractEntryPoint as SierraContractEntryPoint, }; use cairo_lang_starknet_classes::NestedIntList; -use cairo_lang_utils::bigint::BigUintAsHex; +// use cairo_lang_utils::bigint::BigUintAsHex; #[allow(unused_imports)] use cairo_native::executor::AotNativeExecutor; use cairo_vm::serde::deserialize_program::{ @@ -631,8 +631,7 @@ impl NativeContractClassV1 { pub struct NativeContractClassV1Inner { pub executor: AotNativeExecutor, entry_points_by_type: EntryPointsByType, - // Storing the raw sierra program and entry points to be able to compare the contract class. - sierra_program: Vec, + casm: Option, } impl NativeContractClassV1Inner { @@ -640,7 +639,7 @@ impl NativeContractClassV1Inner { NativeContractClassV1Inner { executor, entry_points_by_type: EntryPointsByType::from(&sierra_contract_class), - sierra_program: sierra_contract_class.sierra_program, + casm: None, } } } @@ -649,8 +648,7 @@ impl NativeContractClassV1Inner { // be the same therefore we exclude it from the comparison. impl PartialEq for NativeContractClassV1Inner { fn eq(&self, other: &Self) -> bool { - self.entry_points_by_type == other.entry_points_by_type - && self.sierra_program == other.sierra_program + self.entry_points_by_type == other.entry_points_by_type && self.casm == other.casm } } diff --git a/crates/tests-integration/src/integration_test_utils.rs b/crates/tests-integration/src/integration_test_utils.rs index b9ccaaa72cc..4a78a9749f1 100644 --- a/crates/tests-integration/src/integration_test_utils.rs +++ b/crates/tests-integration/src/integration_test_utils.rs @@ -16,7 +16,7 @@ use starknet_api::block::BlockNumber; use starknet_api::core::{ContractAddress, PatriciaKey}; use starknet_api::rpc_transaction::RpcTransaction; use starknet_api::transaction::TransactionHash; -use starknet_api::{contract_address, felt, patricia_key}; +use starknet_api::{contract_address, patricia_key}; /* Aviv: 'felt' fails on unused import. temporary fix until main is fixed. */ use starknet_batcher::block_builder::BlockBuilderConfig; use starknet_batcher::config::BatcherConfig; use starknet_consensus_manager::config::ConsensusManagerConfig;