Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion crates/sdk/tests/integration_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ fn test_metered_execution_suspension() -> eyre::Result<()> {
let metered_ctx = vm.build_metered_ctx(&exe).with_suspend_on_segment(true);
let vm_state = interpreter.create_initial_vm_state(vec![]);
let mut vm_exec_state = VmExecState::new(vm_state, metered_ctx);
vm_exec_state = interpreter.execute_metered_until_suspension(vm_exec_state)?;
vm_exec_state = interpreter.execute_metered_until_suspend(vm_exec_state)?;
assert!(
vm_exec_state.exit_code.is_ok(),
"Execution exits with an error: {:?}",
Expand Down
4 changes: 2 additions & 2 deletions crates/vm/src/arch/interpreter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ where
let mut exec_state = VmExecState::new(from_state, ctx);

loop {
exec_state = self.execute_metered_until_suspension(exec_state)?;
exec_state = self.execute_metered_until_suspend(exec_state)?;
// The execution has terminated.
if exec_state.exit_code.is_ok() && exec_state.exit_code.as_ref().unwrap().is_some() {
break;
Expand Down Expand Up @@ -443,7 +443,7 @@ where
/// normal completion.
/// - `Err(ExecutionError)`: If there is an error during execution, such as an invalid state or
/// run-time error.
pub fn execute_metered_until_suspension(
pub fn execute_metered_until_suspend(
&self,
mut exec_state: VmExecState<F, GuestMemory, MeteredCtx>,
) -> Result<VmExecState<F, GuestMemory, MeteredCtx>, ExecutionError> {
Expand Down