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

Common: added static method for checking if chainId is supported #1281

Conversation

emersonmacro
Copy link
Contributor

Addresses #1243. Feedback welcome!

@codecov
Copy link

codecov bot commented Jun 3, 2021

Codecov Report

Merging #1281 (c765b81) into master (0a1f232) will increase coverage by 0.08%.
The diff coverage is 100.00%.

Impacted file tree graph

Flag Coverage Δ
block 86.20% <ø> (ø)
blockchain 84.42% <ø> (ø)
client 84.48% <ø> (ø)
common 88.21% <100.00%> (-0.41%) ⬇️
devp2p 84.28% <ø> (+0.45%) ⬆️
ethash 82.83% <ø> (ø)
tx 88.47% <ø> (+0.12%) ⬆️
vm 87.06% <ø> (ø)

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

)
st.end()
})
})
Copy link
Member

Choose a reason for hiding this comment

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

Thanks for the PR! 😄

Two things here:

  1. We currently do not organize the tests in the libraries on that granularity level of having one file per method and so this test file would jump somewhat out of the line, can you please add to one of the existing files? I guess chains.spec.ts should be a good candidate. Not that we can't reorg at some PIT if we see the need, but these kind of things should generally be discussed before.
  2. Can you also add a positive test case here for a chain ID existing?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@holgerd77 Thanks for the review!

Re: 1, 👍. I wasn't sure what existing file it should go in so I made a new one, but your point makes sense. I'll move the test into chains.spec.ts.

Re: 2, I think I have that already here (https://github.com/ethereumjs/ethereumjs-monorepo/pull/1281/files#diff-00e881872be66da72fe4e5df60785751bb9b0fce068df279a7fd63b9dcdd0423R7), unless I'm not understanding? Actually now that I look at it, it is a little awkward having the top-level test be should return the correct response. I can break them out into separate tests.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Also, I had a question unrelated to my code changes, just something I noticed. There's a file in packages/common/tests named customChains.ts. Should the file name be customChains.spec.ts?

Copy link
Member

Choose a reason for hiding this comment

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

@emersonmacro oh yes, good catch. 😄 We have a collecting issue open here where we collect some of the smaller fixes to then be worked on in batch (or along some other PRs) #905, have added there so that it won't get lost.

Copy link
Member

@holgerd77 holgerd77 left a comment

Choose a reason for hiding this comment

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

LGTM, thanks! 😀

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.

3 participants