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

chore(examples): update avlhelpers to use avl.ITree #3377

Merged
merged 2 commits into from
Dec 20, 2024

Conversation

leohhhn
Copy link
Contributor

@leohhhn leohhhn commented Dec 19, 2024

Description

Updates the avlhelpers package to use the new avl.ITree interface.

@leohhhn leohhhn requested a review from jefft0 December 19, 2024 15:47
@github-actions github-actions bot added the 🧾 package/realm Tag used for new Realms or Packages. label Dec 19, 2024
@Gno2D2
Copy link
Collaborator

Gno2D2 commented Dec 19, 2024

🛠 PR Checks Summary

All Automated Checks passed. ✅

Manual Checks (for Reviewers):
  • IGNORE the bot requirements for this PR (force green CI check)
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: leohhhn/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

Copy link

codecov bot commented Dec 19, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

📢 Thoughts on this report? Let us know!

@leohhhn
Copy link
Contributor Author

leohhhn commented Dec 19, 2024

Hey @jefft0, I made this PR because the upcoming r/demo/users refactor (#3166) will change the API of the r/users system.

Essentially, instead of exposing a ListUsersByPrefix function, we're exposing a readonly version of the tree that stores usernames/addresses. This tree follows the newly implemented avl.ITree interface, allowing all classing read operations on the tree. This way you can use the avlhelpers package in your smart contracts, and simply use the exposed Readonly User tree.

Hope I was clear, let me know if otherwise.

I will keep you up to speed on the progress of the refactor PR, after which you will need to update your realms as well (hoping for merge mid jan)

@jefft0
Copy link
Contributor

jefft0 commented Dec 19, 2024

Hi @leohhhn . You mention the change to ListUsersByPrefix. But will avl.Tree{} continue to work? (Many realms use it.)

@leohhhn
Copy link
Contributor Author

leohhhn commented Dec 19, 2024

Ideally we would use avl.NewTree(). What do you think?

@jefft0
Copy link
Contributor

jefft0 commented Dec 19, 2024

Ideally we would use avl.NewTree(). What do you think?

Yes, it would be ideal. If you want to show best practice, do you want to change this PR to update all the realm code to use avl.NewTree() ? If not, then maybe just mention in the description that this should be done in the future.

@leohhhn
Copy link
Contributor Author

leohhhn commented Dec 20, 2024

@jefft0

Sure, let me take a detalied look. 👍

@jefft0 jefft0 added the review/triage-pending PRs opened by external contributors that are waiting for the 1st review label Dec 20, 2024
@moul moul merged commit e57815a into gnolang:master Dec 20, 2024
115 checks passed
@jefft0
Copy link
Contributor

jefft0 commented Dec 20, 2024

Hi @leohhhn . moul merged this PR. I guess we can deal with updating avl.Tree{} in the realms later. 😉

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
Development

Successfully merging this pull request may close these issues.

4 participants