-
Notifications
You must be signed in to change notification settings - Fork 1k
program-test: remove solana-sdk dependency #6299
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 |
|---|---|---|
|
|
@@ -5,10 +5,10 @@ use { | |
| solana_commitment_config::CommitmentLevel, | ||
| solana_instruction::{AccountMeta, Instruction}, | ||
| solana_msg::msg, | ||
| solana_program::program::{get_return_data, invoke, set_return_data}, | ||
|
Author
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. Per this guide from Kevin, the recomended replacement for solana_program::program is solana_cpi crate. However when I import the latter here, both tests fail. So I seem to be hitting a bug in that crate that I don't have the BW to debug at the moment. So I oped for using the "legacy" import for now to unblock my immediate problem. But I wanted to flag that here. 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. problem here is that the new implementations drop the sysvar_stubs module and just blindly return
Author
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. I looked into this a bit more. It's actually working as expected and I had an incorrect understanding of the two crates being functionally equivalent. The solana_cpi vs solana_{sdk; program}::program differences for these methods look intentional based on the implementation and comments. The tests expect the overwrite as well. Considering this resolved. 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. i mean |
||
| solana_program_error::{ProgramError, ProgramResult}, | ||
| solana_program_test::{processor, ProgramTest}, | ||
| solana_pubkey::Pubkey, | ||
| solana_sdk::program::{get_return_data, invoke, set_return_data}, | ||
| solana_signer::Signer, | ||
| solana_transaction::Transaction, | ||
| solana_transaction_context::TransactionReturnData, | ||
|
|
||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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.
I would expect this PR to remove
solana-sdkfrom the list (2 lines up from here) as wellThere 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.
Normally yes, but that's the last reference in the repo. If I do that, I'd have to pull in the changes from other PRs mentioned in my last comment, which are all the other cargo changes that are also deleted. I wanted to fix each in a separate PR to keep it clean and easier to review.