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

[TieredStorage] AccountMetaOptionalFields::size_from_flags() #32242

Merged
merged 1 commit into from
Jun 22, 2023

Conversation

yhchiang-sol
Copy link
Contributor

@yhchiang-sol yhchiang-sol commented Jun 22, 2023

Summary of Changes

This PR adds AccountMetaOptionalFields::size_from_flags that takes
&AccountMetaFlags and returns the size of the AccountMetaOptionalFields
based on the input AccountMetaFlags.

This function is needed because the reader of the TieredAccountMeta
directly extract all the Some fields of AccountMetaOptionalFields
from its account block without constructing the AccountMetaOptionalFields
instance.

Test plan

Improve existing unit tests that further verify the correctness of the function.

@codecov
Copy link

codecov bot commented Jun 22, 2023

Codecov Report

Merging #32242 (6298f4e) into master (20a7cdd) will increase coverage by 0.0%.
The diff coverage is 100.0%.

@@           Coverage Diff           @@
##           master   #32242   +/-   ##
=======================================
  Coverage    82.0%    82.0%           
=======================================
  Files         769      769           
  Lines      208992   209004   +12     
=======================================
+ Hits       171395   171432   +37     
+ Misses      37597    37572   -25     

@yhchiang-sol yhchiang-sol requested a review from brooksprumo June 22, 2023 16:09
@yhchiang-sol yhchiang-sol merged commit d95e976 into solana-labs:master Jun 22, 2023
wen-coding pushed a commit to wen-coding/solana that referenced this pull request Aug 15, 2023
…labs#32242)

#### Summary of Changes
This PR adds AccountMetaOptionalFields::size_from_flags that takes
`&AccountMegaFlags` and returns the size of the AccountMetaOptionalFields
based on the input AccountMegaFlags.

This function is needed because the reader of the TieredAccountMeta
directly extract all the Some fields of AccountMetaOptionalFields
from its account block without constructing the AccountMetaOptionalFields
instance.

#### Test plan
Improve existing unit tests that further verify the correctness of the function.
wen-coding pushed a commit to wen-coding/solana that referenced this pull request Aug 15, 2023
…labs#32242)

#### Summary of Changes
This PR adds AccountMetaOptionalFields::size_from_flags that takes
`&AccountMegaFlags` and returns the size of the AccountMetaOptionalFields
based on the input AccountMegaFlags.

This function is needed because the reader of the TieredAccountMeta
directly extract all the Some fields of AccountMetaOptionalFields
from its account block without constructing the AccountMetaOptionalFields
instance.

#### Test plan
Improve existing unit tests that further verify the correctness of the function.
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.

2 participants