-
Notifications
You must be signed in to change notification settings - Fork 759
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
Block: treeshaking tasks #3586
Block: treeshaking tasks #3586
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.
I generally really like this approach. One nit about normalizeTxParams
that we should address (though can be in a different PR if you want).
export function createBlockHeader(headerData: HeaderData = {}, opts: BlockOptions = {}) { | ||
return new BlockHeader(headerData, opts) | ||
} | ||
export function normalizeTxParams(_txParams: any) { |
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.
Two things on this function:
- It isn't a constructor so ideally we put it in a helpers/utils file.
- We have essentially the same function here. Can we harmonize these two and consolidate in one location (maybe in
@ethereumjs/util/helpers.ts
orinternal.ts
) The only real difference I see is converting0x0
to0x
in the transaction signatuere values.
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.
Have put in a dedicated small issue #3587 so we can address in a separate PR
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.
LGTM
Block Treeshaking task cleanup from #3560
from-rpc.ts
,header-from-rpc.ts
files, move code within function blocks ofconstructors.ts
block
andheader
directories, moveblock.ts
andheader.ts
over, createindex.ts
file, splitconstructors.ts
into the block and header methods and move over respectively (if this full TODO item is controversial we can also give a quick discussion, I would find it a useful better organizing structure)createBlockFromValuesArray
->createBlockFromBytesArray
createBlockHeaderFromValuesArray
->createBlockHeaderFromBytesArray