@@ -21,14 +21,12 @@ import (
2121)
2222
2323const (
24- keywordContractName string = "contractName"
25- keywordENS string = "ensDomain"
26- keywordOSSlug string = "osslug"
27- keywordBlurSlug string = "blurslug"
28- keywordSalira string = "salira"
29- keywordNotificationsLock string = "notification"
30- keyDelimiter string = ":"
31- // keywordFloorPrice string = "floor"
24+ keywordContractName string = "contractName"
25+ keywordENS string = "ensDomain"
26+ keywordOSSlug string = "osslug"
27+ keywordBlurSlug string = "blurslug"
28+ keywordSalira string = "salira"
29+ keyDelimiter string = ":"
3230)
3331
3432type Rueidica struct {
@@ -103,11 +101,12 @@ func (r *Rueidica) getCachedName(ctx context.Context, address common.Address, ke
103101 if r != nil {
104102 cachedName , err := r .DoCache (ctx , r .B ().Get ().Key (keyFunc (address )).Cache (), clientCacheTTL ).ToString ()
105103
106- if err != nil && rueidis .IsRedisNil (err ) {
104+ switch {
105+ case err != nil && rueidis .IsRedisNil (err ):
107106 gbl .Log .Debugf ("rueidis | no name in cache for %s" , address .Hex ())
108- } else if err != nil {
107+ case err != nil :
109108 gbl .Log .Errorf ("rueidis | error getting cached name: %s" , err )
110- } else {
109+ default :
111110 gbl .Log .Debugf ("rueidis | found name: %s -> %s" , keyFunc (address ), cachedName )
112111 }
113112
@@ -123,13 +122,14 @@ func (r *Rueidica) getCachedNumber(ctx context.Context, address common.Address,
123122 if r != nil {
124123 cachedNumber , err := r .DoCache (ctx , r .B ().Get ().Key (keyFunc (address )).Cache (), clientCacheTTL ).ToString ()
125124
126- if err != nil && rueidis .IsRedisNil (err ) {
125+ switch {
126+ case err != nil && rueidis .IsRedisNil (err ):
127127 gbl .Log .Debugf ("rueidis | no number in cache for %s" , address .Hex ())
128128
129129 return 0 , err
130- } else if err != nil {
130+ case err != nil :
131131 gbl .Log .Errorf ("rueidis | error getting cached number: %s" , err )
132- } else {
132+ default :
133133 gbl .Log .Debugf ("rueidis | found number: %s -> %f" , keyFunc (address ), cachedNumber )
134134 }
135135
@@ -274,10 +274,6 @@ func keyENS(address common.Address) string {
274274 return fmt .Sprint (address .Hex (), keyDelimiter , keywordENS )
275275}
276276
277- func keyNotificationsLock (txID common.Hash ) string {
278- return fmt .Sprint (txID .Hex (), keyDelimiter , keywordNotificationsLock )
279- }
280-
281277func keyOSSlug (address common.Address ) string {
282278 return fmt .Sprint (address .Hex (), keyDelimiter , keywordOSSlug )
283279}
@@ -289,7 +285,3 @@ func keyBlurSlug(address common.Address) string {
289285func keySalira (address common.Address ) string {
290286 return fmt .Sprint (address .Hex (), keyDelimiter , keywordSalira )
291287}
292-
293- // func KeyFloorPrice(address common.Address) string {
294- // return fmt.Sprint(address.Hex(), keyDelimiter, keywordFloorPrice)
295- // }
0 commit comments