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

Expose method to fetch nonce via Client #451

Merged
merged 1 commit into from
Feb 16, 2022
Merged

Conversation

ascjones
Copy link
Member

When manually managing an account's nonce via set_nonce and increment_nonce, the current account nonce is not fetched by default but has to be manually initialized. The tricky thing is knowing what the current valid nonce is.

This PR extracts a method which allows fetching the current value of an account's nonce via Client, so we can initialize it with signer.set_nonce.

Possibly there is a nice API we could add which would perform this one-time initialization, but better to start with allowing it to be done explicitly. In any case it is useful to be able to query the current account nonce.

Copy link
Collaborator

@jsdw jsdw left a comment

Choose a reason for hiding this comment

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

LGTM; funny, I was just looking at that code!

@jsdw jsdw merged commit 0e0553a into master Feb 16, 2022
@jsdw jsdw deleted the aj/client-fetch-nonce branch February 16, 2022 10:18
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