Skip to content

Conversation

@pdobacz
Copy link
Member

@pdobacz pdobacz commented Apr 10, 2024

I'm branching off of eof-create4, as this is where a bunch of exportable invalid tx tests were added.

I also tackled a "// TODO: Compare states carefully, they should be identical." for invalid txs - the same state comparison logic is executed now. This required a tiny amount of shuffling in how the default expectations on accounts like sender and coinbase work, but I think this is acceptable

@codecov
Copy link

codecov bot commented Apr 10, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.37%. Comparing base (ad99657) to head (65bbf0a).

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #858      +/-   ##
==========================================
+ Coverage   98.32%   98.37%   +0.05%     
==========================================
  Files         129      129              
  Lines       15525    15536      +11     
==========================================
+ Hits        15265    15284      +19     
+ Misses        260      252       -8     
Flag Coverage Δ
statetests 27.77% <20.00%> (-0.01%) ⬇️
statetests-silkpre 18.81% <20.00%> (+<0.01%) ⬆️
unittests 94.17% <100.00%> (+0.05%) ⬆️

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

Files Coverage Δ
test/statetest/statetest_runner.cpp 96.87% <100.00%> (+0.32%) ⬆️
test/unittests/state_transition.cpp 98.38% <100.00%> (+0.03%) ⬆️
test/unittests/state_transition.hpp 0.00% <ø> (ø)
...est/unittests/state_transition_eof_create_test.cpp 100.00% <100.00%> (ø)
test/unittests/state_transition_tx_test.cpp 100.00% <100.00%> (ø)

... and 1 file with indirect coverage changes

@pdobacz pdobacz force-pushed the invalid-tx-test-export branch 2 times, most recently from e49819f to 5afb89e Compare April 10, 2024 11:39
@pdobacz pdobacz requested review from chfast, gumb0 and rodiazet April 10, 2024 16:41
@gumb0 gumb0 force-pushed the eof-create4 branch 4 times, most recently from cb87439 to 9b4d832 Compare April 17, 2024 13:46
@chfast chfast added the tests Testing infrastructure label Apr 17, 2024
@pdobacz pdobacz force-pushed the invalid-tx-test-export branch from 5afb89e to 5e1b365 Compare April 18, 2024 09:58
@gumb0 gumb0 force-pushed the eof-create4 branch 2 times, most recently from febfe66 to 1b2835f Compare April 18, 2024 13:15
Base automatically changed from eof-create4 to master April 18, 2024 13:35
@pdobacz pdobacz force-pushed the invalid-tx-test-export branch from 5e1b365 to b6b7a0a Compare April 18, 2024 14:03
@pdobacz
Copy link
Member Author

pdobacz commented Apr 18, 2024

Ready to review after rebase

@pdobacz pdobacz force-pushed the invalid-tx-test-export branch from b6b7a0a to 65bbf0a Compare April 19, 2024 14:13
@pdobacz pdobacz merged commit 9b3ee17 into master Apr 19, 2024
@pdobacz pdobacz deleted the invalid-tx-test-export branch April 19, 2024 15:23

if (holds_alternative<std::error_code>(res))
{
jpost["expectException"] = std::get<std::error_code>(res).message();
Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member Author

Choose a reason for hiding this comment

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

@gumb0 Thanks for flagging this! So to be sure, what I need to do is:

  • PR retesteth to add the additional entries
  • in this spot, call a new function like get_tests_error_message(std::error_code), instead of just .message() which has clauses like:
            case INIT_CODE_EMPTY:
                return "TR_InitcodeEmpty";   // <<<<<- one of the new `TR_` entries

to translate the code into retesteth-compatible value?

Copy link
Member

Choose a reason for hiding this comment

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

yes, sounds good

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tests Testing infrastructure

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants