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 JJOptimist's Homepage realm to examples #3405

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

JJOptimist
Copy link

This pull request adds a new realm example to the Gno examples repository—JJOptimist's Homepage.

The realm includes:

  • Personal introduction and contact information
  • Configuration management system
  • Owner controls
  • Tests for ownership and rendering

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

Gno2D2 commented Dec 25, 2024

🛠 PR Checks Summary

All Automated Checks passed. ✅

Manual Checks (for Reviewers):
  • IGNORE the bot requirements for this PR (force green CI check)
  • The pull request description provides enough details
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)

☑️ 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: JJOptimist/gno)

Then

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

Manual Checks
**IGNORE** the bot requirements for this PR (force green CI check)

If

🟢 Condition met
└── 🟢 On every pull request

Can be checked by

  • Any user with comment edit permission
The pull request description provides enough details

If

🟢 Condition met
└── 🟢 Not (🔴 Pull request author is a member of the team: core-contributors)

Can be checked by

  • team core-contributors

@notJoon notJoon added the review/triage-pending PRs opened by external contributors that are waiting for the 1st review label Dec 26, 2024
@leohhhn leohhhn self-requested a review December 27, 2024 04:31
Copy link
Contributor

@leohhhn leohhhn left a comment

Choose a reason for hiding this comment

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

Please check comments 🙏

Apart from that, if you want to merge something into the examples/ folder, it should provide some educational value about Gno to newcomers. Please, explore a bit more and see what interesting realms or packages you can use to make your home realm more unique, so that it can be merged into the monorepo.

If you do not want to do this, you can simply deploy persmissionlessly.

)

var (

Copy link
Contributor

Choose a reason for hiding this comment

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

Unnecessary newline

)

func init() {
owner = OWNER_ADDR
Copy link
Contributor

Choose a reason for hiding this comment

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

If you're defining this at top-level, you can simply initiate it where you declared it.

This is a bit of a blurry line in Gno, so bear with me- following Go standards, if you can declare+initialize something immediately, do so at top level; init should be reserved for "doing" things you cannot do at declaration+initialization.


OWNER_ADDR = std.Address("g16vfw3r7zuz43fhky3xfsuc2hdv9tnhvlkyn0nj")

owner std.Address
Copy link
Contributor

Choose a reason for hiding this comment

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

Why not use p/demo/ownable?

Comment on lines 32 to 36
func GetConfig() struct {
title string
description string
github string
} {
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: I think there is no need to fold this line

)

func TestOwnership(t *testing.T) {

Copy link
Contributor

Choose a reason for hiding this comment

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

Random newline

@leohhhn
Copy link
Contributor

leohhhn commented Jan 9, 2025

Hey @JJOptimist, what's the status of this PR?

@JJOptimist
Copy link
Author

Hey @JJOptimist, what's the status of this PR?

I fixed the things you pointed out and took your suggestion to use ownable. Ive been experimenting to make something creative/ worth the HoF, so i will push it all together soon

@JJOptimist
Copy link
Author

I've updated the realm

  • Integrated p/demo/ownable for proper ownership management and access control
  • Added dynamic ASCII art gnome that changes based on block height
  • Moved files to home/ directory structure
  • Added proper tests for both ownership and configuration

The gnome's expression changes based on block height divisibility (by 2, 3, 5, or 7)

Copy link
Contributor

Choose a reason for hiding this comment

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

Should this file be removed?

Copy link
Author

Choose a reason for hiding this comment

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

Thanks for quick notice, removed it

Copy link
Contributor

Choose a reason for hiding this comment

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

Leftover file?

Copy link
Author

Choose a reason for hiding this comment

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

Yes leftover, forgot i added it

@leohhhn
Copy link
Contributor

leohhhn commented Jan 10, 2025

@JJOptimist

Generally, please take a look at comments and reply to them, even if they're outdated because you've changed the code completely.

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. review/triage-pending PRs opened by external contributors that are waiting for the 1st review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants