Skip to content

Commit

Permalink
add a clarifying comment on try_calculate_account_len dedupe
Browse files Browse the repository at this point in the history
  • Loading branch information
samkim-crypto committed Oct 24, 2024
1 parent 1c3c19b commit 7b77b83
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,8 @@ fn reallocate_for_configure_account_with_registry<'a>(
let account = PodStateWithExtensions::<PodAccount>::unpack(&token_account)?;
account.get_extension_types()?
};
// `try_calculate_account_len` dedupes extension types, so always push
// the `ConfidentialTransferAccount` type
current_extension_types.push(ExtensionType::ConfidentialTransferAccount);
let needed_account_len =
ExtensionType::try_calculate_account_len::<Account>(&current_extension_types)?;
Expand Down

0 comments on commit 7b77b83

Please sign in to comment.