Skip to content

Commit 1e129e3

Browse files
committed
program: add log for get_vault_len
1 parent b098a69 commit 1e129e3

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

programs/drift/src/instructions/constraints.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,10 @@ pub fn get_vault_len(mint: &InterfaceAccount<Mint>) -> anchor_lang::Result<usize
161161
Ok(extensions) => extensions,
162162
// If we cant deserialize the mint, we use the default token account length
163163
// Init token will fail if this size doesnt work, so worst case init account just fails
164-
Err(_) => return Ok(::anchor_spl::token::TokenAccount::LEN),
164+
Err(_) => {
165+
msg!("Failed to deserialize mint. Falling back to default token account length");
166+
return Ok(::anchor_spl::token::TokenAccount::LEN);
167+
}
165168
};
166169
let required_extensions =
167170
ExtensionType::get_required_init_account_extensions(&mint_extensions);

0 commit comments

Comments
 (0)