|
3 | 3 | use once_cell::sync::OnceCell; |
4 | 4 | use std::sync::Arc; |
5 | 5 |
|
6 | | -use cairo_vm::Felt252; |
7 | 6 | use serde::ser::Error; |
8 | 7 | use serde::{Deserialize, Deserializer, Serialize, Serializer}; |
9 | 8 | use serde_with::serde_as; |
@@ -314,33 +313,6 @@ pub struct FlattenedSierraClassWithAbi { |
314 | 313 | pub abi: Option<cairo_lang_starknet_classes::abi::Contract>, |
315 | 314 | } |
316 | 315 |
|
317 | | -/// A contract class structure for Pathfinder compatibility. |
318 | | -/// |
319 | | -/// This struct is used internally for converting between different contract class formats |
320 | | -/// while maintaining compatibility with Pathfinder's expected structure. |
321 | | -#[derive(Debug, Serialize)] |
322 | | -struct ContractClassForPathfinderCompat { |
323 | | - /// The Sierra program as a list of Felt252 values. |
324 | | - pub sierra_program: Vec<Felt252>, |
325 | | - /// The contract class version string. |
326 | | - pub contract_class_version: String, |
327 | | - /// Entry points organized by type. |
328 | | - pub entry_points_by_type: cairo_lang_starknet_classes::contract_class::ContractEntryPoints, |
329 | | - /// The ABI as a JSON string. |
330 | | - pub abi: String, |
331 | | -} |
332 | | - |
333 | | -impl From<cairo_lang_starknet_classes::contract_class::ContractClass> for ContractClassForPathfinderCompat { |
334 | | - fn from(value: cairo_lang_starknet_classes::contract_class::ContractClass) -> Self { |
335 | | - Self { |
336 | | - sierra_program: value.sierra_program.into_iter().map(|x| Felt252::from(x.value)).collect(), |
337 | | - contract_class_version: value.contract_class_version, |
338 | | - entry_points_by_type: value.entry_points_by_type, |
339 | | - abi: value.abi.map(|abi| abi.json()).unwrap_or_default(), |
340 | | - } |
341 | | - } |
342 | | -} |
343 | | - |
344 | 316 | impl TryFrom<&FlattenedSierraClass> for FlattenedSierraClassWithAbi { |
345 | 317 | type Error = serde_json::error::Error; |
346 | 318 |
|
|
0 commit comments