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

Refactor: InstructionAccount indices#22165

Merged
Lichtso merged 1 commit intosolana-labs:masterfrom
Lichtso:refactor/instruction_account_indices
Dec 30, 2021
Merged

Refactor: InstructionAccount indices#22165
Lichtso merged 1 commit intosolana-labs:masterfrom
Lichtso:refactor/instruction_account_indices

Conversation

@Lichtso
Copy link
Copy Markdown
Contributor

@Lichtso Lichtso commented Dec 29, 2021

Problem

The property index of InstructionAccount should be called index_in_transaction.
Also, we currently search for the index_in_caller in the program runtime multiple times and could be reusing them.
Thus it makes sense to introduce an index_in_caller property as well.

Summary of Changes

  • Splits index of InstructionAccount into index_in_transaction and index_in_caller.
  • Adds more helpers and convenience methods to transaction_context.rs

Fixes #

@Lichtso Lichtso force-pushed the refactor/instruction_account_indices branch from 838ce8e to 8fc2bdf Compare December 29, 2021 16:26
@Lichtso Lichtso force-pushed the refactor/instruction_account_indices branch from 8fc2bdf to e62d249 Compare December 29, 2021 16:44
@Lichtso Lichtso force-pushed the refactor/instruction_account_indices branch from e62d249 to 2a306d3 Compare December 29, 2021 20:05
@Lichtso Lichtso force-pushed the refactor/instruction_account_indices branch from 2a306d3 to 590c815 Compare December 30, 2021 09:52
@Lichtso Lichtso force-pushed the refactor/instruction_account_indices branch from 590c815 to aef014d Compare December 30, 2021 10:23
@codecov
Copy link
Copy Markdown

codecov Bot commented Dec 30, 2021

Codecov Report

Merging #22165 (aef014d) into master (29edb13) will decrease coverage by 0.0%.
The diff coverage is 33.5%.

@@            Coverage Diff            @@
##           master   #22165     +/-   ##
=========================================
- Coverage    81.1%    81.0%   -0.1%     
=========================================
  Files         523      523             
  Lines      146370   146459     +89     
=========================================
+ Hits       118747   118762     +15     
- Misses      27623    27697     +74     

@Lichtso Lichtso merged commit edb20d6 into solana-labs:master Dec 30, 2021
@Lichtso Lichtso deleted the refactor/instruction_account_indices branch December 30, 2021 14:46
@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