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

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

Loading…
Cancel
Save