Skip to content

Commit

Permalink
refactor(blockifier): clean runnable contract class code
Browse files Browse the repository at this point in the history
  • Loading branch information
noaov1 committed Nov 6, 2024
1 parent a9f3df7 commit 2870f65
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 27 deletions.
12 changes: 0 additions & 12 deletions crates/blockifier/src/execution/contract_class.rs
Original file line number Diff line number Diff line change
Expand Up @@ -285,18 +285,6 @@ impl ContractClassV1 {

Ok(contract_class)
}

/// Returns an empty contract class for testing purposes.
#[cfg(any(feature = "testing", test))]
pub fn empty_for_testing() -> Self {
Self(Arc::new(ContractClassV1Inner {
program: Default::default(),
entry_points_by_type: Default::default(),
hints: Default::default(),
compiler_version: Default::default(),
bytecode_segment_lengths: NestedIntList::Leaf(0),
}))
}
}

/// Returns the estimated VM resources required for computing Casm hash (for Cairo 1 contracts).
Expand Down
15 changes: 0 additions & 15 deletions crates/blockifier/src/test_utils/struct_impls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ use crate::bouncer::{BouncerConfig, BouncerWeights, BuiltinCount};
use crate::context::{BlockContext, ChainInfo, FeeTokenAddresses, TransactionContext};
use crate::execution::call_info::{CallExecution, CallInfo, Retdata};
use crate::execution::common_hints::ExecutionMode;
use crate::execution::contract_class::{ContractClassV0, ContractClassV1};
use crate::execution::entry_point::{
CallEntryPoint,
EntryPointExecutionContext,
Expand Down Expand Up @@ -223,20 +222,6 @@ pub trait LoadContractFromFile: serde::de::DeserializeOwned {
impl LoadContractFromFile for CasmContractClass {}
impl LoadContractFromFile for DeprecatedContractClass {}

impl ContractClassV0 {
pub fn from_file(contract_path: &str) -> Self {
let raw_contract_class = get_raw_contract_class(contract_path);
Self::try_from_json_string(&raw_contract_class).unwrap()
}
}

impl ContractClassV1 {
pub fn from_file(contract_path: &str) -> Self {
let raw_contract_class = get_raw_contract_class(contract_path);
Self::try_from_json_string(&raw_contract_class).unwrap()
}
}

impl BouncerWeights {
pub fn create_for_testing(builtin_count: BuiltinCount) -> Self {
Self { builtin_count, ..Self::empty() }
Expand Down

0 comments on commit 2870f65

Please sign in to comment.