Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: casm runner args and gas #181

Merged
merged 1 commit into from
Dec 21, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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