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

cleanup and docs update, string types descriptive #747

Merged
merged 7 commits into from
Sep 11, 2023

Conversation

tabaktoni
Copy link
Collaborator

@tabaktoni tabaktoni commented Sep 8, 2023

Fix #742
Fix #724

Motivation and Resolution

  • Secure cairoVersion from non-ts unintentional number usage
  • Removed unused constants that are now part of ec.
export const FIELD_PRIME = '800000000000011000000000000000000000000000000000000000000000001';
export const FIELD_GEN = '3';
export const FIELD_SIZE = 251;
export const EC_ORDER = '800000000000010FFFFFFFFFFFFFFFFB781126DCAE7B2321E66A241ADC64D2F';
export const ALPHA = '1';
export const BETA = '6F21413EFBE40DE150E596D72F7A8C5609AD26C15C915C1F4CDFCB99CEE9E89';
export const MAX_ECDSA_VAL = '800000000000000000000000000000000000000000000000000000000000000';
export const CONSTANT_POINTS = [...]
  • Document utils methods
  • add string type to documentation
  • cleanup

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

@netlify
Copy link

netlify bot commented Sep 8, 2023

Deploy Preview for starknetjs canceled.

Name Link
🔨 Latest commit d5f7cae
🔍 Latest deploy log https://app.netlify.com/sites/starknetjs/deploys/64ff00b176795100088caf6c

@tabaktoni tabaktoni marked this pull request as ready for review September 8, 2023 15:14
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.

Noticed that some of the JSDOC/TSDOC comment elements clash with the autogenerated content. I'll open a PR targeting this branch with the corresponding tweaks.

src/utils/calldata/cairo.ts Outdated Show resolved Hide resolved
* @returns a string representing an Hex number 248 bits max.
* @Example
* ```typescript
* const myEncodedString: string = encodeShortString("uri/pict/t38.jpg");
* ```
* returns : string : "0x7572692f706963742f7433382e6a7067"
* return hex string (ex."0x7572692f706963742f7433382e6a7067")
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
* return hex string (ex."0x7572692f706963742f7433382e6a7067")
* return hex string (ex. "0x7572692f706963742f7433382e6a7067")

* @Example
* ```typescript
* const myDecodedString: string = decodeShortString("0x7572692f706963742f7433382e6a7067");
* ```
* return : string : "uri/pict/t38.jpg"
* return string (ex."uri/pict/t38.jpg")
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
* return string (ex."uri/pict/t38.jpg")
* return string (ex. "uri/pict/t38.jpg")

@tabaktoni tabaktoni merged commit 6e997c4 into develop Sep 11, 2023
8 checks passed
@github-actions
Copy link

🎉 This PR is included in version 5.19.6 🎉

The release is available on:

Your semantic-release bot 📦🚀

@penovicp penovicp deleted the docs/types-and-docs branch September 16, 2023 13:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants