-
Notifications
You must be signed in to change notification settings - Fork 189
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(katana-primitives): move class related types to a separate m…
…odule
- Loading branch information
Showing
40 changed files
with
146 additions
and
154 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
use cairo_lang_starknet::casm_contract_class::CasmContractClass; | ||
|
||
use crate::FieldElement; | ||
|
||
/// The canonical hash of a contract class. This is the identifier of a class. | ||
pub type ClassHash = FieldElement; | ||
/// The hash of a compiled contract class. | ||
pub type CompiledClassHash = FieldElement; | ||
|
||
pub type SierraClass = starknet::core::types::contract::SierraClass; | ||
pub type FlattenedSierraClass = starknet::core::types::FlattenedSierraClass; | ||
|
||
/// Deprecated legacy (Cairo 0) CASM class | ||
pub type DeprecatedCompiledClass = ::starknet_api::deprecated_contract_class::ContractClass; | ||
|
||
/// Represents an executable Sierra program. | ||
#[derive(Debug, Clone, Eq, PartialEq)] | ||
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] | ||
pub struct SierraProgram { | ||
pub program: cairo_lang_sierra::program::Program, | ||
pub entry_points_by_type: cairo_lang_starknet::contract_class::ContractEntryPoints, | ||
} | ||
|
||
#[derive(Debug, Clone, Eq, PartialEq)] | ||
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] | ||
pub struct SierraCompiledClass { | ||
pub casm: CasmContractClass, | ||
pub sierra: SierraProgram, | ||
} | ||
|
||
/// Executable contract class | ||
#[allow(clippy::large_enum_variant)] | ||
#[derive(Debug, Clone, Eq, PartialEq, derive_more::From)] | ||
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] | ||
pub enum CompiledClass { | ||
Class(SierraCompiledClass), | ||
Deprecated(DeprecatedCompiledClass), | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.