fix: lint error

This commit is contained in:
fearlseefe 2024-11-20 18:08:12 +08:00 committed by Chen Kai
parent cb91f65056
commit ad2fd55e7a
2 changed files with 13 additions and 13 deletions

View file

@ -42,7 +42,7 @@ func NewPeppleStorage(config PeppleStorageConfig) (storage.ContentStorage, error
log: log.New("storage", config.NetworkName), log: log.New("storage", config.NetworkName),
} }
cs.radius.Store(storage.MaxDistance) cs.radius.Store(storage.MaxDistance)
exist, err := cs.db.Has(storage.RadisuKey); exist, err := cs.db.Has(storage.RadisuKey)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -72,8 +72,8 @@ func (c *ContentStorage) Put(contentKey []byte, contentId []byte, content []byte
} }
// Radius implements storage.ContentStorage. // Radius implements storage.ContentStorage.
func (p *ContentStorage) Radius() *uint256.Int { func (c *ContentStorage) Radius() *uint256.Int {
radius := p.radius.Load() radius := c.radius.Load()
val := radius.(*uint256.Int) val := radius.(*uint256.Int)
return val return val
} }

View file

@ -11,6 +11,7 @@ import (
) )
const dataDir = "./node1" const dataDir = "./node1"
var testRadius = uint256.NewInt(100000) var testRadius = uint256.NewInt(100000)
func clearNodeData() { func clearNodeData() {
@ -70,5 +71,4 @@ func TestStorage(t *testing.T) {
assert.NoError(t, err) assert.NoError(t, err)
assert.Equal(t, value, val) assert.Equal(t, value, val)
} }
} }