-
Notifications
You must be signed in to change notification settings - Fork 24
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
feat(interchain-token-service): apply balance invariants for ITS transfers #573
base: main
Are you sure you want to change the base?
Conversation
This reverts commit 8336d75.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## feat/its-hub-middleware #573 +/- ##
===========================================================
+ Coverage 93.76% 93.90% +0.14%
===========================================================
Files 210 211 +1
Lines 28607 29262 +655
===========================================================
+ Hits 26823 27479 +656
+ Misses 1784 1783 -1 ☔ View full report in Codecov by Sentry. |
/// Token balance for a given token id and chain | ||
#[cw_serde] | ||
pub enum TokenBalance { | ||
/// Token balance is tracked on the chain | ||
Tracked(Uint256), | ||
/// Token balance is not tracked | ||
Untracked, | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Open to naming suggestions here. We need to distinguish between whether the token was already deployed once or not, and whether the balance invariant should be updated for this token
For custom tokens, we don't want to track balances since ITS doesn't have sole control over the mint/burn rights there. I used an enum instead of Option
to make it more explicit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is also more token related info that we will likely store, such as rate limits. I'm thinking about wrapping this into a TokenInfo struct vs having separate maps for each. For transfers we'd be reading both everytime, but for deployments we only need to read the token balance though (but when stored under the same struct, we end up read both)
Description
AXE-4185
Todos
Steps to Test
Expected Behaviour
Other Notes