-
Notifications
You must be signed in to change notification settings - Fork 124
expose create-native-mints in node-litesvm #252
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
Conversation
b337aaf to
6d16ea3
Compare
|
ok @kevinheavey i updated the PR with a different approach that results in fewer changes overall. specifically, i no longer touch or pull in i ran into some issues (example) with the |
a664c9e to
a795b0a
Compare
a795b0a to
b2b5339
Compare
|
I'll fix the CI issues in this PR. However, I'm not entirely convinced that exposing create-native-mints directly in the Node.js API is the best long-term design choice |
|
My main motivation for the change was that I found it annoying to have to re-add the create native mint logic when I used the JS library in different test suites. Feel free to close this PR if you don't agree with the implementation though. You definitely have more context. |
Description
Expose the ability to create native mints for both SPL token programs to node-litesvm
Motivation
Consumers of node-litesvm have to create native mints on their own. It would be convenient to expose a function to allow for this within the core library.
If accepted, this change makes it as easy as 🔽 (as long as the expected token programs are loaded)
Note: I left the token-2022 feature flag alone since that will dictate what SPL token program is used in the rust token crate
Alternatives considered
Leave the
tokencrate alone, and copy the existing create_native_mint function into node-litesvm. In many ways, I think this is a simpler approach because it (1) leavestokencrate untouched, (2) avoids stakingtokencrate as a dependency, (3) easily exposes create native mint functions for both token programs. I think the main downside is that we'd copy some code from thetokencrate.Testing
I added a new test
token.test.tsto verify the native mint accounts are created as expected