Skip to content

Conversation

@william-wambua
Copy link

Fix the Bug Submission Pull Request

What was the bug?

The addTransaction method adds a single transaction to an atomic transaction group, it requires the transaction object as well as the TransactionSigner function. The TransactionSigner function is in turn responsible for signing transactions from the atomic transaction group. In this case, instead of passing the TransactionSigner function, the sender's account was passed and consequently, an error was raised with the message TypeError: signer is not a function and upon further inspection of the code you should see the typing error reported as Type 'Account' is not assignable to type 'TransactionSigner'.

How did you fix the bug?

The solution is to replace the sender object with a TransactionSigner method. The method can be created by either using the makeBasicAccountTransactionSigner funciton from algosdk or preferrably the getSenderTransactionSigner function from the algokit package and passing the sender Account object to either functions. In this case, getSenderTransactionSigner is preferred since it uses memoization and would be the optimal option if the TransactionSigner method has to be created multiple times for the same sender.

Console Screenshot:

image

@iskysun96 iskysun96 added the Approved ✅ Successfully completed the challenge! label Apr 1, 2024
@iskysun96
Copy link
Contributor

🎉 Congrats on solving the 4th Algorand Coding Challenge!

I have labeled your PR approved, so you can now claim your certificate.

You can claim your certificate of completion NFT here:
https://goplausible.xyz/claim/8x3aqnmh7p2wf25dvmxz7ksvjs3gr02d6648tf31ny90wwtams53jvssjwcj2bgfs7qr425958h3abw83a33t3tdbqb0sjtntmta82r

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Approved ✅ Successfully completed the challenge!

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants