Skip to content
This repository was archived by the owner on Mar 11, 2025. It is now read-only.

Hardcode the discriminators so that you don't have to compute them at runtime #7360

Merged
merged 3 commits into from
Oct 17, 2024

Conversation

steveluscher
Copy link
Contributor

  1. There is no need to compute these well-known values at runtime
  2. Adding insult to injury, computing them requires a SHA-256 polyfill for browsers

Resolves #7351.

},
"devDependencies": {
"@solana/spl-type-length-value": "0.2.0",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This PR won't pass until this is published.

Copy link
Contributor

@joncinque joncinque left a comment

Choose a reason for hiding this comment

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

The changes look good here! Nice job reusing the existing tests to check that the hard-coded discriminants are correct

@steveluscher steveluscher force-pushed the without-discrimination branch from e4596f7 to e2868ab Compare October 17, 2024 16:29
joncinque
joncinque previously approved these changes Oct 17, 2024
Copy link
Contributor

@joncinque joncinque left a comment

Choose a reason for hiding this comment

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

Thanks for fixing all this!

@mergify mergify bot dismissed joncinque’s stale review October 17, 2024 16:48

Pull request has been modified.

@steveluscher steveluscher merged commit cc3a5d1 into master Oct 17, 2024
29 checks passed
@steveluscher steveluscher deleted the without-discrimination branch October 17, 2024 16:57
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

@solana/spl-token library doesn't work in Vite project
2 participants