Skip to content

feat: automatically clear unsupplied blacklisted tokens#1808

Merged
toteki merged 10 commits intomainfrom
adam/blacklist
Feb 14, 2023
Merged

feat: automatically clear unsupplied blacklisted tokens#1808
toteki merged 10 commits intomainfrom
adam/blacklist

Conversation

@toteki
Copy link
Copy Markdown
Contributor

@toteki toteki commented Feb 13, 2023

When a leverage registry update passes (regardless of whether it blacklisted any tokens), the module checks for any existing blacklisted tokens with zero supply and deletes them.

If supply is nonzero, deletion is not acceptable because the module would lose the ability to interpret existing uToken balances, reserves, borrows, etc for the blacklisted base denom.

@codecov-commenter
Copy link
Copy Markdown

Codecov Report

Merging #1808 (7fd870a) into main (7c04da0) will decrease coverage by 0.09%.
The diff coverage is 23.80%.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1808      +/-   ##
==========================================
- Coverage   57.80%   57.72%   -0.09%     
==========================================
  Files          78       78              
  Lines        8023     8044      +21     
==========================================
+ Hits         4638     4643       +5     
- Misses       3047     3061      +14     
- Partials      338      340       +2     
Impacted Files Coverage Δ
x/leverage/keeper/token.go 54.09% <23.52%> (-11.82%) ⬇️
x/leverage/keeper/msg_server.go 79.13% <25.00%> (-0.64%) ⬇️

@toteki toteki marked this pull request as ready for review February 13, 2023 07:52
@toteki toteki requested review from a team as code owners February 13, 2023 07:52
Copy link
Copy Markdown
Contributor

@robert-zaremba robert-zaremba left a comment

Choose a reason for hiding this comment

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

Could you clarify when and why we want to remove tokens from the registry? Before you said that we don't want to do that. Let's discuss in the thread in the comment.

Copy link
Copy Markdown
Collaborator

@adamewozniak adamewozniak left a comment

Choose a reason for hiding this comment

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

Might want to make this a bit more clear on the proposal side.

Let's add something like an "AttemptDelete" flag

Copy link
Copy Markdown
Contributor

@robert-zaremba robert-zaremba left a comment

Choose a reason for hiding this comment

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

Pre-approving. Added one small request in the thread

@toteki toteki merged commit 614d2c5 into main Feb 14, 2023
@toteki toteki deleted the adam/blacklist branch February 14, 2023 21:55
mergify bot pushed a commit that referenced this pull request Feb 14, 2023
* feat: automatically clear unsupplied blacklisted tokens

* cl++

* add oracle hooks call

* lint++

* README++

---------

Co-authored-by: Robert Zaremba <robert@zaremba.ch>
(cherry picked from commit 614d2c5)
toteki added a commit that referenced this pull request Feb 14, 2023
* feat: automatically clear unsupplied blacklisted tokens

* cl++

* add oracle hooks call

* lint++

* README++

---------

Co-authored-by: Robert Zaremba <robert@zaremba.ch>
(cherry picked from commit 614d2c5)

Co-authored-by: Adam Moser <63419657+toteki@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants