-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Cleanup - mock_process_instruction() #31088
Cleanup - mock_process_instruction() #31088
Conversation
a4dc596
to
fa1c290
Compare
@@ -1407,7 +1405,7 @@ fn assert_instruction_count() { | |||
(program_key, AccountSharedData::new(0, 0, &loader_id)), | |||
( | |||
Pubkey::new_unique(), | |||
AccountSharedData::new(0, 8, &program_key), | |||
AccountSharedData::new(0, 0, &program_key), |
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.
Was 8 an incorrect value, or is it a cleanup?
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.
A post_adjustments
closure was added to mock_process_instruction()
.
Thus, the value of the expected CU consumption can now be transported by the scope,
and does not need an instruction account anymore.
fa1c290
to
c080c9c
Compare
Removes "solana_sbf_rust_external_spend" from assert_instruction_count() as it panics.
c080c9c
to
4048f59
Compare
Codecov Report
@@ Coverage Diff @@
## master #31088 +/- ##
========================================
Coverage 81.5% 81.5%
========================================
Files 728 728
Lines 206251 205752 -499
========================================
- Hits 168112 167800 -312
+ Misses 38139 37952 -187 |
Problem
We need the tests to be consistent about how they use
mock_process_instruction()
if we want to unify the built-in and syscall interfaces.Summary of Changes
declare_process_instruction!()
in all tests.post_adjustments
tomock_process_instruction()
.