Skip to content
This repository was archived by the owner on Jan 22, 2025. It is now read-only.

Cleanup: invoke_context.rs#22107

Merged
Lichtso merged 3 commits intosolana-labs:masterfrom
Lichtso:cleanup/invoke_context
Dec 25, 2021
Merged

Cleanup: invoke_context.rs#22107
Lichtso merged 3 commits intosolana-labs:masterfrom
Lichtso:cleanup/invoke_context

Conversation

@Lichtso
Copy link
Copy Markdown
Contributor

@Lichtso Lichtso commented Dec 24, 2021

Problem

Follow up of #22102, which left some inefficiencies to be optimized.

Summary of Changes

  • Replaces Message::new(&[instruction.clone()], None) by a custom instruction_account compilation logic.
  • Removes message::Message from invoke_context.rs completely (including the tests).
  • Simplifies sol_invoke_signed() of program-test.
  • Removes InvokeContext::find_index_of_account().
  • Start search for non program accounts at front (instead of the back).

Fixes #

@Lichtso Lichtso force-pushed the cleanup/invoke_context branch from 4dc29fe to c775666 Compare December 24, 2021 21:58
Program and programdata accounts use rposition(), everything else uses position().
@Lichtso Lichtso force-pushed the cleanup/invoke_context branch from c775666 to 5f3bd0c Compare December 24, 2021 22:05
@codecov
Copy link
Copy Markdown

codecov Bot commented Dec 25, 2021

Codecov Report

Merging #22107 (5f3bd0c) into master (2ab4f34) will decrease coverage by 0.0%.
The diff coverage is 50.0%.

@@            Coverage Diff            @@
##           master   #22107     +/-   ##
=========================================
- Coverage    81.3%    81.2%   -0.1%     
=========================================
  Files         519      519             
  Lines      145736   145732      -4     
=========================================
- Hits       118500   118469     -31     
- Misses      27236    27263     +27     

@Lichtso Lichtso merged commit 60ddd93 into solana-labs:master Dec 25, 2021
@Lichtso Lichtso deleted the cleanup/invoke_context branch December 25, 2021 09:00
@Lichtso Lichtso mentioned this pull request Jan 9, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant