-
Notifications
You must be signed in to change notification settings - Fork 437
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 decoders to class hierarchy #7354
Refactor decoders to class hierarchy #7354
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Personally I'm not a fan of using inheritance for code sharing but I can't argue with the fact that we can remove ~600 LOC with this change.
Some rigidity of a class based approach might make future refactors a bit trickier (ex. TxType
will be removed`) but we can deal with it once it becomes a problem.
Overall LGTM and I would not have any issues merging it with the existing refactor PR but I would like to hear some additional opinions on this kind of design.
using Nethermind.Serialization.Rlp.Eip2930; | ||
|
||
namespace Nethermind.Serialization.Rlp.MyTxDecoder; | ||
namespace Nethermind.Serialization.Rlp.TxDecoders; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should also move the files to a TxDecoders
folder (I forgot about that and left MyTxDecoder
during development)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes I actually did it, but reverted it as it made reviewing on github experience awful as it lost track they are edits. Will do it just before the merge.
src/Nethermind/Nethermind.Serialization.Rlp/MyTxDecoder/BlobTxDecoder.cs
Outdated
Show resolved
Hide resolved
|
If there are no more comments on the approach then I'll merge this with the existing PR so we can wrap up the work on the decoders. |
Changes
TxDecoder
#7334Types of changes
What types of changes does your code introduce?