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

fix(werc20): WERC20 refactors and handling of fallback and receive functions #2057

Merged
merged 9 commits into from Nov 20, 2023

Conversation

Vvaradinov
Copy link
Contributor

Description

This PR refactors some functionality on the WERC20 precompile as discovered through integration tests. In particular:

  • the deposit function is payable and thus would trigger the minting/burning mechanism because it's a change of account balance. We manually override it by using the stateDB directly
  • handling the receive and fallback functions which will not have a methodID, done in the common precompile setup

Closes #XXX

Copy link

codecov bot commented Nov 20, 2023

Codecov Report

Merging #2057 (b007b8e) into main (e51d4d6) will decrease coverage by 0.01%.
Report is 4 commits behind head on main.
The diff coverage is 0.00%.

❗ Current head b007b8e differs from pull request most recent head 2b70bbf. Consider uploading reports for the commit 2b70bbf to get more accurate results

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2057      +/-   ##
==========================================
- Coverage   70.16%   70.15%   -0.01%     
==========================================
  Files         340      340              
  Lines       25448    25451       +3     
==========================================
  Hits        17856    17856              
- Misses       6679     6682       +3     
  Partials      913      913              
Files Coverage Δ
precompiles/common/precompile.go 0.00% <0.00%> (ø)

precompiles/common/precompile.go Show resolved Hide resolved
precompiles/werc20/events.go Outdated Show resolved Hide resolved
precompiles/werc20/events.go Outdated Show resolved Hide resolved
precompiles/werc20/werc20.go Outdated Show resolved Hide resolved
precompiles/werc20/werc20.go Outdated Show resolved Hide resolved
precompiles/werc20/werc20.go Outdated Show resolved Hide resolved
precompiles/werc20/werc20.go Outdated Show resolved Hide resolved
@Vvaradinov Vvaradinov marked this pull request as ready for review November 20, 2023 12:51
@Vvaradinov Vvaradinov requested a review from a team as a code owner November 20, 2023 12:51
@Vvaradinov Vvaradinov requested review from MalteHerrmann and GAtom22 and removed request for a team November 20, 2023 12:51
Copy link
Contributor

@fedekunze fedekunze left a comment

Choose a reason for hiding this comment

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

final comments

precompiles/werc20/events.go Outdated Show resolved Hide resolved
precompiles/werc20/tx.go Outdated Show resolved Hide resolved
precompiles/werc20/werc20.go Outdated Show resolved Hide resolved
precompiles/werc20/werc20.go Outdated Show resolved Hide resolved
Vvaradinov and others added 2 commits November 20, 2023 14:07
Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com>
precompiles/werc20/werc20.go Show resolved Hide resolved
@Vvaradinov Vvaradinov enabled auto-merge (squash) November 20, 2023 13:26
@Vvaradinov Vvaradinov merged commit 4baaf2d into main Nov 20, 2023
28 checks passed
@Vvaradinov Vvaradinov deleted the Vvaradinov/werc20-refactors branch November 20, 2023 13:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants