Skip to content

Commit

Permalink
chore(blockifier): replace sierra_program with casm field for NativeC…
Browse files Browse the repository at this point in the history
…ontractClassV1
  • Loading branch information
avivg-starkware committed Oct 27, 2024
1 parent 67997ef commit f8885f5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
10 changes: 4 additions & 6 deletions crates/blockifier/src/execution/contract_class.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::{
Expand Down Expand Up @@ -631,16 +631,15 @@ impl NativeContractClassV1 {
pub struct NativeContractClassV1Inner {
pub executor: AotNativeExecutor,
entry_points_by_type: EntryPointsByType<NativeEntryPoint>,
// Storing the raw sierra program and entry points to be able to compare the contract class.
sierra_program: Vec<BigUintAsHex>,
casm: Option<starknet_api::contract_class::ContractClass>,
}

impl NativeContractClassV1Inner {
fn new(executor: AotNativeExecutor, sierra_contract_class: SierraContractClass) -> Self {
NativeContractClassV1Inner {
executor,
entry_points_by_type: EntryPointsByType::from(&sierra_contract_class),
sierra_program: sierra_contract_class.sierra_program,
casm: None,
}
}
}
Expand All @@ -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
}
}

Expand Down
2 changes: 1 addition & 1 deletion crates/tests-integration/src/integration_test_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit f8885f5

Please sign in to comment.