Skip to content

Commit

Permalink
Merge pull request #209 from PolytonHQ/bugfix
Browse files Browse the repository at this point in the history
USDC deposits do not work: wrong `close_account` call and `UnboundLocalError: local variable 'ata_pubkey' referenced before assignment`
  • Loading branch information
SinaKhalili authored Dec 10, 2024
2 parents 961676c + 67b067a commit 69e8530
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions src/driftpy/drift_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -1019,14 +1019,15 @@ async def get_deposit_collateral_ix(
),
)
instructions.append(deposit_ix)
close_account_params = CloseAccountParams(
program_id=TOKEN_PROGRAM_ID,
account=ata_pubkey,
dest=signer_authority,
owner=signer_authority,
)
close_account_ix = close_account(close_account_params)
instructions.append(close_account_ix)
if create_WSOL_token_account:
close_account_params = CloseAccountParams(
program_id=TOKEN_PROGRAM_ID,
account=user_token_account,
dest=signer_authority,
owner=signer_authority,
)
close_account_ix = close_account(close_account_params)
instructions.append(close_account_ix)
return instructions

async def withdraw(
Expand Down

0 comments on commit 69e8530

Please sign in to comment.