Skip to content

Commit

Permalink
fix _create_account_args
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinheavey committed Jul 5, 2024
1 parent a5ae4f0 commit 1c54661
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/spl/token/async_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ async def create_account(
recent_blockhash_to_use = (
(await self._conn.get_latest_blockhash()).value.blockhash if recent_blockhash is None else recent_blockhash
)
new_account_pk, txn, payer, new_account, opts = self._create_account_args(
new_account_pk, txn, opts = self._create_account_args(
owner, skip_confirmation, balance_needed, self._conn.commitment, recent_blockhash_to_use
)
# Send the two instructions
Expand Down
2 changes: 1 addition & 1 deletion src/spl/token/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ def create_account(
recent_blockhash_to_use = (
self._conn.get_latest_blockhash().value.blockhash if recent_blockhash is None else recent_blockhash
)
new_account_pk, txn, payer, new_account, opts = self._create_account_args(
new_account_pk, txn, opts = self._create_account_args(
owner, skip_confirmation, balance_needed, self._conn.commitment, recent_blockhash_to_use
)
# Send the two instructions
Expand Down
6 changes: 2 additions & 4 deletions src/spl/token/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ def _create_account_args(
balance_needed: int,
commitment: Commitment,
recent_blockhash: Blockhash,
) -> Tuple[Pubkey, Transaction, Keypair, Keypair, TxOpts]:
) -> Tuple[Pubkey, Transaction, TxOpts]:
new_keypair = Keypair()
# Allocate memory for the account

Expand All @@ -180,12 +180,10 @@ def _create_account_args(
),
]
msg = Message.new_with_blockhash(ixs, self.payer.pubkey(), recent_blockhash)
txn = Transaction([self.payer], msg, recent_blockhash)
txn = Transaction([self.payer, new_keypair], msg, recent_blockhash)
return (
new_keypair.pubkey(),
txn,
self.payer,
new_keypair,
TxOpts(skip_confirmation=skip_confirmation, preflight_commitment=commitment),
)

Expand Down

0 comments on commit 1c54661

Please sign in to comment.