Skip to content

Commit

Permalink
Format
Browse files Browse the repository at this point in the history
  • Loading branch information
DelevoXDG committed Dec 19, 2024
1 parent 59e7f74 commit d81a97d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
4 changes: 3 additions & 1 deletion scarb/src/compiler/compilers/starknet_contract/compiler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ use tracing::{debug, trace, trace_span};

use super::contract_selector::ContractSelector;
use crate::compiler::compilers::starknet_contract::contract_selector::GLOB_PATH_SELECTOR;
use crate::compiler::compilers::starknet_contract::validations::{check_allowed_libfuncs, check_sierra_size_limits, check_casm_size_limits};
use crate::compiler::compilers::starknet_contract::validations::{
check_allowed_libfuncs, check_casm_size_limits, check_sierra_size_limits,
};
use crate::compiler::compilers::{ensure_gas_enabled, ArtifactsWriter};
use crate::compiler::helpers::{build_compiler_config, collect_main_crate_ids};
use crate::compiler::{CairoCompilationUnit, CompilationUnitAttributes, Compiler};
Expand Down
12 changes: 3 additions & 9 deletions scarb/src/compiler/compilers/starknet_contract/validations.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ use cairo_lang_starknet::contract::ContractDeclaration;
use cairo_lang_starknet_classes::allowed_libfuncs::{
AllowedLibfuncsError, ListSelector, BUILTIN_EXPERIMENTAL_LIBFUNCS_LIST,
};
use cairo_lang_starknet_classes::contract_class::ContractClass;
use cairo_lang_starknet_classes::casm_contract_class::CasmContractClass;
use cairo_lang_starknet_classes::contract_class::ContractClass;
use cairo_lang_utils::Upcast;
use indoc::{formatdoc, writedoc};
use std::fmt::Write;
Expand Down Expand Up @@ -123,10 +123,7 @@ pub fn check_allowed_libfuncs(
Ok(())
}

pub fn check_sierra_size_limits(
classes: &[ContractClass],
ws: &Workspace<'_>,
) {
pub fn check_sierra_size_limits(classes: &[ContractClass], ws: &Workspace<'_>) {
for class in classes {
let sierra_felts = class.sierra_program.to_vec().len();
if sierra_felts > MAX_SIERRA_PROGRAM_FELTS {
Expand All @@ -146,10 +143,7 @@ pub fn check_sierra_size_limits(
}
}

pub fn check_casm_size_limits(
casm_classes: &[Option<CasmContractClass>],
ws: &Workspace<'_>,
) {
pub fn check_casm_size_limits(casm_classes: &[Option<CasmContractClass>], ws: &Workspace<'_>) {
for casm_class in casm_classes.iter().flatten() {
let casm_felts = casm_class.bytecode.len();
if casm_felts > MAX_CASM_PROGRAM_FELTS {
Expand Down

0 comments on commit d81a97d

Please sign in to comment.