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

✨ Add shared validateHex function #70

Closed
wants to merge 4 commits into from
Closed

Conversation

arimgibson
Copy link
Contributor

Useful in keeping code DRY when solving #68 and #29

Potentially breaks https://github.com/Earnifi/essential-eth/blob/master/src/shared/tiny-big/tiny-big.ts, marking as draft while I investigate

@vercel
Copy link

vercel bot commented Apr 14, 2022

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/earnifi/essential-eth/54Uwd9qHf76FeKz7NsbR9GLvSjMR
✅ Preview: https://essential-eth-git-feature-validatehex-earnifi.vercel.app

@arimgibson arimgibson marked this pull request as ready for review April 14, 2022 20:28
@arimgibson
Copy link
Contributor Author

Issue with tinyBig function exists on master as well, will open an issue to solve that

@arimgibson arimgibson requested a review from dawsbot April 14, 2022 20:29
@@ -0,0 +1,13 @@
import { validateType } from './validate-type';

export function validateHex(data: string | number): string {
Copy link
Owner

Choose a reason for hiding this comment

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

Seems like a good idea, but this function is not used anywhere?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not quite yet, eventually I want to use it in hexZeroPad and hexDataSlice. I've had to write the same code in both functions to parse both strings and numbers, and then return a standard hex string prefixed with 0x

I thought it'd stay as a draft PR, think it got changed to just a regular one when I requested the review. Sorry!

@dawsbot
Copy link
Owner

dawsbot commented Apr 17, 2022

Replaced by #76

@dawsbot dawsbot closed this Apr 17, 2022
@dawsbot dawsbot deleted the feature/validateHex branch April 17, 2022 19:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants