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

chore(wallet)_: remove unused fields from the token type #6375

Merged
merged 2 commits into from
Mar 5, 2025

Conversation

saledjenic
Copy link
Contributor

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.

@status-im-auto
Copy link
Member

status-im-auto commented Feb 27, 2025

Jenkins Builds

Click to see older builds (46)
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ 0f22d58 #1 2025-02-27 14:06:40 ~3 min ios 📦zip
✔️ 0f22d58 #1 2025-02-27 14:06:40 ~3 min android 📦aar
✔️ 0f22d58 #1 2025-02-27 14:08:14 ~4 min macos 📦zip
✔️ 0f22d58 #1 2025-02-27 14:08:45 ~5 min macos 📦zip
✔️ 0f22d58 #1 2025-02-27 14:09:28 ~5 min windows 📦zip
✔️ 0f22d58 #1 2025-02-27 14:09:44 ~6 min linux 📦zip
✖️ 0f22d58 #1 2025-02-27 14:17:39 ~14 min tests-rpc 📄log
✖️ 0f22d58 #1 2025-02-27 14:36:06 ~32 min tests 📄log
✔️ f472a7a #2 2025-03-03 07:35:02 ~2 min android 📦aar
✔️ f472a7a #2 2025-03-03 07:35:12 ~3 min ios 📦zip
✔️ f472a7a #2 2025-03-03 07:36:44 ~4 min macos 📦zip
✔️ f472a7a #2 2025-03-03 07:36:52 ~4 min windows 📦zip
✔️ f472a7a #2 2025-03-03 07:37:24 ~5 min macos 📦zip
✔️ f472a7a #2 2025-03-03 07:38:16 ~6 min linux 📦zip
✖️ f472a7a #2 2025-03-03 07:45:29 ~13 min tests-rpc 📄log
✔️ f472a7a #2 2025-03-03 08:04:00 ~31 min tests 📄log
✔️ 4b44c2a #3 2025-03-03 10:11:24 ~3 min android 📦aar
✔️ 4b44c2a #3 2025-03-03 10:11:36 ~3 min ios 📦zip
✔️ 4b44c2a #3 2025-03-03 10:12:05 ~3 min macos 📦zip
✔️ 4b44c2a #3 2025-03-03 10:12:16 ~4 min windows 📦zip
✔️ 4b44c2a #3 2025-03-03 10:13:27 ~5 min macos 📦zip
✔️ 4b44c2a #3 2025-03-03 10:14:17 ~6 min linux 📦zip
✖️ 4b44c2a #3 2025-03-03 10:22:15 ~14 min tests-rpc 📄log
✔️ 4b44c2a #3 2025-03-03 10:37:46 ~29 min tests 📄log
✔️ 8c6cdad #4 2025-03-03 12:24:36 ~3 min android 📦aar
✔️ 8c6cdad #4 2025-03-03 12:25:24 ~3 min macos 📦zip
✔️ 8c6cdad #4 2025-03-03 12:25:42 ~4 min ios 📦zip
✔️ 8c6cdad #4 2025-03-03 12:25:51 ~4 min windows 📦zip
✔️ 8c6cdad #4 2025-03-03 12:27:27 ~5 min macos 📦zip
✔️ 8c6cdad #4 2025-03-03 12:28:54 ~7 min linux 📦zip
✖️ 8c6cdad #4 2025-03-03 12:33:37 ~12 min tests-rpc 📄log
✖️ 8c6cdad #4 2025-03-03 12:51:24 ~29 min tests 📄log
✔️ b282226 #5 2025-03-03 15:53:19 ~3 min android 📦aar
✔️ b282226 #5 2025-03-03 15:54:15 ~3 min ios 📦zip
✔️ b282226 #5 2025-03-03 15:54:42 ~4 min windows 📦zip
✔️ b282226 #5 2025-03-03 15:55:55 ~5 min linux 📦zip
✔️ b282226 #5 2025-03-03 15:55:56 ~5 min macos 📦zip
✔️ b282226 #5 2025-03-03 15:56:22 ~5 min macos 📦zip
✖️ b282226 #5 2025-03-03 16:12:52 ~22 min tests-rpc 📄log
✔️ b282226 #5 2025-03-03 16:22:43 ~32 min tests 📄log
b1509b8 #6 2025-03-03 15:55:46 ~2 min android 📄log
b1509b8 #6 2025-03-03 15:56:46 ~2 min ios 📄log
b1509b8 #6 2025-03-03 15:56:55 ~2 min windows 📄log
b1509b8 #6 2025-03-03 15:58:24 ~2 min macos 📄log
b1509b8 #6 2025-03-03 15:58:39 ~2 min linux 📄log
b1509b8 #6 2025-03-03 16:00:02 ~3 min macos 📄log
Commit #️⃣ Finished (UTC) Duration Platform Result
b053191 #7 2025-03-03 16:15:36 ~2 min ios 📄log
b053191 #7 2025-03-03 16:16:07 ~2 min linux 📄log
b053191 #7 2025-03-03 16:16:13 ~2 min android 📄log
b053191 #7 2025-03-03 16:16:15 ~2 min windows 📄log
b053191 #7 2025-03-03 16:16:16 ~2 min macos 📄log
b053191 #7 2025-03-03 16:17:59 ~4 min macos 📄log
✖️ b053191 #6 2025-03-03 16:26:18 ~3 min tests 📄log
✔️ bde82ae #8 2025-03-03 16:55:41 ~3 min ios 📦zip
✔️ bde82ae #8 2025-03-03 16:55:53 ~3 min android 📦aar
✔️ bde82ae #8 2025-03-03 16:57:00 ~4 min windows 📦zip
✔️ bde82ae #8 2025-03-03 16:57:20 ~4 min macos 📦zip
✔️ bde82ae #8 2025-03-03 16:57:56 ~5 min macos 📦zip
✔️ bde82ae #8 2025-03-03 16:57:59 ~5 min linux 📦zip
✔️ bde82ae #7 2025-03-03 17:10:37 ~17 min tests-rpc 📄log
✔️ bde82ae #7 2025-03-03 17:23:15 ~30 min tests 📄log

BalancesPerChain: balancesPerChain,
}
for symbol, tokens := range getTokenBySymbols(allTokens) {
balancesPerChain := r.createBalancePerChainPerSymbol(address, balances, tokens, cachedTokens, connectedPerChain, dayAgoTimestamp)
Copy link
Contributor

@dlipicar dlipicar Feb 27, 2025

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.

Copy link
Contributor

@dlipicar dlipicar Feb 27, 2025

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)

Copy link
Contributor

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

Copy link
Contributor Author

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?

Copy link
Contributor Author

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?

@saledjenic saledjenic requested review from a team as code owners March 3, 2025 07:15
@saledjenic saledjenic force-pushed the chore/remove-unused-fields-from-token branch from 0f22d58 to f472a7a Compare March 3, 2025 07:31
Copy link

codecov bot commented Mar 3, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 61.05%. Comparing base (d229265) to head (bde82ae).
Report is 2 commits behind head on feat/tokens-list.

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     
Flag Coverage Δ
functional 22.35% <99.26%> (+0.21%) ⬆️
unit 59.23% <100.00%> (-0.21%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
services/wallet/token/downloader/main.go 0.00% <ø> (ø)
services/wallet/token/token.go 51.70% <100.00%> (ø)
services/wallet/token/tokenstore.go 100.00% <100.00%> (ø)

... and 37 files with indirect coverage changes

@saledjenic saledjenic force-pushed the chore/remove-unused-fields-from-token branch from f472a7a to 4b44c2a Compare March 3, 2025 10:07
@saledjenic saledjenic force-pushed the chore/remove-unused-fields-from-token branch from 4b44c2a to 8c6cdad Compare March 3, 2025 12:21
@saledjenic saledjenic force-pushed the chore/remove-unused-fields-from-token branch 3 times, most recently from b1509b8 to b053191 Compare March 3, 2025 16:13
@saledjenic
Copy link
Contributor Author

I've just reverted the Verified field. Please have a look at the changes now. @ALL

…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.
@saledjenic saledjenic force-pushed the chore/remove-unused-fields-from-token branch from b053191 to bde82ae Compare March 3, 2025 16:52
Copy link
Contributor

@friofry friofry left a 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.

@saledjenic saledjenic merged commit 34177ce into feat/tokens-list Mar 5, 2025
15 checks passed
@saledjenic saledjenic deleted the chore/remove-unused-fields-from-token branch March 5, 2025 14:12
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.

5 participants