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

feat: num.toHex64 ensure 0x(64 char) format #1222

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from
Open

Conversation

tabaktoni
Copy link
Collaborator

Motivation and Resolution

preparation for type gurading

Feat:

  • Added missing tests
  • num.toHex64 ensure 0x(64 char) format

Usage related changes

Development related changes

  • Change 1.
  • ...

Checklist:

  • Performed a self-review of the code
  • Rebased to the last commit of the target branch (or merged it into my branch)
  • Linked the issues which this PR resolves
  • Documented the changes in code (API docs will be generated automatically)
  • Updated the tests
  • All tests are passing

Copy link
Collaborator

@penovicp penovicp left a comment

Choose a reason for hiding this comment

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

A couple comment typos, otherwise lgtm

src/utils/num.ts Outdated Show resolved Hide resolved
src/utils/num.ts Outdated Show resolved Hide resolved
tabaktoni and others added 2 commits September 16, 2024 11:02
Co-authored-by: Petar Penović <pp@spaceshard.io>
Co-authored-by: Petar Penović <pp@spaceshard.io>
* Similar as toStorageKey but conforming to exactly 0x(64 hex chars).
*
* @returns format: hex-0x(64)-string
*/
Copy link
Collaborator

Choose a reason for hiding this comment

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

we are missing an @example here 🫶

@@ -75,9 +76,23 @@ export const toHexString = toHex;
* @returns format: storage-key-string
*/
export function toStorageKey(number: BigNumberish): string {
// TODO: This is not completely correct as it will not enforce first 0 and second [0-7], 0x82bda... will pass as valid and should be false
Copy link
Collaborator

Choose a reason for hiding this comment

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

also while we're at it, we could add a missing an @example here 🫶

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.

3 participants