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(p/grc20): Distinct Event Types for GRC20 Functions #2749

Merged
merged 2 commits into from
Oct 2, 2024

Conversation

notJoon
Copy link
Member

@notJoon notJoon commented Sep 2, 2024

Description

Currently, the event type for grc20 is uniformly set to TrasferEvent (execpt for Approval function), which necessitated making RPC calls to check every block.

Therefore, I have modified it by adding event types for each function to distinguish them from one another.

In this case, we can reduce the number of RPC calls by retrieving data only when the target event type occurs.

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.

@notJoon notJoon requested review from a team as code owners September 2, 2024 02:37
@notJoon notJoon requested review from deelawn and gfanton and removed request for a team September 2, 2024 02:37
@github-actions github-actions bot added the 🧾 package/realm Tag used for new Realms or Packages. label Sep 2, 2024
Copy link

codecov bot commented Sep 2, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 60.92%. Comparing base (0e84846) to head (f1861d8).
Report is 2 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2749      +/-   ##
==========================================
+ Coverage   60.90%   60.92%   +0.01%     
==========================================
  Files         564      564              
  Lines       75273    75273              
==========================================
+ Hits        45848    45859      +11     
+ Misses      26055    26044      -11     
  Partials     3370     3370              
Flag Coverage Δ
contribs/gnodev 61.46% <ø> (ø)
contribs/gnofaucet 14.46% <ø> (-0.86%) ⬇️
gno.land 67.17% <ø> (ø)
gnovm 65.77% <ø> (ø)
misc/genstd 80.54% <ø> (ø)
misc/logos 19.88% <ø> (ø)
tm2 62.11% <ø> (+0.06%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

@leohhhn
Copy link
Contributor

leohhhn commented Sep 2, 2024

@notJoon, can you elaborate more on why you want to do this?

@leohhhn
Copy link
Contributor

leohhhn commented Sep 5, 2024

The ERC20 spec mentions that a mint function should emit a transfer from a zero address to the address receiving new tokens (see Events - Transfer). Ideally, mint would use transfer under the hood, which would emit its own event satisfying the spec.

Since we're actively working on the GRC20 package, let me know how crucial this is to you; we (or you) can try to implement what I mentioned above in the next iteration.

It mentions nothing about the burn case, so I guess we can do whatever we want there.

cc @moul

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.

Thank you for the mini fix 🙏

@zivkovicmilos
Copy link
Member

@notJoon

Can you please merge master and check why the CI is failing? 🙏

@thehowl thehowl merged commit 4f6ca96 into gnolang:master Oct 2, 2024
119 checks passed
@notJoon notJoon deleted the grc20-event branch October 2, 2024 12:05
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
Status: Done
Status: Done
Development

Successfully merging this pull request may close these issues.

4 participants