fix: Correct skip check statement (#4248)

This commit is contained in:
Cuteivist 2023-11-02 09:11:48 +01:00 committed by GitHub
parent b65eda3f42
commit f57c6a26b5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 1 deletions

View File

@ -91,6 +91,7 @@ type Token struct {
MarketValuesPerCurrency map[string]TokenMarketValues `json:"marketValuesPerCurrency"`
PegSymbol string `json:"pegSymbol"`
Verified bool `json:"verified"`
CommunitID string `json:"communityId"`
}
func splitVerifiedTokens(tokens []*token.Token) ([]*token.Token, []*token.Token) {
@ -255,6 +256,11 @@ func (r *Reader) GetWalletToken(ctx context.Context, addresses []common.Address)
continue
}
var communityID string
if tokens[0].CommunityID != nil {
communityID = *tokens[0].CommunityID
}
walletToken := Token{
Name: tokens[0].Name,
Color: tokens[0].Color,
@ -263,6 +269,7 @@ func (r *Reader) GetWalletToken(ctx context.Context, addresses []common.Address)
Decimals: decimals,
PegSymbol: token.GetTokenPegSymbol(symbol),
Verified: tokens[0].Verified,
CommunitID: communityID,
}
tokenSymbols = append(tokenSymbols, symbol)

View File

@ -299,7 +299,7 @@ func (tm *Manager) FindOrCreateTokenByAddress(ctx context.Context, chainID uint6
}
func (tm *Manager) discoverTokenCommunityID(ctx context.Context, token *Token, address common.Address) {
if token != nil && token.CommunityID == nil {
if token == nil || token.CommunityID != nil {
// Token is invalid or is alrady discovered. Nothing to do here.
return
}