Skip to content

Conversation

@dimzachar
Copy link

Fix the Bug Submission Pull Request

What was the bug?

The problem lies in how the signer is being specified for the transactions in the AtomicTransactionComposer.

atc.addTransaction({txn: ptxn1, signer: sender})
atc.addTransaction({txn: ptxn2, signer: sender})

The error message TypeError: signer is not a function hints that the signer property is not correctly provided.

Here, sender is passed as the signer. However, according to the challenge hints and the Algorand JavaScript SDK, the signer should be a function that knows how to sign the transactions, not just the account object itself.

How did you fix the bug?

The Algorand JS SDK documentation mentions makeBasicAccountTransactionSigner, a utility function that creates a signer function from an account object:

1)Create a signer function for sender account using the makeBasicAccountTransactionSigner function from the Algorand JavaScript SDK.

2)Pass the created signer function to atc.addTransaction

The challenge doesn't specify details about the rekeyed account or its keys, so not sure if we need to take into account if account is rekeyed.

Console Screenshot:

challenge4

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

No need to consider rekeying great job!

🎉 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