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

Add created asset index to txn status #490

Merged

Conversation

justicz
Copy link
Contributor

@justicz justicz commented Nov 7, 2019

This PR adds a new field to v1.Transaction called TransactionResults. This field is a struct containing CreatedAssetIndex, the index (if any) of an asset created by this transaction.

It computes the created asset index by looking up the block associated with the transaction if it was confirmed (and the correct type of transaction), computing the offset within that block, and adjusting based on TxnCounter.

Currently we're just returning this on a best-effort basis. If we don't have access to the block, we can't compute the created asset index based on just the transaction id.

@justicz justicz marked this pull request as ready for review November 8, 2019 15:05
@justicz justicz changed the title DRAFT add created asset index to txn status Add created asset index to txn status Nov 8, 2019
@justicz justicz requested a review from rotemh November 8, 2019 15:06
@rotemh
Copy link
Contributor

rotemh commented Nov 8, 2019

one comment, otherwise, looks good to me

@algobolson
Copy link
Contributor

This is probably good but I feel like it would be better with a test that submits a create-asset transaction, gets this response, then looks up the creator's account info to see that the same asset id is listed there.

Copy link
Contributor

@tsachiherman tsachiherman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good to me.

@tsachiherman tsachiherman merged commit 39f3b73 into algorand:master Nov 9, 2019
winder pushed a commit that referenced this pull request Nov 12, 2019
* add created asset id to api transaction and print during goal asset create

* move createdassetindex into results struct

* fix txn counter math

* add comment

* only add asset created info to pending endpoint

* add comment
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.

None yet

4 participants