Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix transaction signing issue in payment process #112

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

algotables
Copy link

Algorand Coding Challenge Submission

What was the bug?

The problem was a TypeError that occurred when trying to send a payment transaction using the Algorand blockchain. The error message indicated that the sendRawTransaction method expected a byte array, but instead received a transaction object. This issue prevented the transaction from being processed and confirmed on the blockchain.

How did you fix the bug?

I solved the problem by adjusting the transaction submission process to include the necessary transaction signing step, which was previously missing. Here’s the breakdown of the solution:

  1. Transaction Signing: After creating the transaction object, I used the sender's secret key to sign the transaction. This step converts the transaction into a signed version, which is a necessary format for submission to the Algorand network.

  2. Sending Signed Transaction: I then updated the script to send the signed transaction's raw bytes instead of the transaction object. The sendRawTransaction method requires a byte array, which is now correctly provided by the signed transaction.

  3. Confirmation and Logging: I added confirmation handling to ensure the transaction was properly acknowledged by the network and added detailed logging to verify the successful submission and confirmation.

Console Screenshot:

python-volume-1-challenge-1-jeff-stein-5-11-24

Resolved a TypeError by properly signing the transaction before sending it to the Algorand network. Updated the transaction creation and submission process:

- Transactions are now signed using the sender's secret key to generate the required byte array.
- Updated the sendRawTransaction call to use the signed transaction bytes.

These changes ensure that the payment transaction is successfully sent and confirmed on the blockchain.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant