Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: comment ix (un)freeze inputs.owner, fix: capacity (un)freeze #1150

Merged
merged 1 commit into from
Sep 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions programs/compressed-token/src/freeze.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,10 @@ pub fn create_input_and_output_accounts_freeze_or_thaw<
}
let (mut compressed_input_accounts, input_token_data, _) =
get_input_compressed_accounts_with_merkle_context_and_check_signer::<FROZEN_INPUTS>(
// The signer in this case is the freeze authority. The owner is not
// required to sign for this instruction. Hence, we pass the owner
// from a variable instead of an account to still reproduce value
// token data hashes for the input accounts.
&inputs.owner,
&None,
remaining_accounts,
Expand All @@ -97,6 +101,10 @@ pub fn create_input_and_output_accounts_freeze_or_thaw<
inputs.input_token_data_with_context.as_slice(),
remaining_accounts,
mint,
// The signer in this case is the freeze authority. The owner is not
// required to sign for this instruction. Hence, we pass the owner
// from a variable instead of an account to still reproduce value
// token data hashes for the input accounts.
&inputs.owner,
&inputs.outputs_merkle_tree_index,
&mut output_compressed_accounts,
Expand Down Expand Up @@ -128,10 +136,11 @@ fn create_token_output_accounts<const IS_FROZEN: bool>(
// + 8 amount
// + 1 + 32 option + delegate (optional)
// + 1 state
// + 1 tlv
let capacity = if token_data_with_context.delegate_index.is_some() {
106
107
} else {
74
75
};
let mut token_data_bytes = Vec::with_capacity(capacity);
let delegate = token_data_with_context
Expand Down
Loading