diff --git a/crates/native_blockifier/src/py_transaction.rs b/crates/native_blockifier/src/py_transaction.rs index 6d7bf55ce75..5ba4ac02ec2 100644 --- a/crates/native_blockifier/src/py_transaction.rs +++ b/crates/native_blockifier/src/py_transaction.rs @@ -165,7 +165,7 @@ pub struct PyClassInfo { raw_contract_class: String, sierra_program_length: usize, abi_length: usize, - sierra_version: (u64, u64, u64), + sierra_version: Option<(u64, u64, u64)>, } impl PyClassInfo { @@ -184,13 +184,12 @@ impl PyClassInfo { SierraVersion::from(py_class_info.sierra_version), )), }; - let (major, minor, patch) = py_class_info.sierra_version; let class_info = ClassInfo::new( &contract_class, py_class_info.sierra_program_length, py_class_info.abi_length, - SierraVersion::new(major, minor, patch), + SierraVersion::from(py_class_info.sierra_version), )?; Ok(class_info) } diff --git a/crates/starknet_api/src/contract_class.rs b/crates/starknet_api/src/contract_class.rs index 4d4b742883f..c29ebbb6a07 100644 --- a/crates/starknet_api/src/contract_class.rs +++ b/crates/starknet_api/src/contract_class.rs @@ -118,9 +118,12 @@ impl FromStr for SierraVersion { } } -impl From<(u64, u64, u64)> for SierraVersion { - fn from((major, minor, patch): (u64, u64, u64)) -> Self { - Self::new(major, minor, patch) +impl From> for SierraVersion { + fn from(optional_sierra_version: Option<(u64, u64, u64)>) -> Self { + match optional_sierra_version { + Some((major, minor, patch)) => Self::new(major, minor, patch), + None => Self::DEPRECATED, + } } }