Skip to content

Commit

Permalink
refactor(starknet_api): change default sierra contract class to valid…
Browse files Browse the repository at this point in the history
… one
  • Loading branch information
AvivYossef-starkware committed Dec 3, 2024
1 parent aa5b760 commit 8621e48
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion crates/starknet_api/src/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -209,14 +209,25 @@ impl StorageKey {
impl_from_through_intermediate!(u128, StorageKey, u8, u16, u32, u64);

/// A contract class.
#[derive(Debug, Clone, Default, Eq, PartialEq, Deserialize, Serialize, Hash)]
#[derive(Debug, Clone, Eq, PartialEq, Deserialize, Serialize, Hash)]
pub struct SierraContractClass {
pub sierra_program: Vec<Felt>,
pub contract_class_version: String,
pub entry_points_by_type: EntryPointByType,
pub abi: String,
}

impl Default for SierraContractClass {
fn default() -> Self {
Self {
sierra_program: [Felt::ONE, Felt::TWO, Felt::THREE].to_vec(),
contract_class_version: Default::default(),
entry_points_by_type: Default::default(),
abi: Default::default(),
}
}
}

/// An entry point of a [ContractClass](`crate::state::ContractClass`).
#[derive(Debug, Default, Clone, Eq, PartialEq, Hash, Deserialize, Serialize, PartialOrd, Ord)]
pub struct EntryPoint {
Expand Down

0 comments on commit 8621e48

Please sign in to comment.