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 : grc dir examples and minor improvements #3353

Closed
wants to merge 11 commits into from

Conversation

matijamarjanovic
Copy link
Contributor

@matijamarjanovic matijamarjanovic commented Dec 17, 2024

Work in progress

Description

This PR serves a u puropse of adding little missing details in the GRC directory to try and make it's use a little bit easier, for instance adding functions to examples_test.gno. I will also try to fill some holes if there is room for improvement, like add safety checks, etc.

Contributors checklist

  • Add examples_test.gno implementation for demonstration purposes
  • Add check in NewToken for token name and symbol length
  • Add pub-sub system for emitting events in GRC721 util.gno
  • Add pub-sub system for emitting events in GRC1155 util.gno
  • Add mock.gno implementation for grc20
  • Address that example_test.gno is purely for demonstation purposes in the comments and comment out Example test implementations

Any thoughts and advice is welcome

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

Gno2D2 commented Dec 17, 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: matijamarjanovic/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

Copy link

codecov bot commented Dec 17, 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 draft December 17, 2024 14:55
@matijamarjanovic matijamarjanovic changed the title feat : refractor GRC1155 and finish implementing functionalities feat : finish implementing functionalities in progress for GRC1155 Dec 17, 2024
@matijamarjanovic matijamarjanovic changed the title feat : finish implementing functionalities in progress for GRC1155 feat : finish implementing functionalities in progress for grc package Dec 17, 2024
@matijamarjanovic matijamarjanovic changed the title feat : finish implementing functionalities in progress for grc package feat : grc dir examples and minor improvements Dec 17, 2024
)

// ExampleInit demonstrates how to initialize a new token.
func ExampleInit() {
Copy link
Member

Choose a reason for hiding this comment

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

I would love to have those Example tests. However, since they are not yet supported, I believe we should avoid using them because the tests are not actually tested.

We can keep your PR on hold until we have the feature. Alternatively, you could comment out everything and add a note explaining that it is just for inspiration, not a real test.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The intention was to showcase how to use the token lib as I have had some troubles in the past with using banker as there was a lack of examples, but you are right I will address this in a comment

@@ -1,3 +0,0 @@
package grc20
Copy link
Member

Choose a reason for hiding this comment

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

Does anyone see an interesting mock for GRC20?

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 thought it was extra, adding it to the todo list🫡

@matijamarjanovic
Copy link
Contributor Author

matijamarjanovic commented Dec 18, 2024

After thinking about it for a while I have decided to put this PR on hold as @moul suggested, or even close it until Example tests become available, as it is right now - there's not much room for improvement, contrary to my initial beliefs.
Either way this has helped me a lot in understanding grc on a deeper level.

@thehowl
Copy link
Member

thehowl commented Dec 18, 2024

Suggestion: maybe we can make these into filetests for now before we have testable examples.

@matijamarjanovic
Copy link
Contributor Author

Suggestion: maybe we can make these into filetests for now before we have testable examples.

I have no experience with that, but if you could maybe point me to some examples I'm confident I'll figure it out

@matijamarjanovic matijamarjanovic closed this by deleting the head repository Dec 20, 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
Development

Successfully merging this pull request may close these issues.

4 participants