Skip to content

Commit

Permalink
fix: checksum causing map issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Majorfi committed Jan 3, 2024
1 parent 5f2ca94 commit 7f7e94a
Show file tree
Hide file tree
Showing 24 changed files with 103,100 additions and 5,899 deletions.
2 changes: 1 addition & 1 deletion generators/buildTokenList.1inch.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func fetch1InchTokenList() []TokenListToken {
tokensInfo := retrieveBasicInformations(chainID, allTokens)

for _, existingToken := range list.Tokens {
if token, ok := tokensInfo[existingToken.Address]; ok {
if token, ok := tokensInfo[common.HexToAddress(existingToken.Address).Hex()]; ok {
if newToken, err := SetToken(
token.Address,
helpers.SafeString(token.Name, existingToken.Name),
Expand Down
6 changes: 3 additions & 3 deletions generators/buildTokenList.bebop.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,11 @@ func fetchbebopTokenList() []TokenListToken {
continue
}
logoURI := ``
if tokenFromList, ok := tokenMap[existingToken.Address]; ok {
if tokenFromList, ok := tokenMap[common.HexToAddress(existingToken.Address).Hex()]; ok {
logoURI = tokenFromList.LogoURI
}

if token, ok := tokensInfo[existingToken.Address]; ok {
if token, ok := tokensInfo[common.HexToAddress(existingToken.Address).Hex()]; ok {
if newToken, err := SetToken(
token.Address,
helpers.SafeString(token.Name, existingToken.Name),
Expand All @@ -105,7 +105,7 @@ func fetchbebopTokenList() []TokenListToken {
chainID,
int(token.Decimals),
); err == nil {
if tokenFromList, ok := tokenMap[existingToken.Address]; ok {
if tokenFromList, ok := tokenMap[common.HexToAddress(existingToken.Address).Hex()]; ok {
newToken.Metadata = map[string]any{
`tags`: tokenFromList.Tags,
`color`: tokenFromList.Extensions.Color,
Expand Down
2 changes: 1 addition & 1 deletion generators/buildTokenList.paraswap.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ func fetchParaswapTokenList() []TokenListToken {
tokensInfo := retrieveBasicInformations(chainID, tokenAddresses)

for _, existingToken := range list.Tokens {
if token, ok := tokensInfo[existingToken.Address]; ok {
if token, ok := tokensInfo[common.HexToAddress(existingToken.Address).Hex()]; ok {
logoURI := existingToken.LogoURI
if logoURI == `https://cdn.paraswap.io/token/token.png` {
logoURI = ``
Expand Down
Loading

0 comments on commit 7f7e94a

Please sign in to comment.