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

Ensure functions that should return Hex, do #193

Merged
merged 1 commit into from
Jun 27, 2024

Conversation

mcmire
Copy link
Contributor

@mcmire mcmire commented Jun 21, 2024

Some functions that return hex strings satisfying the Hex type return a string type instead. This makes it slightly inconvenient to use these functions in conjunction with others, and it is common in practice to use a type assertion as a workaround. This commit rectifies this issue by assigning these functions proper return types:

  • getChecksumAddress
  • numberToHex
  • bigIntToHex

As such this change is breaking.

Fixes #159.

Some functions that return hex strings satisfying the `Hex` type return
a `string` type instead. This makes it slightly inconvenient to use
these functions in conjunction with others, and it is common in practice
to use a type assertion as a workaround. This commit rectifies this
issue by assigning these functions proper return types:

- `getChecksumAddress`
- `numberToHex`
- `bigIntToHex`

As such this change is **breaking**.
@mcmire mcmire requested a review from a team as a code owner June 21, 2024 19:43
@mcmire mcmire requested a review from a team June 21, 2024 19:46
Copy link
Contributor

@MajorLift MajorLift left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link

@kanthesha kanthesha left a comment

Choose a reason for hiding this comment

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

LGTM.

@mcmire mcmire merged commit 369e5b2 into main Jun 27, 2024
19 checks passed
@mcmire mcmire deleted the fix-types-of-hex-returning-functions branch June 27, 2024 15:14
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.

Some functions do not return a Hex when they should
3 participants