Skip to content

test: Add a logs expectation to the state_transition fixture#1574

Merged
chfast merged 1 commit into
masterfrom
test/log-expectation
Jun 29, 2026
Merged

test: Add a logs expectation to the state_transition fixture#1574
chfast merged 1 commit into
masterfrom
test/log-expectation

Conversation

@chfast

@chfast chfast commented Jun 29, 2026

Copy link
Copy Markdown
Member

The state_transition fixture could assert state, gas, and trace, but not emitted logs. Add an optional Expectation::logs, compared field-by-field (count, address, data, topics, and order) in the runner, with a LOG1 smoke test pinning the mechanism.

@codecov

codecov Bot commented Jun 29, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.38%. Comparing base (1164d38) to head (f8e5a2b).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1574   +/-   ##
=======================================
  Coverage   97.38%   97.38%           
=======================================
  Files         163      163           
  Lines       14622    14634   +12     
  Branches     3395     3401    +6     
=======================================
+ Hits        14240    14252   +12     
  Misses        280      280           
  Partials      102      102           
Flag Coverage Δ
eest-develop 89.62% <ø> (ø)
eest-develop-gmp 26.14% <0.00%> (-0.03%) ⬇️
eest-legacy 17.55% <0.00%> (-0.02%) ⬇️
eest-libsecp256k1 27.77% <0.00%> (-0.03%) ⬇️
eest-stable 89.71% <ø> (ø)
evmone-unittests 92.60% <100.00%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
core 95.95% <ø> (ø)
tooling 90.21% <ø> (ø)
tests 99.80% <100.00%> (+<0.01%) ⬆️
Files with missing lines Coverage Δ
test/unittests/state_transition.cpp 98.75% <100.00%> (+0.11%) ⬆️
test/unittests/state_transition_tx_test.cpp 100.00% <100.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

The state_transition fixture could assert state, gas, and trace, but not emitted logs. Add an
optional Expectation::logs, compared field-by-field (count, address, data, topics, and order) in
the runner, with a LOG1 smoke test pinning the mechanism.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR extends the state_transition unit-test fixture to optionally assert emitted transaction logs, enabling state-transition tests to validate receipt log count and per-log fields (address, data, topics) in order.

Changes:

  • Add Expectation::logs (std::optional<std::vector<Log>>) to the state_transition fixture API.
  • Implement receipt log comparison in the runner (TearDown()) when expect.logs is set.
  • Add a LOG1-based smoke test to pin the new log-expectation mechanism.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
test/unittests/state_transition.hpp Extends the fixture expectations with an optional logs field.
test/unittests/state_transition.cpp Adds receipt log assertions when expect.logs is provided.
test/unittests/state_transition_tx_test.cpp Introduces a smoke test that emits a log and asserts it via expect.logs.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread test/unittests/state_transition_tx_test.cpp
@chfast chfast merged commit 968698f into master Jun 29, 2026
24 checks passed
@chfast chfast deleted the test/log-expectation branch June 29, 2026 10:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants