Fix #297 CMC Coin ID

pull/282/head
Vuong 3 years ago
parent fdc9664842
commit 88b6ac0448
No known key found for this signature in database
GPG Key ID: 9E32EEF440B0A5D4

@ -1,7 +1,7 @@
package cointop package cointop
import ( import (
"errors" "fmt"
log "github.com/sirupsen/logrus" log "github.com/sirupsen/logrus"
) )
@ -108,8 +108,9 @@ func (ct *Cointop) UpdateCoin(coin *Coin) error {
k, found := ct.State.allCoinsSlugMap.Load(coin.Name) k, found := ct.State.allCoinsSlugMap.Load(coin.Name)
if !found { if !found {
log.Debugf("UpdateCoin() could not found coin %s in the slug map", coin.Name) err := fmt.Errorf("UpdateCoin() could not find coin %s in the slug map", coin.Name)
return errors.New("could not find coin index in allCoinsSlugMap") log.Debug(err.Error())
return err
} }
coin = &Coin{ coin = &Coin{

@ -77,8 +77,7 @@ func (s *Service) getPaginatedCoinData(convert string, offset int) ([]apitypes.C
} }
ret = append(ret, apitypes.Coin{ ret = append(ret, apitypes.Coin{
// TODO: Fix ID ID: util.FormatID(fmt.Sprint(v.ID)),
ID: util.FormatID(v.Name),
Name: util.FormatName(v.Name), Name: util.FormatName(v.Name),
Symbol: util.FormatSymbol(v.Symbol), Symbol: util.FormatSymbol(v.Symbol),
Rank: util.FormatRank(v.CMCRank), Rank: util.FormatRank(v.CMCRank),

Loading…
Cancel
Save