Skip to content

Commit

Permalink
refactor: inline AdviceProvider provided methods
Browse files Browse the repository at this point in the history
  • Loading branch information
plafer committed Nov 19, 2024
1 parent 6bff1cc commit cb51a16
Show file tree
Hide file tree
Showing 14 changed files with 403 additions and 956 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#### Changes
- [BREAKING] `Process` no longer takes ownership of the `Host` (#1571)
- [BREAKING] `ProcessState` was converted from a trait to a struct (#1571)
- [BREAKING] `Host` and `AdviceProvider` traits simplified (#1572)

## 0.11.0 (2024-11-04)

Expand Down
5 changes: 1 addition & 4 deletions assembly/src/ast/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -470,10 +470,7 @@ fn test_ast_parsing_adv_injection() -> Result<(), Report> {
use super::AdviceInjectorNode::*;

let context = TestContext::new();
let source = source_file!(
&context,
"begin adv.push_u64div adv.push_mapval adv.insert_mem end"
);
let source = source_file!(&context, "begin adv.push_u64div adv.push_mapval adv.insert_mem end");
let forms = module!(begin!(
inst!(AdvInject(PushU64Div)),
inst!(AdvInject(PushMapVal)),
Expand Down
22 changes: 7 additions & 15 deletions miden/tests/integration/operations/decorators/mod.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use std::sync::Arc;

use processor::{
AdviceProvider, ExecutionError, Host, HostResponse, MastForest, MemAdviceProvider, ProcessState,
AdviceProvider, ExecutionError, Host, MastForest, MemAdviceProvider, ProcessState,
};
use vm_core::DebugOptions;

Expand Down Expand Up @@ -40,31 +40,23 @@ impl<A: AdviceProvider> Host for TestHost<A> {
&mut self.adv_provider
}

fn on_event(
&mut self,
_process: ProcessState,
event_id: u32,
) -> Result<HostResponse, ExecutionError> {
fn on_event(&mut self, _process: ProcessState, event_id: u32) -> Result<(), ExecutionError> {
self.event_handler.push(event_id);
Ok(HostResponse::None)
Ok(())
}

fn on_trace(
&mut self,
_process: ProcessState,
trace_id: u32,
) -> Result<HostResponse, ExecutionError> {
fn on_trace(&mut self, _process: ProcessState, trace_id: u32) -> Result<(), ExecutionError> {
self.trace_handler.push(trace_id);
Ok(HostResponse::None)
Ok(())
}

fn on_debug(
&mut self,
_process: ProcessState,
_options: &DebugOptions,
) -> Result<HostResponse, ExecutionError> {
) -> Result<(), ExecutionError> {
self.debug_handler.push(_options.to_string());
Ok(HostResponse::None)
Ok(())
}

fn get_mast_forest(&self, _node_digest: &prover::Digest) -> Option<Arc<MastForest>> {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use alloc::vec::Vec;

use super::super::{ExecutionError, Felt, Word};
use super::{ExecutionError, Felt, Word};

/// Gets as input a vector containing a secret key, and a word representing a message and outputs a
/// vector of values to be pushed onto the advice stack.
Expand Down
187 changes: 0 additions & 187 deletions processor/src/host/advice/injectors/adv_map_injectors.rs

This file was deleted.

Loading

0 comments on commit cb51a16

Please sign in to comment.