Skip to content

Conversation

@DaughterOfMars
Copy link
Contributor

Description

Adds the wait_for_tx_finalization fn and the wait_for_finalization boolean flag to the execute_tx fn to allow for waiting in the client. I also changed the way we wait, so it is now a duration timeout rather than a number of retries.

Closes #316

@DaughterOfMars DaughterOfMars linked an issue Oct 27, 2025 that may be closed by this pull request
@thibault-martinez
Copy link
Member

Doesn't compile, can't see it on GH because of the conflict

#[error("Missing digest for object {0}")]
MissingDigest(ObjectId),
#[error("Missing transaction for digest {0}")]
MissingTransaction(Digest),
Copy link
Member

Choose a reason for hiding this comment

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

I guess that ship has sailed but I always feel a bit weird this kind of stuff being an error instead of an option

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Well it is an error because it should not be missing

Copy link
Member

Choose a reason for hiding this comment

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

I disagree, it could be missing and that's fine, it's a state, not an error

Copy link
Member

Choose a reason for hiding this comment

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

I'm willing to approve anyway, but I don't think we should do that

@thibault-martinez
Copy link
Member

I'll do a final review before this is merged please 🙏🏻

@thibault-martinez
Copy link
Member

I'll do a final review before this is merged please 🙏🏻

Merging this first thing tomorrow morning, one last look 👀

);

let res = builder.execute(&keypair.into(), true).await?;
let effects = builder.execute(&keypair.into(), None).await?;
Copy link
Contributor

Choose a reason for hiding this comment

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

the only design flaw IMHO of Rust is that it doesn't allow for named arguments. I hate reading function calls, that have true or None in it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah :c

@DaughterOfMars DaughterOfMars merged commit a0dc607 into sdk-bindings Oct 31, 2025
14 checks passed
@DaughterOfMars DaughterOfMars deleted the feat/graphql-ex-finalization branch October 31, 2025 10:11
Alex6323 added a commit that referenced this pull request Nov 3, 2025
* feat(graphql): Allow waiting for finalization in client

* bindings

* go home

* add doc

* Improve wait fn and execute

* apply to other execute fn

* clippy

* review

* Update crates/iota-sdk-graphql-client/src/lib.rs

Co-authored-by: /alex/ <[email protected]>

* more bindings updates

* update gas station example

* fix responses and wait for checkpoint inclusion

* Don't return transaction effects

* fix balance query and improvements

* Update schema and add `is_tx_indexed_on_node`

* add WaitForTx

* rename variants

* typo

* Update iota binary

* fix tests

* fix more tests

* fix publish example

* review

---------

Co-authored-by: /alex/ <[email protected]>
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.

Add Client::wait_for_transaction()

5 participants