Skip to content

Commit

Permalink
Correctly propagate debugger state while in a contract context (#879)
Browse files Browse the repository at this point in the history
* Correctly propagate debugger state while in a contract

* Add changelog entry

---------

Co-authored-by: AurelienFT <32803821+AurelienFT@users.noreply.github.com>
  • Loading branch information
Dentosal and AurelienFT authored Dec 7, 2024
1 parent 4de6034 commit a80f82e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
## [Unreleased]

### Fixed
- [879](https://github.com/FuelLabs/fuel-vm/pull/879): Debugger state wasn't propagated in contract contexts.
- [878](https://github.com/FuelLabs/fuel-vm/pull/878): Fix the transaction de/serialization that wasn't backward compatible with the addition of the new policy.

## [Version 0.59.0]
Expand Down
12 changes: 5 additions & 7 deletions fuel-vm/src/interpreter/executors/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1037,20 +1037,18 @@ where

if in_call {
// Only reverts should terminate execution from a call context
if let ExecuteState::Revert(r) = state {
return Ok(ProgramState::Revert(r));
match state {
ExecuteState::Revert(r) => return Ok(ProgramState::Revert(r)),
ExecuteState::DebugEvent(d) => return Ok(ProgramState::RunProgram(d)),
_ => {}
}
} else {
match state {
ExecuteState::Return(r) => return Ok(ProgramState::Return(r)),

ExecuteState::ReturnData(d) => return Ok(ProgramState::ReturnData(d)),

ExecuteState::Revert(r) => return Ok(ProgramState::Revert(r)),

ExecuteState::Proceed => (),

ExecuteState::DebugEvent(d) => return Ok(ProgramState::RunProgram(d)),
ExecuteState::Proceed => {}
}
}
}
Expand Down

0 comments on commit a80f82e

Please sign in to comment.