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

token 2022: add alloc_and_serialize for fixed-len extensions #5672

Merged
Show file tree
Hide file tree
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
6 changes: 4 additions & 2 deletions token/client/src/token.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3458,7 +3458,8 @@ where
let account = self.get_account(self.pubkey).await?;
let account_lamports = account.lamports;
let mint_state = self.unpack_mint_info(account)?;
let new_account_len = mint_state.try_get_new_account_len(token_metadata)?;
let new_account_len = mint_state
.try_get_new_account_len_for_variable_len_extension::<TokenMetadata>(token_metadata)?;
let new_rent_exempt_minimum = self
.client
.get_minimum_balance_for_rent_exemption(new_account_len)
Expand Down Expand Up @@ -3540,7 +3541,8 @@ where
let mint_state = self.unpack_mint_info(account)?;
let mut token_metadata = mint_state.get_variable_len_extension::<TokenMetadata>()?;
token_metadata.update(field, value);
let new_account_len = mint_state.try_get_new_account_len(&token_metadata)?;
let new_account_len = mint_state
.try_get_new_account_len_for_variable_len_extension::<TokenMetadata>(&token_metadata)?;
let new_rent_exempt_minimum = self
.client
.get_minimum_balance_for_rent_exemption(new_account_len)
Expand Down
Loading
Loading