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

Commit 7b77b83

Browse files
committed
add a clarifying comment on try_calculate_account_len dedupe
1 parent 1c3c19b commit 7b77b83

File tree

1 file changed

+2
-0
lines changed
  • token/program-2022/src/extension/confidential_transfer

1 file changed

+2
-0
lines changed

token/program-2022/src/extension/confidential_transfer/processor.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,8 @@ fn reallocate_for_configure_account_with_registry<'a>(
152152
let account = PodStateWithExtensions::<PodAccount>::unpack(&token_account)?;
153153
account.get_extension_types()?
154154
};
155+
// `try_calculate_account_len` dedupes extension types, so always push
156+
// the `ConfidentialTransferAccount` type
155157
current_extension_types.push(ExtensionType::ConfidentialTransferAccount);
156158
let needed_account_len =
157159
ExtensionType::try_calculate_account_len::<Account>(&current_extension_types)?;

0 commit comments

Comments
 (0)