Skip to content

Commit

Permalink
Migrated extensions to signals (#1973)
Browse files Browse the repository at this point in the history
<!-- Reference any GitHub issues resolved by this PR -->

Closes #1610 

## Introduced changes

<!-- A brief description of the changes -->

- Migrated extensions to hooks

## Checklist

<!-- Make sure all of these are complete -->

- [x] Linked relevant issue
- [x] Updated relevant documentation
- [x] Added relevant tests
- [x] Performed self-review of the code
- [x] Added changes to `CHANGELOG.md`
  • Loading branch information
MaksymilianDemitraszek authored Apr 5, 2024
1 parent ad8513d commit e14ac36
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,10 @@ impl<'a> ExtensionLogic for CheatableStarknetRuntimeExtension<'a> {
}
}

fn post_syscall_hook(
fn handle_system_call_signal(
&mut self,
selector: &DeprecatedSyscallSelector,
selector: DeprecatedSyscallSelector,
_vm: &mut VirtualMachine,
extended_runtime: &mut Self::Runtime,
) {
let syscall_handler = &extended_runtime.hint_handler;
Expand Down
12 changes: 1 addition & 11 deletions crates/runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -302,10 +302,8 @@ impl<Extension: ExtensionLogic> ExtendedRuntime<Extension> {
} else {
self.extended_runtime
.execute_hint(vm, exec_scopes, hint_data, constants)?;

self.extension
.post_syscall_hook(&selector, &mut self.extended_runtime);

.handle_system_call_signal(selector, vm, &mut self.extended_runtime);
Ok(())
}
}
Expand Down Expand Up @@ -395,14 +393,6 @@ pub trait ExtensionLogic {
Ok(SyscallHandlingResult::Forwarded)
}

#[allow(clippy::trivially_copy_pass_by_ref)]
fn post_syscall_hook(
&mut self,
_selector: &DeprecatedSyscallSelector,
_extended_runtime: &mut Self::Runtime,
) {
}

#[allow(clippy::trivially_copy_pass_by_ref)]
fn handle_cheatcode(
&mut self,
Expand Down

0 comments on commit e14ac36

Please sign in to comment.