fix: Correct skip check statement (#4248)
This commit is contained in:
parent
b65eda3f42
commit
f57c6a26b5
|
@ -91,6 +91,7 @@ type Token struct {
|
||||||
MarketValuesPerCurrency map[string]TokenMarketValues `json:"marketValuesPerCurrency"`
|
MarketValuesPerCurrency map[string]TokenMarketValues `json:"marketValuesPerCurrency"`
|
||||||
PegSymbol string `json:"pegSymbol"`
|
PegSymbol string `json:"pegSymbol"`
|
||||||
Verified bool `json:"verified"`
|
Verified bool `json:"verified"`
|
||||||
|
CommunitID string `json:"communityId"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func splitVerifiedTokens(tokens []*token.Token) ([]*token.Token, []*token.Token) {
|
func splitVerifiedTokens(tokens []*token.Token) ([]*token.Token, []*token.Token) {
|
||||||
|
@ -255,6 +256,11 @@ func (r *Reader) GetWalletToken(ctx context.Context, addresses []common.Address)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var communityID string
|
||||||
|
if tokens[0].CommunityID != nil {
|
||||||
|
communityID = *tokens[0].CommunityID
|
||||||
|
}
|
||||||
|
|
||||||
walletToken := Token{
|
walletToken := Token{
|
||||||
Name: tokens[0].Name,
|
Name: tokens[0].Name,
|
||||||
Color: tokens[0].Color,
|
Color: tokens[0].Color,
|
||||||
|
@ -263,6 +269,7 @@ func (r *Reader) GetWalletToken(ctx context.Context, addresses []common.Address)
|
||||||
Decimals: decimals,
|
Decimals: decimals,
|
||||||
PegSymbol: token.GetTokenPegSymbol(symbol),
|
PegSymbol: token.GetTokenPegSymbol(symbol),
|
||||||
Verified: tokens[0].Verified,
|
Verified: tokens[0].Verified,
|
||||||
|
CommunitID: communityID,
|
||||||
}
|
}
|
||||||
|
|
||||||
tokenSymbols = append(tokenSymbols, symbol)
|
tokenSymbols = append(tokenSymbols, symbol)
|
||||||
|
|
|
@ -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) {
|
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.
|
// Token is invalid or is alrady discovered. Nothing to do here.
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue