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

feat(examples): Implement p/demo/nonces #2123

Closed
wants to merge 51 commits into from

Conversation

linhpn99
Copy link
Contributor

@linhpn99 linhpn99 commented May 16, 2024

Description

From issue : #2119

A simple implementation of nonce manager in p/demo/nonces : Provides tracking nonces for addresses. Nonces will only increment.

  • Logic code
  • Test cases
Contributors' checklist...
  • Added new tests, or not needed, or not feasible
  • Provided an example (e.g. screenshot) to aid review or the PR is self-explanatory
  • Updated the official documentation or not needed
  • No breaking changes were made, or a BREAKING CHANGE: xxx message was included in the description
  • Added references to related issues and PRs
  • Provided any useful hints for running manual tests
  • Added new benchmarks to generated graphs, if any. More info here.

@linhpn99 linhpn99 requested review from a team as code owners May 16, 2024 07:38
@linhpn99 linhpn99 requested review from thehowl and mvertes and removed request for a team May 16, 2024 07:38
@github-actions github-actions bot added the 🧾 package/realm Tag used for new Realms or Packages. label May 16, 2024
return currentNonce
}

// UseCheckedNonce consumes a nonce if it matches the expected value, otherwise returns 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.

Could you explain how you intend to use this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think this is a necessary additional check before actually consuming the nonce

Copy link
Member

@moul moul May 27, 2024

Choose a reason for hiding this comment

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

Reviewing your pull requests is challenging. Please avoid marking conversations as resolved on your own. Instead, focus on addressing the issues or providing responses so we can more easily conduct a second review.

cc @gnolang/devrels @zivkovicmilos

Copy link
Member

Choose a reason for hiding this comment

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

I don't understand your answer. Can you provide a better explanation? An example?

@moul
Copy link
Member

moul commented Jun 29, 2024

Can you provide some usage examples for this package? I see a pattern of using a map[string]counter, but I'm unsure why it's named "nonce" and only takes stdAddress as key. Could you please share a usage example?

@linhpn99
Copy link
Contributor Author

linhpn99 commented Jun 29, 2024

Can you provide some usage examples for this package? I see a pattern of using a map[string]counter, but I'm unsure why it's named "nonce" and only takes stdAddress as key. Could you please share a usage example?

For sure, demo is here #2225

Actually, the name nonces was inspired by a package of the same name from OpenZeppelin. While considering its functionality, we can also think of a clearer name for it

@moul
Copy link
Member

moul commented Jun 29, 2024

@linhpn99 linhpn99 closed this Sep 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🧾 package/realm Tag used for new Realms or Packages.
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants