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: returndata buffer emptied on stop #948

Merged
merged 3 commits into from
Sep 17, 2024
Merged
Show file tree
Hide file tree
Changes from 2 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
3 changes: 1 addition & 2 deletions crates/evm/src/backend/validation.cairo
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
use contracts::IKakarotCore;
use contracts::account_contract::{IAccountDispatcher, IAccountDispatcherTrait};
use contracts::kakarot_core::KakarotCore;
use core::ops::SnapshotDeref;
Expand Down Expand Up @@ -78,7 +77,7 @@ mod tests {
use utils::constants::BLOCK_GAS_LIMIT;
use utils::eth_transaction::common::TxKind;
use utils::eth_transaction::eip1559::TxEip1559;
use utils::eth_transaction::transaction::{Transaction, TransactionTrait};
use utils::eth_transaction::transaction::Transaction;

fn set_up() -> KakarotCore::ContractState {
// Define the addresses used in the tests, whose calls will be mocked
Expand Down
4 changes: 3 additions & 1 deletion crates/evm/src/call_helpers.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,11 @@ pub impl CallHelpersImpl of CallHelpers {
self.stack.push(0)?;
},
ExecutionResultStatus::Exception => {
// If the call has halted exceptionnaly, the return_data is emptied.
// If the call has halted exceptionnaly,
// the return_data is emptied, and nothing is stored in memory
self.return_data = [].span();
self.stack.push(0)?;
return Result::Ok(());
},
}

Expand Down
Loading
Loading