Skip to content

Conversation

@A-Maugli
Copy link

Fix the Bug Submission Pull Request

What was the bug?
atc.addTransaction({txn: ptxn1, signer: sender})
atc.addTransaction({txn: ptxn2, signer: sender})

property signer can not be assigned by sender, type error

The warning given by VS Code is:
Type 'Account' is not assignable to type 'TransactionSigner'.
Type 'Account' provides no match for the signature '(txnGroup: Transaction[], indexesToSign: number[]): Promise<Uint8Array[]>'.ts(2322)
signer.d.ts(38, 5): The expected type comes from property 'signer' which is declared here on type 'TransactionWithSigner'
(property) TransactionWithSigner.signer: algosdk.TransactionSigner
A transaction signer that can authorize txn

How did you fix the bug?
Opening signer.d.ts, I found the following function
export declare function makeBasicAccountTransactionSigner(account: Account): TransactionSigner;
Using that function, I created a signer, and used that signer in atc.addTransaction:

const signer = algosdk.makeBasicAccountTransactionSigner(sender)
atc.addTransaction({txn: ptxn1, signer: signer})
atc.addTransaction({txn: ptxn2, signer: signer})

Console Screenshot:
challenge-4

@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