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

Refactor precompiles detection #732

Merged
merged 1 commit into from
Nov 23, 2023
Merged

Refactor precompiles detection #732

merged 1 commit into from
Nov 23, 2023

Conversation

chfast
Copy link
Member

@chfast chfast commented Nov 22, 2023

Extract a precompile address recognition into new is_precompile()
function and use it in all places where this information is needed.

Improve maintenance of "precompile ids" by adding aliases to the enum.

Add unit tests for is_precompile().

Copy link

codecov bot commented Nov 22, 2023

Codecov Report

Merging #732 (33a3504) into master (0bcf0c5) will increase coverage by 0.01%.
The diff coverage is 97.14%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #732      +/-   ##
==========================================
+ Coverage   97.70%   97.72%   +0.01%     
==========================================
  Files         105      106       +1     
  Lines        9671     9693      +22     
==========================================
+ Hits         9449     9472      +23     
+ Misses        222      221       -1     
Flag Coverage Δ
blockchaintests 62.23% <ø> (ø)
statetests 60.67% <100.00%> (+0.02%) ⬆️
statetests-silkpre 27.45% <35.48%> (-0.05%) ⬇️
unittests 95.55% <88.57%> (+0.04%) ⬆️

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

Files Coverage Δ
test/state/host.cpp 93.59% <100.00%> (ø)
test/unittests/state_precompiles_test.cpp 100.00% <100.00%> (ø)
test/state/precompiles.cpp 87.91% <91.66%> (+0.84%) ⬆️

@chfast chfast marked this pull request as ready for review November 23, 2023 10:05
Extract a precompile address recognition into new is_precompile()
function and use it in all places where this information is needed.

Improve maintenance of "precompile ids" by adding aliases to the enum.

Add unit tests for is_precompile().
@chfast chfast merged commit beaa0a2 into master Nov 23, 2023
24 of 25 checks passed
@chfast chfast deleted the precompiles_id branch November 23, 2023 14:20
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.

3 participants