-
Notifications
You must be signed in to change notification settings - Fork 3
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
tests: Add process instruction checks #19
Conversation
a27dd01
to
4c45f35
Compare
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
@@ -5,7 +5,7 @@ mod setup; | |||
use { | |||
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.
@@ -22,7 +22,7 @@ thiserror = "2.0" | |||
|
|||
[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 |
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
Problem
While PR #18 updates the processor tests to use mollusk, the validation checks are done "outside" mollusk.
Solution
This PR adds
Check
s to process instruction. It leaves the existing validation checks as well to guarantee the same behaviour.