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: add p/demo/pausable #1328

Merged
merged 8 commits into from
Nov 9, 2023
Merged

feat: add p/demo/pausable #1328

merged 8 commits into from
Nov 9, 2023

Conversation

leohhhn
Copy link
Contributor

@leohhhn leohhhn commented Nov 2, 2023

Description

This PR adds the Pausable package to p/demo, allowing realms to have pausability. It relies on the already existing Ownable package for access control, #1314.

Inspired by OpenZeppelin's Pausable.

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.

@github-actions github-actions bot added the 🧾 package/realm Tag used for new Realms or Packages. label Nov 2, 2023
@leohhhn leohhhn marked this pull request as ready for review November 2, 2023 13:22
@leohhhn leohhhn requested a review from a team as a code owner November 2, 2023 13:22
Copy link

codecov bot commented Nov 2, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (0076e48) 47.89% compared to head (5fd3ab3) 56.37%.
Report is 20 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1328      +/-   ##
==========================================
+ Coverage   47.89%   56.37%   +8.48%     
==========================================
  Files         372      421      +49     
  Lines       63019    67691    +4672     
==========================================
+ Hits        30180    38163    +7983     
+ Misses      30373    26592    -3781     
- Partials     2466     2936     +470     

see 140 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@deelawn deelawn left a comment

Choose a reason for hiding this comment

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

LGTM.

The only suggestion I'd make is to simplify the API to rename the methods to Pause() and Unpause() because it more clearly defines the action rather than how the action is implemented.

Copy link
Member

@zivkovicmilos zivkovicmilos left a comment

Choose a reason for hiding this comment

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

Apart from the small CI fail, good to go 🚀

@thehowl thehowl merged commit 117bcd1 into gnolang:master Nov 9, 2023
63 of 64 checks passed
moul pushed a commit to moul/gno that referenced this pull request Nov 14, 2023
## Description


This PR adds the `Pausable` package to p/demo, allowing realms to have
pausability. It relies on the already existing `Ownable` package for
access control, gnolang#1314.

Inspired by OpenZeppelin's
[Pausable](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.3/contracts/security/Pausable.sol).

<details><summary>Contributors' checklist...</summary>

- [x] Added new tests, or not needed, or not feasible
- [x] Provided an example (e.g. screenshot) to aid review or the PR is
self-explanatory
- [x] Updated the official documentation or not needed
- [x] No breaking changes were made, or a `BREAKING CHANGE: xxx` message
was included in the description
- [x] Added references to related issues and PRs
- [ ] Provided any useful hints for running manual tests
- [ ] Added new benchmarks to [generated
graphs](https://gnoland.github.io/benchmarks), if any. More info
[here](https://github.com/gnolang/gno/blob/master/.benchmarks/README.md).
</details>

---------

Co-authored-by: Morgan Bazalgette <[email protected]>
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
Archived in project
Development

Successfully merging this pull request may close these issues.

5 participants