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 22, 2024
1 parent aa9f5d7 commit ceef684
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 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 @@ -45,6 +45,7 @@ use crate::execution::errors::{ContractClassError, PreExecutionError};
use crate::execution::execution_utils::{poseidon_hash_many_cost, sn_api_to_cairo_vm_program};
use crate::execution::native::utils::contract_entrypoint_to_entrypoint_selector;
use crate::fee::eth_gas_constants;
//use crate::fee::resources::StarknetResources;
use crate::transaction::errors::TransactionExecutionError;
use crate::versioned_constants::CompilerVersion;

Expand Down Expand Up @@ -632,15 +633,16 @@ 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>,
//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 @@ -650,7 +652,7 @@ impl NativeContractClassV1Inner {
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.casm == other.casm
}
}

Expand Down

0 comments on commit ceef684

Please sign in to comment.