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 wait for confirmation function #469

Merged
merged 8 commits into from
Nov 10, 2021
Merged

Conversation

jasonpaulos
Copy link
Member

Add wait for confirmation function for verifying transaction confirmation.

Copy link
Contributor

@algochoi algochoi left a comment

Choose a reason for hiding this comment

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

Nice addition to the JS SDK 🎉

I'm also curious to whether this should be kept with algod or transactions (I believe the Python SDK binds this method to the latter).

src/client/v2/algod/waitForConfirmation.ts Outdated Show resolved Hide resolved
await this.v2Client.statusAfterBlock(sp.firstRound + 2).do();
const fundingConfirmation = await this.acl.transactionById(
fundingResponse.txId
const info = await algosdk.waitForConfirmation(
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice -- also what is this.acl? Is that the v1 client?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes that's the v1 algod client

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor

@ahangsu ahangsu left a comment

Choose a reason for hiding this comment

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

I don't have general comments here. Just curious, why there are 2 alike implementation for WaitForConfirmation in JS-SDK?

Copy link
Contributor

@ahangsu ahangsu left a comment

Choose a reason for hiding this comment

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

LGTM

@jasonpaulos
Copy link
Member Author

My bad, I originally forgot to delete the file in the algod client folder.

@jasonpaulos jasonpaulos merged commit 70c68f2 into develop Nov 10, 2021
@jasonpaulos jasonpaulos deleted the wait-for-confirmation branch November 10, 2021 22:23
aldur pushed a commit that referenced this pull request Jan 20, 2022
* Added waitForConfirmation to v2 API

* Renamed timeout to waitRounds

* Move to waitForConfirmation function

* Change eslint settings

* Use in cucumber tests

* Delete file from algod folder

Co-authored-by: Damian Barabonkov <damianb@mit.edu>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants