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): expose ownable & pausable safe objects, update ownable API #3331

Merged
merged 18 commits into from
Dec 17, 2024

Conversation

leohhhn
Copy link
Contributor

@leohhhn leohhhn commented Dec 12, 2024

Description

This PR exposes safe objects where possible for ownable and pausable packages.

Let's start exposing variables named Ownable, ie:

var Ownable = ownable.New()

This is the intended use, as exposing this field allows direct, safe, MsgRun calls to access the ownable functions. It's also impossible to directly reassign the value of this variable from another realm.

This PR also introduces a BREAKING CHANGE: the Ownable.CallerIsOwner API now returns a boolean instead of an error, which makes more sense considering the name of the function.

@github-actions github-actions bot added the 🧾 package/realm Tag used for new Realms or Packages. label Dec 12, 2024
@Gno2D2
Copy link
Collaborator

Gno2D2 commented Dec 12, 2024

🛠 PR Checks Summary

All Automated Checks passed. ✅

Manual Checks (for Reviewers):
  • SKIP: Do not block the CI for this PR
Read More

🤖 This bot helps streamline PR reviews by verifying automated checks and providing guidance for contributors and reviewers.

✅ Automated Checks (for Contributors):

🟢 Maintainers must be able to edit this pull request (more info)
🟢 The pull request head branch must be up-to-date with its base (more info)

☑️ Contributor Actions:
  1. Fix any issues flagged by automated checks.
  2. Follow the Contributor Checklist to ensure your PR is ready for review.
    • Add new tests, or document why they are unnecessary.
    • Provide clear examples/screenshots, if necessary.
    • Update documentation, if required.
    • Ensure no breaking changes, or include BREAKING CHANGE notes.
    • Link related issues/PRs, where applicable.
☑️ Reviewer Actions:
  1. Complete manual checks for the PR, including the guidelines and additional checks if applicable.
📚 Resources:
Debug
Automated Checks
Maintainers must be able to edit this pull request (more info)

If

🟢 Condition met
└── 🟢 The pull request was created from a fork (head branch repo: leohhhn/gno)

Then

🟢 Requirement satisfied
└── 🟢 Maintainer can modify this pull request

The pull request head branch must be up-to-date with its base (more info)

If

🟢 Condition met
└── 🟢 On every pull request

Then

🟢 Requirement satisfied
└── 🟢 Head branch (leohhhn:ownable-pausable) is up to date with base (master): behind by 0 / ahead by 18

Manual Checks
**SKIP**: Do not block the CI for this PR

If

🟢 Condition met
└── 🟢 On every pull request

Can be checked by

  • Any user with comment edit permission

Copy link

codecov bot commented Dec 12, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

📢 Thoughts on this report? Let us know!

@leohhhn leohhhn marked this pull request as ready for review December 17, 2024 13:47
@leohhhn leohhhn requested review from moul, n2p5 and gfanton and removed request for moul December 17, 2024 13:47
@leohhhn leohhhn marked this pull request as draft December 17, 2024 13:52
@leohhhn leohhhn changed the title feat(examples): ownable & pausable safe objects feat(examples): expose ownable & pausable safe objects, update ownable API Dec 17, 2024
@leohhhn leohhhn marked this pull request as ready for review December 17, 2024 13:54
Copy link
Member

@gfanton gfanton left a comment

Choose a reason for hiding this comment

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

LGTM 👍

Copy link
Contributor

@n2p5 n2p5 left a comment

Choose a reason for hiding this comment

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

Clean and easy to follow PR, much appreciated on that. LGTM

@leohhhn leohhhn merged commit 9855f53 into gnolang:master Dec 17, 2024
112 of 115 checks passed
@leohhhn leohhhn deleted the ownable-pausable branch December 17, 2024 18:00
omarsy pushed a commit to omarsy/gno that referenced this pull request Dec 18, 2024
…e API (gnolang#3331)

## Description

This PR exposes safe objects where possible for ownable and pausable
packages.

Let's start exposing variables named `Ownable`, ie:

```go
var Ownable = ownable.New()
```

This is the intended use, as exposing this field allows direct, safe,
MsgRun calls to access the ownable functions. It's also impossible to
directly reassign the value of this variable from another realm.

This PR also introduces a BREAKING CHANGE: the `Ownable.CallerIsOwner`
API now returns a boolean instead of an error, which makes more sense
considering the name of the function.

---------

Co-authored-by: Guilhem Fanton <[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
Development

Successfully merging this pull request may close these issues.

4 participants