Skip to content
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

Refactor - mock_process_instruction() #30893

Merged
merged 4 commits into from
Mar 24, 2023

Conversation

Lichtso
Copy link
Contributor

@Lichtso Lichtso commented Mar 24, 2023

Problem

#30702 introduced InstructionError::BuiltinProgramsMustConsumeComputeUnits but that can not be triggered in the tests because they never pass through InvokeContext::process_executable_chain().

Summary of Changes

  • Uses InvokeContext::process_instruction() in mock_process_instruction().
  • Uses InvokeContext::process_instruction() in tests of loader-v3.
  • Only throw InstructionError::BuiltinProgramsMustConsumeComputeUnits if result.is_ok().

@Lichtso Lichtso requested a review from tao-stones March 24, 2023 19:07
tao-stones
tao-stones previously approved these changes Mar 24, 2023
Copy link
Contributor

@tao-stones tao-stones left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm. Good call for adding result.is_ok(), thanks for updating tests

Copy link
Contributor

@tao-stones tao-stones left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@codecov
Copy link

codecov bot commented Mar 24, 2023

Codecov Report

Merging #30893 (63f410c) into master (f226a34) will increase coverage by 0.0%.
The diff coverage is 100.0%.

@@           Coverage Diff           @@
##           master   #30893   +/-   ##
=======================================
  Coverage    81.5%    81.5%           
=======================================
  Files         726      726           
  Lines      204914   204907    -7     
=======================================
+ Hits       167069   167092   +23     
+ Misses      37845    37815   -30     

@Lichtso Lichtso merged commit fb7d303 into solana-labs:master Mar 24, 2023
@Lichtso Lichtso deleted the refactor/mock_process_instruction branch March 24, 2023 21:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants