This repository has been archived by the owner on Jan 22, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Cleanup - mock_process_instruction() #31088
Merged
Lichtso
merged 2 commits into
solana-labs:master
from
Lichtso:cleanup/mock_process_instruction
Apr 7, 2023
Merged
Cleanup - mock_process_instruction() #31088
Lichtso
merged 2 commits into
solana-labs:master
from
Lichtso:cleanup/mock_process_instruction
Apr 7, 2023
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
a4dc596
to
fa1c290
Compare
pgarg66
reviewed
Apr 6, 2023
@@ -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.
pgarg66
previously approved these changes
Apr 6, 2023
fa1c290
to
c080c9c
Compare
pgarg66
previously approved these changes
Apr 7, 2023
Removes "solana_sbf_rust_external_spend" from assert_instruction_count() as it panics.
c080c9c
to
4048f59
Compare
pgarg66
approved these changes
Apr 7, 2023
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 |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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()
.