move huge similar _evalue logic into separate methods#341
move huge similar _evalue logic into separate methods#341danceratopz merged 5 commits intoethereum:mainfrom
Conversation
danceratopz
left a comment
There was a problem hiding this comment.
Thanks, I appreciate the intention! The TransitionTool class and evaluate functions definitely need some clean-up!
Imo, there's not that much to be gained from moving them to their own file (but I think I see where you're going with this). It would def be great to refactor them into smaller functions, but also happy to keep these in transition_tool.py or move them to a utils.py, or something else, as appropriate.
You previously mentioned in a discussion about sub-classing in order to spread a class implementation over separate files. I don't think it's good form to subclass for the evaluate methods just to achieve this goal and this is not typically done in Python.
However, the TransitionTool class is in need of a larger refactor, as we're starting to add interfaces to other EVM tools (such as blocktest, see its verify_fixtures() method) which has nothing to do with t8n tools. So in order to achieve something similar to what I think you'd like to do, we could make an EVMTool base class and then make TransitionTool and FixtureConsumer subclasses (perhaps we can find a better name than FixtureConsumer, but it could potentially interface to both the blocktest and statetest commands).
Few other comments below.
Happy to jump on a call and discuss how to proceed!
danceratopz
left a comment
There was a problem hiding this comment.
LGTM. Could you fix up tox?
And add the missing typehints? That can sometimes be tricky, feel free to reach out!
bf6aafc to
74a9162
Compare
…ate-pytest-command This adds: ethereum#341, ethereum#342, ethereum#347.
🗒️ Description
The intent is to split huge files with a lot of logic
Devide the logic into separate files and refactor into a smaller functions
Making the overall code more readable
I do by small steps as I never used python, to get feedback from the team