cairo_lang_starknet::compile

Function compile_prepared_db

source
pub fn compile_prepared_db(
    db: &RootDatabase,
    contracts: &[&ContractDeclaration],
    compiler_config: CompilerConfig<'_>,
) -> Result<Vec<ContractClass>>
Expand description

Runs Starknet contracts compiler.

§Arguments

  • db - Preloaded compilation database.
  • contracts - ContractDeclarations to compile. Use find_contracts to find contracts in db.
  • compiler_config - The compiler configuration.

§Returns

  • Ok(Vec<ContractClass>) - List of all compiled contract classes found in main crates.
  • Err(anyhow::Error) - Compilation failed.