Skip to content

Commit 971c908

Browse files
blockifier: fix conversion from nested feltts counts to optional nested int list
1 parent c0feab1 commit 971c908

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

crates/blockifier/src/execution/contract_class.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,13 @@ impl From<&NestedFeltCounts> for NestedIntList {
205205
}
206206
}
207207

208+
impl From<&NestedFeltCounts> for Option<NestedIntList> {
209+
fn from(counts: &NestedFeltCounts) -> Self {
210+
// If it's a single leaf, it means the original bytecode_segment_lengths was None
211+
if counts.is_leaf() { None } else { Some(counts.into()) }
212+
}
213+
}
214+
208215
/// The resource used to run a contract function.
209216
#[cfg_attr(feature = "transaction_serde", derive(serde::Deserialize))]
210217
#[derive(Clone, Copy, Default, Debug, Eq, PartialEq, Serialize)]

crates/starknet_os_runner/src/classes_provider.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ fn compiled_class_v1_to_casm(class: &CompiledClassV1) -> CasmContractClass {
3939
prime,
4040
compiler_version: String::new(),
4141
bytecode,
42-
bytecode_segment_lengths: Some(class.bytecode_segment_felt_sizes().into()),
42+
bytecode_segment_lengths: class.bytecode_segment_felt_sizes().into(),
4343
hints: Vec::new(),
4444
pythonic_hints: None,
4545
entry_points_by_type: (&class.entry_points_by_type).into(),

0 commit comments

Comments
 (0)