Skip to content

Conversation

holgerd77
Copy link
Member

This PR transitions all monorepo JSON configuration files to JS for better typing and not to have to deal with adding type assertions to the ESM build or not, since this is has a usage conflict between Node.js (JSON type assertion required from Node 16 upwards) and browser (not fully supported, e.g. Firefox not supported at all).

@codecov
Copy link

codecov bot commented Jul 21, 2023

Codecov Report

Merging #2911 (d0c2c66) into master (a616ca0) will increase coverage by 0.58%.
The diff coverage is 99.68%.

Additional details and impacted files

Impacted file tree graph

Flag Coverage Δ
block 88.66% <ø> (ø)
blockchain 92.58% <ø> (ø)
client 88.43% <ø> (-0.03%) ⬇️
common 98.64% <99.94%> (+1.51%) ⬆️
ethash ∅ <ø> (∅)
evm 69.95% <ø> (ø)
rlp ∅ <ø> (∅)
statemanager 85.16% <ø> (ø)
trie 90.29% <ø> (+0.03%) ⬆️
tx 95.96% <ø> (ø)
util 86.77% <ø> (ø)
vm 79.21% <96.06%> (+1.06%) ⬆️

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

throw new Error(`${eip} not supported`)
}
const minHF = this.gteHardfork(EIPs[eip]['minimumHardfork'])
const minHF = this.gteHardfork((EIPs as any)[eip]['minimumHardfork'])
Copy link
Member Author

Choose a reason for hiding this comment

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

Here and at some more places are some any typings left. This has the reasoning that we would otherwise have to hard-specify the EIP numbers again at the typing level, and this would eventually limit the expandability of the library.

At the same time I think typing has already significantly improved since the format now is already checked for the configuration objects themselves.

No strong opinion on this though.

@acolytec3
Copy link
Contributor

Sounds good. Will take another look later and can pick things up if able and try and push this over the line.

@holgerd77
Copy link
Member Author

Updated this via UI

Copy link
Contributor

@acolytec3 acolytec3 left a comment

Choose a reason for hiding this comment

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

Going to go ahead and call this good. LGTM!

@acolytec3 acolytec3 merged commit 532eff8 into master Jul 23, 2023
@holgerd77 holgerd77 deleted the json-to-js-transition branch July 31, 2023 10:50
@holgerd77
Copy link
Member Author

Thanks for merging

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

Successfully merging this pull request may close these issues.

2 participants