Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
#### Added

- Support for `meta_tx_v0` syscall with cheatcode compatibility
- `snforge` now supports [oracles](https://docs.swmansion.com/cairo-oracle/) with `--experimental-oracles` flag.
- `snforge` now supports [oracles](https://docs.swmansion.com/cairo-oracle/).
- `--trace-components` flag to allow selecting which components of the trace to do display. Read more [here](https://foundry-rs.github.io/starknet-foundry/snforge-advanced-features/debugging.html#trace-components)

### Changed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,6 @@ pub struct ForgeExtension<'a> {
pub environment_variables: &'a HashMap<String, String>,
pub contracts_data: &'a ContractsData,
pub fuzzer_rng: Option<Arc<Mutex<StdRng>>>,
/// Whether `--experimental-oracles` flag has been enabled.
pub experimental_oracles_enabled: bool,
pub oracle_hint_service: OracleHintService,
}

Expand All @@ -80,14 +78,6 @@ impl<'a> ExtensionLogic for ForgeExtension<'a> {
.oracle_hint_service
.accept_cheatcode(selector.as_bytes())
{
if !self.experimental_oracles_enabled {
return Err(anyhow!(
"Oracles are an experimental feature. \
To enable them, pass `--experimental-oracles` CLI flag."
)
.into());
}

let output = self
.oracle_hint_service
.execute_cheatcode(oracle_selector, input_reader.into_remaining());
Expand Down
3 changes: 0 additions & 3 deletions crates/forge-runner/src/forge_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ pub struct TestRunnerConfig {
pub contracts_data: ContractsData,
pub environment_variables: HashMap<String, String>,
pub tracked_resource: ForgeTrackedResource,
pub experimental_oracles: bool,
}

#[derive(Debug, PartialEq)]
Expand Down Expand Up @@ -90,7 +89,6 @@ pub struct RuntimeConfig<'a> {
pub contracts_data: &'a ContractsData,
pub environment_variables: &'a HashMap<String, String>,
pub tracked_resource: &'a ForgeTrackedResource,
pub experimental_oracles: bool,
}

impl<'a> RuntimeConfig<'a> {
Expand All @@ -103,7 +101,6 @@ impl<'a> RuntimeConfig<'a> {
contracts_data: &value.contracts_data,
environment_variables: &value.environment_variables,
tracked_resource: &value.tracked_resource,
experimental_oracles: value.experimental_oracles,
}
}
}
1 change: 0 additions & 1 deletion crates/forge-runner/src/running.rs
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,6 @@ pub fn run_test_case(
environment_variables: runtime_config.environment_variables,
contracts_data: runtime_config.contracts_data,
fuzzer_rng,
experimental_oracles_enabled: runtime_config.experimental_oracles,
oracle_hint_service: OracleHintService::new(Some(versioned_program_path.as_std_path())),
};

Expand Down
10 changes: 0 additions & 10 deletions crates/forge/src/combine_configs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ pub fn combine_configs(
forge_config_from_scarb: &ForgeConfigFromScarb,
additional_args: &[OsString],
trace_args: TraceArgs,
experimental_oracles: bool,
) -> ForgeConfig {
let execution_data_to_save = ExecutionDataToSave::from_flags(
save_trace_data || forge_config_from_scarb.save_trace_data,
Expand All @@ -52,7 +51,6 @@ pub fn combine_configs(
contracts_data,
tracked_resource,
environment_variables: env::vars().collect(),
experimental_oracles,
}),
output_config: Arc::new(OutputConfig {
trace_args,
Expand Down Expand Up @@ -83,7 +81,6 @@ mod tests {
&ForgeConfigFromScarb::default(),
&[],
TraceArgs::default(),
false,
);
let config2 = combine_configs(
false,
Expand All @@ -100,7 +97,6 @@ mod tests {
&ForgeConfigFromScarb::default(),
&[],
TraceArgs::default(),
false,
);

assert_ne!(config.test_runner_config.fuzzer_seed, 0);
Expand Down Expand Up @@ -128,7 +124,6 @@ mod tests {
&ForgeConfigFromScarb::default(),
&[],
TraceArgs::default(),
false,
);
assert_eq!(
config,
Expand All @@ -143,7 +138,6 @@ mod tests {
cache_dir: Utf8PathBuf::default(),
contracts_data: ContractsData::default(),
environment_variables: config.test_runner_config.environment_variables.clone(),
experimental_oracles: false,
}),
output_config: Arc::new(OutputConfig {
detailed_resources: false,
Expand Down Expand Up @@ -184,7 +178,6 @@ mod tests {
&config_from_scarb,
&[],
TraceArgs::default(),
false,
);
assert_eq!(
config,
Expand All @@ -199,7 +192,6 @@ mod tests {
cache_dir: Utf8PathBuf::default(),
contracts_data: ContractsData::default(),
environment_variables: config.test_runner_config.environment_variables.clone(),
experimental_oracles: false,
}),
output_config: Arc::new(OutputConfig {
detailed_resources: true,
Expand Down Expand Up @@ -244,7 +236,6 @@ mod tests {
&config_from_scarb,
&[],
TraceArgs::default(),
false,
);

assert_eq!(
Expand All @@ -260,7 +251,6 @@ mod tests {
cache_dir: Utf8PathBuf::default(),
contracts_data: ContractsData::default(),
environment_variables: config.test_runner_config.environment_variables.clone(),
experimental_oracles: false,
}),
output_config: Arc::new(OutputConfig {
detailed_resources: true,
Expand Down
4 changes: 0 additions & 4 deletions crates/forge/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -207,10 +207,6 @@ pub struct TestArgs {
#[arg(last = true)]
additional_args: Vec<OsString>,

/// Enable experimental oracles support.
#[arg(long, default_value_t = false, env = "SNFORGE_EXPERIMENTAL_ORACLES")]
experimental_oracles: bool,

#[command(flatten)]
scarb_args: ScarbArgs,
}
Expand Down
1 change: 0 additions & 1 deletion crates/forge/src/run_tests/package.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@ impl RunForPackageArgs {
&forge_config_from_scarb,
&args.additional_args,
args.trace_args.clone(),
args.experimental_oracles,
));

let test_filter = TestsFilter::from_flags(
Expand Down
1 change: 0 additions & 1 deletion crates/forge/test_utils/src/running_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ pub fn run_test_case(
contracts_data: ContractsData::try_from(test.contracts(&ui).unwrap()).unwrap(),
tracked_resource,
environment_variables: test.env().clone(),
experimental_oracles: false,
}),
output_config: Arc::new(OutputConfig {
detailed_resources: false,
Expand Down
2 changes: 0 additions & 2 deletions crates/forge/tests/integration/setup_fork.rs
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,6 @@ fn fork_aliased_decorator() {
.unwrap(),
tracked_resource: ForgeTrackedResource::CairoSteps,
environment_variables: test.env().clone(),
experimental_oracles: false,
}),
output_config: Arc::new(OutputConfig {
detailed_resources: false,
Expand Down Expand Up @@ -253,7 +252,6 @@ fn fork_aliased_decorator_overrding() {
.unwrap(),
tracked_resource: ForgeTrackedResource::CairoSteps,
environment_variables: test.env().clone(),
experimental_oracles: false,
}),
output_config: Arc::new(OutputConfig {
detailed_resources: false,
Expand Down
4 changes: 0 additions & 4 deletions docs/src/appendix/snforge/test.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,10 +131,6 @@ Use Scarb release profile.
## `--dev`
Use Scarb dev profile.

## `--experimental-oracles`

Enable experimental [oracles](../../snforge-advanced-features/oracles.md) support.

## `-h`, `--help`

Print help.
5 changes: 0 additions & 5 deletions docs/src/snforge-advanced-features/oracles.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
# Oracles

> ⚠️ **Warning**
>
> Oracles are an experimental feature.
> To enable them, you must pass the `--experimental-oracles` flag to `snforge`.
An [oracle][oracle docs] is an external process (like a script, binary, or web service)
that exposes custom logic or data to a Cairo program at runtime. You use it to perform tasks the Cairo VM can't, such as
accessing real-world data or executing complex, non-provable computations.
Expand Down
Loading