-
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
util: update prefixedHexString to use literal string template #3348
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files
Flags with carried forward coverage won't be shown. Click here to find out more. |
Oh, that’s actually a hyper-great one, love this! 🤩🙏❤️ |
(feel that I should really start looking into TypeScript (updates) a bit more, maybe/likely there is other new base functionality we can leverage in a useful and very targeted way. Also, we can actually generally look into updating our Typescript version (what is a bit tricky and what I haven't given much thought yet: what is actually with TypeScript backwards compatibility, so if we update to a new version and use some of the very latest features. Then we likely also break other people's TypeScript code. 🤔 So guess this also needs at least some basic thinking and following guidelines we set for ourselves (maybe in a first round: just not get too hyper-progressive with this stuff and not fully jump on the latest stuff from 2 weeks ago (atm we are not in danger with our |
…hereumjs/ethereumjs-monorepo into util/prefixed-hex-string-type
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
TypeScript 4.1 introduced template literal types: https://www.typescriptlang.org/docs/handbook/release-notes/typescript-4-1.html
We can use those to restrict the type of some strings further with no runtime performance downside. This PR updates PrefixedHexString from
string
to0x{string}