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(ics20): Extract grant checking and updating functions for reuse #1850

Merged
merged 16 commits into from
Oct 13, 2023

Conversation

Vvaradinov
Copy link
Contributor

Description

This is the 3rd PR extracting the Grant checking and updating logic so it can be easily re-used in future Outposts or extension utilizing ICS20 Transfers.


Closes #XXX

@Vvaradinov Vvaradinov requested a review from a team as a code owner October 12, 2023 09:35
@Vvaradinov Vvaradinov requested review from facs95 and GAtom22 and removed request for a team October 12, 2023 09:35
@codecov
Copy link

codecov bot commented Oct 12, 2023

Codecov Report

Merging #1850 (63e2479) into main (90bb20e) will increase coverage by 0.20%.
The diff coverage is 93.93%.

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

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1850      +/-   ##
==========================================
+ Coverage   70.38%   70.58%   +0.20%     
==========================================
  Files         314      314              
  Lines       23422    23369      -53     
==========================================
+ Hits        16486    16496      +10     
+ Misses       6121     6058      -63     
  Partials      815      815              
Files Coverage Δ
precompiles/authorization/events.go 0.00% <ø> (ø)
precompiles/ics20/events.go 70.96% <ø> (+34.30%) ⬆️
precompiles/ics20/types.go 71.05% <100.00%> (+3.56%) ⬆️
precompiles/ics20/tx.go 75.00% <75.00%> (-7.36%) ⬇️

# Conflicts:
#	CHANGELOG.md
#	precompiles/authorization/IICS20Authorization.sol
#	precompiles/authorization/events.go
#	precompiles/common/Types.sol
#	precompiles/common/types.go
#	precompiles/ics20/abi.json
#	precompiles/ics20/approve_common.go
#	precompiles/ics20/approve_test.go
#	precompiles/ics20/events.go
#	precompiles/ics20/events_test.go
#	precompiles/ics20/integration_test.go
#	precompiles/ics20/query.go
#	precompiles/ics20/query_test.go
#	precompiles/ics20/tx.go
#	precompiles/ics20/types.go
#	precompiles/ics20/utils_test.go
Copy link
Contributor

@GAtom22 GAtom22 left a comment

Choose a reason for hiding this comment

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

LGTM! Great work @Vvaradinov!!

Copy link
Contributor

@MalteHerrmann MalteHerrmann left a comment

Choose a reason for hiding this comment

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

LGTM! Left some nits and a Q though 🙏

precompiles/authorization/events.go Show resolved Hide resolved
precompiles/ics20/types.go Show resolved Hide resolved
precompiles/ics20/types.go Outdated Show resolved Hide resolved
Co-authored-by: MalteHerrmann <42640438+MalteHerrmann@users.noreply.github.com>
@Vvaradinov Vvaradinov enabled auto-merge (squash) October 13, 2023 07:17
@Vvaradinov Vvaradinov merged commit 6d2d0f1 into main Oct 13, 2023
25 checks passed
@Vvaradinov Vvaradinov deleted the Vvaradinov/common-grant-functions branch October 13, 2023 07:27
@Vvaradinov
Copy link
Contributor Author

https://github.com/Mergifyio backport release/v15.0.x

@mergify
Copy link
Contributor

mergify bot commented Oct 16, 2023

backport release/v15.0.x

✅ Backports have been created

mergify bot pushed a commit that referenced this pull request Oct 16, 2023
…1850)

* fix: add some of the refactors

* add CHANGELOG

* fix: common approval logic and test refactor to use the new event emitting

* fix: extract check and update grant functions for case when smart contracts are calling

* CHANGELOG

* CHANGELOG

* fix: added back changes needed

* fix: remove unused event

* CHANGELOG

* format and lint

* Apply suggestions from code review

Co-authored-by: MalteHerrmann <42640438+MalteHerrmann@users.noreply.github.com>

---------

Co-authored-by: Tom <54514587+GAtom22@users.noreply.github.com>
Co-authored-by: MalteHerrmann <42640438+MalteHerrmann@users.noreply.github.com>
(cherry picked from commit 6d2d0f1)

# Conflicts:
#	CHANGELOG.md
#	precompiles/ics20/events.go
#	precompiles/ics20/tx.go
#	precompiles/ics20/types.go
Vvaradinov added a commit that referenced this pull request Oct 16, 2023
…backport #1850) (#1872)

* fix(ics20): Extract grant checking and updating functions for reuse (#1850)

* fix: add some of the refactors

* add CHANGELOG

* fix: common approval logic and test refactor to use the new event emitting

* fix: extract check and update grant functions for case when smart contracts are calling

* CHANGELOG

* CHANGELOG

* fix: added back changes needed

* fix: remove unused event

* CHANGELOG

* format and lint

* Apply suggestions from code review

Co-authored-by: MalteHerrmann <42640438+MalteHerrmann@users.noreply.github.com>

---------

Co-authored-by: Tom <54514587+GAtom22@users.noreply.github.com>
Co-authored-by: MalteHerrmann <42640438+MalteHerrmann@users.noreply.github.com>
(cherry picked from commit 6d2d0f1)

# Conflicts:
#	CHANGELOG.md
#	precompiles/ics20/events.go
#	precompiles/ics20/tx.go
#	precompiles/ics20/types.go

* fix: remove merge marks

* fix: correct type for Transfer Authz

---------

Co-authored-by: Vladislav Varadinov <vladislav.varadinov@gmail.com>
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

3 participants