Skip to content

Commit

Permalink
fix: casm runner args and gas (#181)
Browse files Browse the repository at this point in the history
  • Loading branch information
shramee authored Dec 21, 2023
1 parent edea2f5 commit 3664b3a
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/scarb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ use scarb::{
ops::{self, collect_metadata, CompileOpts, MetadataOptions},
};

const AVAILABLE_GAS: usize = 999999999;

// Prepares testing crate
// Copies the exercise file into testing crate
pub fn prepare_crate_for_exercise(file_path: &PathBuf) -> PathBuf {
Expand Down Expand Up @@ -98,13 +100,17 @@ pub fn scarb_run(file_path: &PathBuf) -> anyhow::Result<String> {
.into_v1()
.with_context(|| format!("failed to load Sierra program: {file_path}"))?;

let runner = SierraCasmRunner::new(sierra_program.program, None, Default::default())?;
let runner = SierraCasmRunner::new(
sierra_program.program,
Some(Default::default()),
Default::default(),
)?;

let result = runner
.run_function_with_starknet_context(
runner.find_function("::main")?,
&[],
None,
Some(AVAILABLE_GAS),
StarknetState::default(),
)
.context("failed to run the function")?;
Expand Down

0 comments on commit 3664b3a

Please sign in to comment.