Skip to content

Commit

Permalink
chore: add tests for starknet_getCompiledCasm
Browse files Browse the repository at this point in the history
  • Loading branch information
t00ts committed Nov 6, 2024
1 parent 613dc79 commit 051657a
Show file tree
Hide file tree
Showing 2 changed files with 1,459 additions and 5 deletions.
10 changes: 5 additions & 5 deletions crates/common/src/casm_class.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use serde::{Deserialize, Serialize};
use crate::EntryPoint;

/// A contract in the Starknet network.
#[derive(Debug, Serialize, Deserialize)]
#[derive(Debug, Serialize, Deserialize, Eq, PartialEq)]
pub struct CasmContractClass {
pub bytecode: Vec<Felt>,
pub bytecode_segment_lengths: Option<NestedIntList>,
Expand All @@ -17,7 +17,7 @@ pub struct CasmContractClass {
}

/// The entry points (functions) of a contract.
#[derive(Debug, Serialize, Deserialize)]
#[derive(Debug, Serialize, Deserialize, Eq, PartialEq)]
pub struct CasmContractEntryPoints {
#[serde(rename = "EXTERNAL")]
pub external: Vec<CasmContractEntryPoint>,
Expand All @@ -28,7 +28,7 @@ pub struct CasmContractEntryPoints {
}

/// An entry point (function) of a contract.
#[derive(Debug, Serialize, Deserialize)]
#[derive(Debug, Serialize, Deserialize, Eq, PartialEq)]
pub struct CasmContractEntryPoint {
/// A field element that encodes the signature of the called function.
pub selector: EntryPoint,
Expand All @@ -40,7 +40,7 @@ pub struct CasmContractEntryPoint {
}

/// A field element that encodes the signature of the called function.
#[derive(Debug, Serialize, Deserialize)]
#[derive(Debug, Serialize, Deserialize, Eq, PartialEq)]
#[serde(transparent)]
pub struct BigUintAsHex {
/// A field element that encodes the signature of the called function.
Expand Down Expand Up @@ -82,7 +82,7 @@ where
/// is segmented by its branches. It is also possible to have the inner
/// segmentation only for some of the functions, while others are kept as
/// non-segmented leaves in the tree.
#[derive(Debug, Serialize, Deserialize)]
#[derive(Debug, Serialize, Deserialize, Eq, PartialEq)]
#[serde(untagged)]
pub enum NestedIntList {
Leaf(usize),
Expand Down
Loading

0 comments on commit 051657a

Please sign in to comment.