From ae1a1c5ee899dea892c0fd5e61880b5457a739ad Mon Sep 17 00:00:00 2001 From: Radinyn Date: Wed, 5 Jul 2023 09:38:03 +0200 Subject: [PATCH 1/3] Fixing cheatcode panic prototype --- .../src/cheatcodes_hint_processor.rs | 4 +- protostar-rust/src/running.rs | 43 +++++++++++++------ .../declare_test/tests/test_declare.cairo | 5 +++ 3 files changed, 37 insertions(+), 15 deletions(-) diff --git a/protostar-rust/src/cheatcodes_hint_processor.rs b/protostar-rust/src/cheatcodes_hint_processor.rs index 5c695bb36..f4a97c4d7 100644 --- a/protostar-rust/src/cheatcodes_hint_processor.rs +++ b/protostar-rust/src/cheatcodes_hint_processor.rs @@ -254,12 +254,12 @@ fn execute_cheatcode_hint( ) }); - let sierra_path = starknet_artifacts.contracts.iter().find_map(|contract| { + let Some(sierra_path) = starknet_artifacts.contracts.iter().find_map(|contract| { if contract.contract_name == contract_value_as_short_str { return Some(contract.artifacts.sierra.clone()); } None - }).unwrap_or_else(|| panic!("Failed to find contract {contract_value_as_short_str} in starknet_artifacts.json")); + }) else {return Err(HintError::CustomHint("Failed to find contract {contract_value_as_short_str} in starknet_artifacts.json".into()))}; let sierra_path = current_dir.join(sierra_path); let file = std::fs::File::open(&sierra_path) diff --git a/protostar-rust/src/running.rs b/protostar-rust/src/running.rs index 30a11ab5b..74fe84b68 100644 --- a/protostar-rust/src/running.rs +++ b/protostar-rust/src/running.rs @@ -1,14 +1,17 @@ use std::collections::HashMap; -use anyhow::{Context, Result}; +use anyhow::Result; use blockifier::transaction::transaction_utils_for_protostar::create_state_with_trivial_validation_account; use cairo_vm::serde::deserialize_program::HintParams; -use itertools::chain; +use itertools::{chain, Itertools}; +use cairo_felt::Felt252; use cairo_lang_casm::hints::Hint; use cairo_lang_casm::instructions::Instruction; use cairo_lang_runner::casm_run::hint_to_hint_params; -use cairo_lang_runner::CairoHintProcessor as CoreCairoHintProcessor; +use cairo_lang_runner::{ + CairoHintProcessor as CoreCairoHintProcessor, RunResultValue, RunnerError, +}; use cairo_lang_runner::{RunResult, SierraCasmRunner, StarknetState}; use test_collector::TestConfig; @@ -69,14 +72,28 @@ pub(crate) fn run_from_test_config( original_cairo_hint_processor: core_cairo_hint_processor, blockifier_state: Some(create_state_with_trivial_validation_account()), }; - let result = runner - .run_function( - runner.find_function(config.name.as_str())?, - &mut cairo_hint_processor, - hints_dict, - instructions, - builtins, - ) - .with_context(|| format!("Failed to run the function `{}`.", config.name.as_str()))?; - Ok(result) + + // TODO(Radinyn) 1: Add custom class wrapping RunResult + match runner.run_function( + runner.find_function(config.name.as_str())?, + &mut cairo_hint_processor, + hints_dict, + instructions, + builtins, + ) { + Ok(result) => Ok(result), + // CairoRunError comes from VirtualMachineError which may come from HintException that originates in the cheatcode processor + Err(RunnerError::CairoRunError(_)) => Ok(RunResult { + gas_counter: None, + memory: vec![], + // TODO(Radinyn) 2: add the string during creating custom class instance (recover it from the CairoRunError) + value: RunResultValue::Panic( + vec![4417637, 6386787, 7300197, 2123122, 7499634] // "Cheatcode error" + .into_iter() + .map(Felt252::from) + .collect_vec(), + ), + }), + Err(err) => Err(err.into()), + } } diff --git a/protostar-rust/tests/data/declare_test/tests/test_declare.cairo b/protostar-rust/tests/data/declare_test/tests/test_declare.cairo index 21bbb3fb6..f6c5f1c8d 100644 --- a/protostar-rust/tests/data/declare_test/tests/test_declare.cairo +++ b/protostar-rust/tests/data/declare_test/tests/test_declare.cairo @@ -18,3 +18,8 @@ fn multiple_contracts() { assert(class_hash != class_hash2, 'class hashes neq'); } + +#[test] +fn non_existant_contract() { + let class_hash = declare('GoodbyeStarknet').unwrap(); +} From d5f9f037ccd2c67d3fef838b9e71b5383304fb0a Mon Sep 17 00:00:00 2001 From: Radinyn Date: Wed, 5 Jul 2023 11:49:07 +0200 Subject: [PATCH 2/3] Enhanced Cheatcode Error --- protostar-rust/Cargo.lock | 45 +++---- protostar-rust/Cargo.toml | 1 + .../src/cheatcodes_hint_processor.rs | 119 ++++++++++++------ protostar-rust/src/running.rs | 4 +- protostar-rust/tests/e2e/running.rs | 15 ++- 5 files changed, 118 insertions(+), 66 deletions(-) diff --git a/protostar-rust/Cargo.lock b/protostar-rust/Cargo.lock index 48f68b7ca..17b2f413c 100644 --- a/protostar-rust/Cargo.lock +++ b/protostar-rust/Cargo.lock @@ -1541,7 +1541,7 @@ dependencies = [ "heck 0.4.1", "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.23", ] [[package]] @@ -1736,7 +1736,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1586fa608b1dab41f667475b4a41faec5ba680aee428bfa5de4ea520fdc6e901" dependencies = [ "quote", - "syn 2.0.18", + "syn 2.0.23", ] [[package]] @@ -2059,7 +2059,7 @@ checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" dependencies = [ "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.23", ] [[package]] @@ -2935,7 +2935,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.23", ] [[package]] @@ -3161,7 +3161,7 @@ checksum = "39407670928234ebc5e6e580247dd567ad73a3578460c5990f9503df207e8f07" dependencies = [ "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.23", ] [[package]] @@ -3247,9 +3247,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.60" +version = "1.0.63" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dec2b086b7a862cf4de201096214fa870344cf922b2b30c167badb3af3195406" +checksum = "7b368fba921b0dce7e60f5e04ec15e565b3303972b42bcfde1d0713b881959eb" dependencies = [ "unicode-ident", ] @@ -3262,9 +3262,9 @@ checksum = "8bccbff07d5ed689c4087d20d7307a52ab6141edeedf487c3876a55b86cf63df" [[package]] name = "quote" -version = "1.0.28" +version = "1.0.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b9ab9c7eadfd8df19006f1cf1a4aed13540ed5cbc047010ece5826e10825488" +checksum = "573015e8ab27661678357f27dc26460738fd2b6c86e46f386fde94cb5d913105" dependencies = [ "proc-macro2", ] @@ -3515,6 +3515,7 @@ dependencies = [ "starknet_api", "tempfile", "test-collector", + "thiserror", "walkdir", ] @@ -3759,7 +3760,7 @@ checksum = "d9735b638ccc51c28bf6914d90a2e9725b377144fc612c49a611fddd1b631d68" dependencies = [ "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.23", ] [[package]] @@ -4055,7 +4056,7 @@ checksum = "e6dc88f1f470d9de1001ffbb90d2344c9dd1a615f5467daf0574e2975dfd9ebd" dependencies = [ "starknet-curve 0.3.0", "starknet-ff 0.3.4", - "syn 2.0.18", + "syn 2.0.23", ] [[package]] @@ -4193,9 +4194,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.18" +version = "2.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32d41677bcbe24c20c52e7c70b0d8db04134c5d1066bf98662e2871ad200ea3e" +checksum = "59fb7d6d8281a51045d62b8eb3a7d1ce347b76f312af50cd3dc0af39c87c1737" dependencies = [ "proc-macro2", "quote", @@ -4288,22 +4289,22 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.40" +version = "1.0.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "978c9a314bd8dc99be594bc3c175faaa9794be04a5a5e153caba6915336cebac" +checksum = "c16a64ba9387ef3fdae4f9c1a7f07a0997fce91985c0336f1ddc1822b3b37802" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.40" +version = "1.0.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9456a42c5b0d803c8cd86e73dd7cc9edd429499f37a3550d286d5e86720569f" +checksum = "d14928354b01c4d6a4f0e549069adef399a284e7995c7ccca94e8a07a5346c59" dependencies = [ "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.23", ] [[package]] @@ -4416,7 +4417,7 @@ checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.23", ] [[package]] @@ -4674,7 +4675,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.23", "wasm-bindgen-shared", ] @@ -4708,7 +4709,7 @@ checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.23", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -5020,5 +5021,5 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.23", ] diff --git a/protostar-rust/Cargo.toml b/protostar-rust/Cargo.toml index 8ee91748c..2c65fec9c 100644 --- a/protostar-rust/Cargo.toml +++ b/protostar-rust/Cargo.toml @@ -42,6 +42,7 @@ ark-std = "0.3.0" ark-secp256k1 = "0.4.0" ark-secp256r1 = "0.4.0" num-traits = "0.2" +thiserror = "1.0.41" [lib] name = "rust_test_runner" diff --git a/protostar-rust/src/cheatcodes_hint_processor.rs b/protostar-rust/src/cheatcodes_hint_processor.rs index f4a97c4d7..628e9dc5f 100644 --- a/protostar-rust/src/cheatcodes_hint_processor.rs +++ b/protostar-rust/src/cheatcodes_hint_processor.rs @@ -3,10 +3,11 @@ use std::collections::hash_map::DefaultHasher; use std::collections::HashMap; use std::fs; use std::hash::{Hash, Hasher}; +use std::io; use std::path::PathBuf; use std::sync::Arc; -use anyhow::{anyhow, Result}; +use anyhow::{anyhow, Context, Result}; use blockifier::abi::abi_utils::selector_from_name; use blockifier::block_context::BlockContext; use blockifier::execution::contract_class::{ @@ -14,6 +15,7 @@ use blockifier::execution::contract_class::{ }; use blockifier::execution::entry_point::{CallEntryPoint, CallType}; use blockifier::state::cached_state::CachedState; +use blockifier::state::errors::StateError; use blockifier::state::state_api::StateReader; use blockifier::test_utils::{invoke_tx, DictStateReader}; use blockifier::test_utils::{MAX_FEE, TEST_ACCOUNT_CONTRACT_ADDRESS}; @@ -37,6 +39,7 @@ use cairo_vm::serde::deserialize_program::ApTracking; use cairo_vm::types::exec_scope::ExecutionScopes; use cairo_vm::types::relocatable::{MaybeRelocatable, Relocatable}; use cairo_vm::vm::errors::hint_errors::HintError; +use cairo_vm::vm::errors::memory_errors::MemoryError; use cairo_vm::vm::errors::vm_errors::VirtualMachineError; use cairo_vm::vm::vm_core::VirtualMachine; use num_traits::{Num, ToPrimitive}; @@ -48,7 +51,8 @@ use starknet_api::transaction::{ Calldata, ContractAddressSalt, DeclareTransactionV0V1, Fee, InvokeTransaction, InvokeTransactionV1, }; -use starknet_api::{patricia_key, stark_felt}; +use starknet_api::{patricia_key, stark_felt, StarknetApiError}; +use thiserror::Error; pub struct CairoHintProcessor<'a> { pub original_cairo_hint_processor: OriginalCairoHintProcessor<'a>, @@ -202,13 +206,53 @@ fn call_contract( Ok(return_data) } -#[allow(unused, clippy::too_many_lines)] +// All errors that can be thrown from the hint executor have to be added here, +// to prevent the whole runner from panicking +#[derive(Error, Debug)] +enum EnhancedHintError { + #[error("hint error: {0}")] + HintError(#[from] HintError), + #[error("io error: {0}")] + Io(#[from] io::Error), + #[error("anyhow error: {0}")] + Anyhow(#[from] anyhow::Error), + #[error("virtual machine error: {0}")] + VirtualMachineError(#[from] VirtualMachineError), + #[error("memory error: {0}")] + MemoryError(#[from] MemoryError), + #[error("blockifier state error: {0}")] + StateError(#[from] StateError), + #[error("serde json error: {0}")] + SerdeJsonError(#[from] serde_json::Error), + #[error("starknet api error: {0}")] + StarknetApiError(#[from] StarknetApiError), +} + +impl From for HintError { + fn from(error: EnhancedHintError) -> Self { + match error { + EnhancedHintError::HintError(error) => error, + error => HintError::CustomHint(error.to_string().into_boxed_str()), + } + } +} + fn execute_cheatcode_hint( vm: &mut VirtualMachine, exec_scopes: &mut ExecutionScopes, hint: &ProtostarHint, blockifier_state: &mut CachedState, ) -> Result<(), HintError> { + execute_cheatcode_hint_inner(vm, exec_scopes, hint, blockifier_state).map_err(Into::into) +} + +#[allow(unused, clippy::too_many_lines)] +fn execute_cheatcode_hint_inner( + vm: &mut VirtualMachine, + exec_scopes: &mut ExecutionScopes, + hint: &ProtostarHint, + blockifier_state: &mut CachedState, +) -> Result<(), EnhancedHintError> { match hint { &ProtostarHint::StartRoll { .. } => todo!(), &ProtostarHint::StopRoll { .. } => todo!(), @@ -222,13 +266,14 @@ fn execute_cheatcode_hint( let contract_value = get_val(vm, contract)?; let contract_value_as_short_str = as_cairo_short_string(&contract_value) - .expect("Converting contract name to short string failed"); + .ok_or_else(|| anyhow!("Converting contract name to short string failed"))?; + let current_dir = std::env::current_dir() - .expect("Failed to get current directory") + .context("Failed to get current directory")? .join("target/dev"); let mut paths = std::fs::read_dir(¤t_dir) - .expect("Failed to read ./target/dev, scarb build probably failed"); + .context("Failed to read ./target/dev, scarb build probably failed")?; let starknet_artifacts_entry = &paths .find_map(|path| match path { @@ -238,43 +283,39 @@ fn execute_cheatcode_hint( } Err(_) => None, }) - .expect("Failed to find starknet_artifacts.json file"); - let starknet_artifacts = fs::read_to_string(starknet_artifacts_entry.path()) - .unwrap_or_else(|_| { - panic!( - "Failed to read {:?} contents", - starknet_artifacts_entry.file_name() - ) - }); + .context("Failed to find starknet_artifacts.json file")?; + let starknet_artifacts = + fs::read_to_string(starknet_artifacts_entry.path()).context(format!( + "Failed to read {:?} contents", + starknet_artifacts_entry.file_name() + ))?; let starknet_artifacts: ScarbStarknetArtifacts = - serde_json::from_str(starknet_artifacts.as_str()).unwrap_or_else(|_| { - panic!( - "Failed to parse {:?} contents", - starknet_artifacts_entry.file_name() - ) - }); - - let Some(sierra_path) = starknet_artifacts.contracts.iter().find_map(|contract| { + serde_json::from_str(starknet_artifacts.as_str()).context(format!( + "Failed to parse {:?} contents", + starknet_artifacts_entry.file_name() + ))?; + + let sierra_path = starknet_artifacts.contracts.iter().find_map(|contract| { if contract.contract_name == contract_value_as_short_str { return Some(contract.artifacts.sierra.clone()); } None - }) else {return Err(HintError::CustomHint("Failed to find contract {contract_value_as_short_str} in starknet_artifacts.json".into()))}; + }).ok_or_else(|| anyhow!("Failed to find contract {contract_value_as_short_str} in starknet_artifacts.json"))?; let sierra_path = current_dir.join(sierra_path); let file = std::fs::File::open(&sierra_path) - .unwrap_or_else(|_| panic!("Failed to open file at path = {:?}", &sierra_path)); + .context(format!("Failed to open file at path = {:?}", &sierra_path))?; let sierra_contract_class: ContractClass = serde_json::from_reader(&file) - .unwrap_or_else(|_| panic!("File to parse json from file = {file:?}")); + .context(format!("File to parse json from file = {file:?}"))?; let casm_contract_class = CasmContractClass::from_contract_class(sierra_contract_class, true) - .expect("sierra to casm failed"); + .context("sierra to casm failed")?; let casm_serialized = serde_json::to_string_pretty(&casm_contract_class) - .expect("Failed to serialize contract to casm"); + .context("Failed to serialize contract to casm")?; let contract_class = ContractClassV1::try_from_json_string(&casm_serialized) - .expect("Failed to read contract class from json"); + .context("Failed to read contract class from json")?; let contract_class = BlockifierContractClass::V1(contract_class); // TODO(#2134) replace this. Hash should be calculated in the correct manner. This is just a workaround. @@ -287,7 +328,7 @@ fn execute_cheatcode_hint( .get_nonce_at(ContractAddress(patricia_key!( TEST_ACCOUNT_CONTRACT_ADDRESS ))) - .expect("Failed to get nonce"); + .context("Failed to get nonce")?; let declare_tx = DeclareTransactionV0V1 { nonce, @@ -302,16 +343,13 @@ fn execute_cheatcode_hint( let block_context = &BlockContext::create_for_account_testing(); let tx_result = account_tx .execute(blockifier_state, block_context) - .expect("Failed to execute declare transaction"); + .context("Failed to execute declare transaction")?; insert_value_to_cellref!( vm, result, felt252_from_hex_string(&class_hash.to_string()).unwrap() )?; - // TODO https://github.com/software-mansion/protostar/issues/2024 - // in case of errors above, consider not panicking, set an error and return it here - // instead insert_value_to_cellref!(vm, err_code, Felt252::from(0))?; Ok(()) } @@ -339,14 +377,14 @@ fn execute_cheatcode_hint( }; let mut curr = as_relocatable(vm, prepared_constructor_calldata_start)?; let end = as_relocatable(vm, prepared_constructor_calldata_end)?; - let calldata = read_data_from_range(vm, curr, end).unwrap(); + let calldata = read_data_from_range(vm, curr, end)?; // Deploy a contract using syscall deploy. let account_address = ContractAddress(patricia_key!(TEST_ACCOUNT_CONTRACT_ADDRESS)); let block_context = &BlockContext::create_for_account_testing(); let entry_point_selector = selector_from_name("deploy_contract"); let salt = ContractAddressSalt::default(); - let class_hash = ClassHash(StarkFelt::new(class_hash.to_be_bytes()).unwrap()); + let class_hash = ClassHash(StarkFelt::new(class_hash.to_be_bytes())?); let execute_calldata = create_execute_calldata( &calldata, @@ -358,23 +396,25 @@ fn execute_cheatcode_hint( let nonce = blockifier_state .get_nonce_at(account_address) - .expect("Failed to get nonce"); + .context("Failed to get nonce")?; let tx = invoke_tx(execute_calldata, account_address, Fee(MAX_FEE), None); let account_tx = AccountTransaction::Invoke(InvokeTransaction::V1(InvokeTransactionV1 { nonce, ..tx })); - let tx_result = account_tx.execute(blockifier_state, block_context).unwrap(); + let tx_result = account_tx + .execute(blockifier_state, block_context) + .context("Failed to execute deploy transaction")?; let return_data = tx_result .execute_call_info - .expect("Failed to get execution data from method") + .context("Failed to get execution data from method")? .execution .retdata; let contract_address = return_data .0 .get(0) - .expect("Failed to get contract_address from return_data"); + .context("Failed to get contract_address from return_data")?; let contract_address = Felt252::from_bytes_be(contract_address.bytes()); insert_value_to_cellref!(vm, deployed_contract_address, contract_address)?; @@ -410,6 +450,7 @@ fn execute_cheatcode_hint( } } +// Should this function panic? fn create_execute_calldata( calldata: &[Felt252], class_hash: &ClassHash, diff --git a/protostar-rust/src/running.rs b/protostar-rust/src/running.rs index 74fe84b68..8e3c9e5a3 100644 --- a/protostar-rust/src/running.rs +++ b/protostar-rust/src/running.rs @@ -73,7 +73,7 @@ pub(crate) fn run_from_test_config( blockifier_state: Some(create_state_with_trivial_validation_account()), }; - // TODO(Radinyn) 1: Add custom class wrapping RunResult + // TODO(2176) 1: Add custom class wrapping RunResult match runner.run_function( runner.find_function(config.name.as_str())?, &mut cairo_hint_processor, @@ -86,7 +86,7 @@ pub(crate) fn run_from_test_config( Err(RunnerError::CairoRunError(_)) => Ok(RunResult { gas_counter: None, memory: vec![], - // TODO(Radinyn) 2: add the string during creating custom class instance (recover it from the CairoRunError) + // TODO(2176) 2: add the string during creating custom class instance (recover it from the CairoRunError) value: RunResultValue::Panic( vec![4417637, 6386787, 7300197, 2123122, 7499634] // "Cheatcode error" .into_iter() diff --git a/protostar-rust/tests/e2e/running.rs b/protostar-rust/tests/e2e/running.rs index 33e64a61a..cee594ac6 100644 --- a/protostar-rust/tests/e2e/running.rs +++ b/protostar-rust/tests/e2e/running.rs @@ -115,13 +115,22 @@ fn with_declare() { .current_dir(&temp) .assert() .success() - .stdout_matches(indoc! {r#"Collected 2 test(s) and 3 test file(s) + .stdout_matches(indoc! {r#"Collected 3 test(s) and 3 test file(s) Running 0 test(s) from src/contract1.cairo Running 0 test(s) from src/lib.cairo - Running 2 test(s) from tests/test_declare.cairo + Running 3 test(s) from tests/test_declare.cairo [PASS] test_declare::test_declare::test_declare_simple [PASS] test_declare::test_declare::multiple_contracts - Tests: 2 passed, 0 failed, 0 skipped + [FAIL] test_declare::test_declare::non_existant_contract + + Failure data: + original value: [4417637], converted to a string: [Che] + original value: [6386787], converted to a string: [atc] + original value: [7300197], converted to a string: [ode] + original value: [2123122], converted to a string: [ er] + original value: [7499634], converted to a string: [ror] + + Tests: 2 passed, 1 failed, 0 skipped "#}); } From 43488b150209aa11b88d6c2908ee3e104a82b013 Mon Sep 17 00:00:00 2001 From: Radinyn Date: Wed, 5 Jul 2023 11:54:16 +0200 Subject: [PATCH 3/3] Lint --- protostar-rust/src/running.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/protostar-rust/src/running.rs b/protostar-rust/src/running.rs index 8e3c9e5a3..6bd694ed7 100644 --- a/protostar-rust/src/running.rs +++ b/protostar-rust/src/running.rs @@ -88,7 +88,7 @@ pub(crate) fn run_from_test_config( memory: vec![], // TODO(2176) 2: add the string during creating custom class instance (recover it from the CairoRunError) value: RunResultValue::Panic( - vec![4417637, 6386787, 7300197, 2123122, 7499634] // "Cheatcode error" + vec![4_417_637, 6_386_787, 7_300_197, 2_123_122, 7_499_634] // "Cheatcode error" .into_iter() .map(Felt252::from) .collect_vec(),