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

Blockchain tests support: Clear accounts and their storage warm flag after each tx #679

Merged
merged 1 commit into from
Aug 17, 2023
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
11 changes: 11 additions & 0 deletions test/state/state.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,17 @@ std::variant<TransactionReceipt, std::error_code> transition(State& state, const
// Cannot put it into constructor call because logs are std::moved from host instance.
receipt.logs_bloom_filter = compute_bloom_filter(receipt.logs);

// Set accounts and their storage access status to cold in the end of transition process
for (auto& acc : state.get_accounts())
{
acc.second.access_status = EVMC_ACCESS_COLD;
for (auto& [_, val] : acc.second.storage)
{
val.access_status = EVMC_ACCESS_COLD;
val.original = val.current;
}
}

return receipt;
}

Expand Down