-
Notifications
You must be signed in to change notification settings - Fork 252
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(wallet)_: remove unused fields from the token type #6375
chore(wallet)_: remove unused fields from the token type #6375
Conversation
Jenkins BuildsClick to see older builds (46)
|
services/wallet/reader.go
Outdated
BalancesPerChain: balancesPerChain, | ||
} | ||
for symbol, tokens := range getTokenBySymbols(allTokens) { | ||
balancesPerChain := r.createBalancePerChainPerSymbol(address, balances, tokens, cachedTokens, connectedPerChain, dayAgoTimestamp) |
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.
the goal behind splitting verified and unverified tokens was so that, for example, balances of some random community token with symbol DAI would not be grouped together with (or even overwrite) the balances for the real DAI. We mark tokens coming from a token list as "verified" and expect symbols to be unique among verified tokens. It's a workaround since we're using the symbols as a key to identify a token across multiple chains, we cannot remove the workaround until we identify our tokens somehow else.
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.
Not sure if some change was done in the meantime to account for that, making the workaround unnecessary. Please test the condition I speak about (i.e. create a community token with symbol DAI and check that the balances are not mixed up)
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.
we should probably have a unit test covering that scenario
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.
It's a workaround since we're using the symbols as a key to identify a token across multiple chains
Yes, that was before (that's even now), but this PR, as well as the base PR of this one, are just small steps towards the final idea where we will make tokens unique by chain + address combination cause that's the only unique thing.
We mark tokens coming from a token list as "verified" and expect symbols to be unique among verified tokens.
I wonder how we handle (in the current code, from develop) if there is more than a single community and each has the same symbol for their token? I guess in that case with this approach, even Verified flag doesn't help, no?
I don't mind reverting changes for the Verified flag, keeping the reset, and getting back to it in one of the follow-up PRs, sound good?
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.
until we identify our tokens somehow else
Can't we say that tokens with CommunityData != nil
are actually custom tokens, not verified?
fe83473
to
820c95a
Compare
0f22d58
to
f472a7a
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## feat/tokens-list #6375 +/- ##
====================================================
+ Coverage 61.00% 61.05% +0.05%
====================================================
Files 873 873
Lines 112760 112601 -159
====================================================
- Hits 68787 68747 -40
+ Misses 35964 35871 -93
+ Partials 8009 7983 -26
Flags with carried forward coverage won't be shown. Click here to find out more.
|
f472a7a
to
4b44c2a
Compare
8f365ba
to
bb06216
Compare
4b44c2a
to
8c6cdad
Compare
bb06216
to
d229265
Compare
b1509b8
to
b053191
Compare
I've just reverted the |
Removed fields: - `TokenListID`
…onding field in the response Before this change updatedAt was pointing to the when the last list from the stores was updated. That's sorted out. `LastUpdateTimestamp` field added to the `List` type. A client needs to display the time of the last update.
b053191
to
bde82ae
Compare
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.
Looks good to me. I've grepped TokenListID
and it doesn't seem to be used anywhere.
Before this change updatedAt was pointing to the when the last list from the stores was updated. That's sorted out.
LastUpdateTimestamp
field added to theList
type. A client needs to display the time of the last update.