Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(db): Set instruction result at outcome insert #1117

Merged
merged 1 commit into from
Feb 21, 2024
Merged
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
5 changes: 3 additions & 2 deletions crates/interpreter/src/interpreter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,9 @@ impl Interpreter {
/// - Updates gas costs and records refunds in the interpreter's `gas` field.
/// - May alter `instruction_result` in case of external errors.
pub fn insert_create_outcome(&mut self, create_outcome: CreateOutcome) {
let instruction_result = create_outcome.instruction_result();
self.instruction_result = InstructionResult::Continue;

let instruction_result = create_outcome.instruction_result();
self.return_data_buffer = if instruction_result.is_revert() {
// Save data to return data buffer if the create reverted
create_outcome.output().to_owned()
Expand Down Expand Up @@ -213,6 +214,7 @@ impl Interpreter {
shared_memory: &mut SharedMemory,
call_outcome: CallOutcome,
) {
self.instruction_result = InstructionResult::Continue;
let out_offset = call_outcome.memory_start();
let out_len = call_outcome.memory_length();

Expand Down Expand Up @@ -314,7 +316,6 @@ impl Interpreter {
FN: Fn(&mut Interpreter, &mut H),
{
self.next_action = InterpreterAction::None;
self.instruction_result = InstructionResult::Continue;
self.shared_memory = shared_memory;
// main loop
while self.instruction_result == InstructionResult::Continue {
Expand Down
Loading