-
Couldn't load subscription status.
- Fork 141
wasm-js!: Remove system program dependency #240
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -18,13 +18,16 @@ rustdoc-args = ["--cfg=docsrs"] | |
| crate-type = ["cdylib"] | ||
|
|
||
| [dependencies] | ||
| solana-hash = { workspace = true } | ||
| solana-instruction = { workspace = true, features = ["std"] } | ||
| solana-program = { workspace = true } | ||
| solana-sdk = { workspace = true } | ||
| solana-keypair = { workspace = true } | ||
| solana-pubkey = { workspace = true, features = ["curve25519", "sha2"] } | ||
| solana-transaction = { workspace = true, features = ["bincode", "verify"] } | ||
|
|
||
| [target.'cfg(target_arch = "wasm32")'.dependencies] | ||
| console_error_panic_hook = { workspace = true } | ||
| console_log = { workspace = true } | ||
| getrandom = { version = "0.1.1", features = ["wasm-bindgen"] } | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Looks like There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, we need it for randomness to work in wasm with the current versions that we use. At least, we needed it a year or so ago, so maybe all of the newer versions work now. I can take a look at it in follow-up work! |
||
| log = { workspace = true } | ||
| wasm-bindgen = { workspace = true } | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,23 +1,12 @@ | ||
| //! solana-program Javascript interface | ||
| #![cfg(target_arch = "wasm32")] | ||
|
|
||
| #[deprecated(since = "2.2.0", note = "Use solana_instruction::wasm instead.")] | ||
| pub use solana_instruction::wasm as instructions; | ||
| use {::log::Level, wasm_bindgen::prelude::*}; | ||
| pub use { | ||
| solana_program::*, | ||
| solana_sdk::{ | ||
| // These imports exist in both solana_sdk and solana_program, so we use | ||
| // direct imports to suppress ambiguous re-export warnings. | ||
| declare_deprecated_id, | ||
| declare_id, | ||
| entrypoint, | ||
| entrypoint_deprecated, | ||
| example_mocks, | ||
| hash, | ||
| program_stubs, | ||
| pubkey, | ||
| *, | ||
| }, | ||
|
Comment on lines
-7
to
-20
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Guessing this is a breaking change that requires a major version bump? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yep! |
||
| solana_hash::*, solana_instruction::*, solana_keypair::*, solana_pubkey::*, | ||
| solana_transaction::*, | ||
| }; | ||
|
|
||
| // This module is intentionally left empty. The wasm system instruction impl can be | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can also use the attribute if you wanted:
Not sure why one is better than the other though tbh
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typically I've found that
js_nameis more useful for renaming functions totally. Last time I checked this, maybe a year ago, there was no default way to just have functions renamed into camel-case, so I'd prefer to go with this.