-
Notifications
You must be signed in to change notification settings - Fork 65
tests: Add process instruction checks #19
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
a27dd01 to
4c45f35
Compare
joncinque
left a comment
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.
Looks great overall! Just one tiny thing and the set_expected_data part which should get resolved here or in #18
| mollusk_svm::{result::Check, Mollusk}, | ||
| solana_sdk::{ | ||
| account::{AccountSharedData, ReadableAccount}, | ||
| account::{Account as SolanaAccount, ReadableAccount}, |
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.
Is this change required by the new version of mollusk?
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.
Yeah, we switched to Account in the API to avoid any footguns for the shared reference over the data buffer. We found some shallow clone bugs.
Luckily the APIs for Account and AccountSharedData are very similar. Do you think it's safe?
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.
It's definitely safe, since it makes it clear that mollusk creates copies of all the resulting accounts rather than modifying them in place. If performance ever becomes an issue, then it might be worth avoiding the account clones.
| [dev-dependencies] | ||
| lazy_static = "1.5.0" | ||
| mollusk-svm = "0.0.13" | ||
| mollusk-svm = { version = "0.0.13", git = "https://github.com/buffalojoec/mollusk.git" } |
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 can publish today, if you want to move this off a Git dependency before merging.
9b284cb to
b8d47b7
Compare
21ec242 to
3194d59
Compare
@joncinque Added the |
joncinque
left a comment
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.
Looks good to me!
3194d59 to
e47a0e1
Compare
* Add process instruction checks * Update mollusk git reference * Add missing check * Add return data checks
Problem
While PR #18 updates the processor tests to use mollusk, the validation checks are done "outside" mollusk.
Solution
This PR adds
Checks to process instruction. It leaves the existing validation checks as well to guarantee the same behaviour.