Unverified Commit d322c9d5 authored by Anton Evangelatov's avatar Anton Evangelatov Committed by GitHub

swarm/storage/feed: remove unused code (#18324)

parent 3ad73443
...@@ -23,7 +23,6 @@ import ( ...@@ -23,7 +23,6 @@ import (
"context" "context"
"fmt" "fmt"
"sync" "sync"
"time"
"github.com/ethereum/go-ethereum/swarm/storage/feed/lookup" "github.com/ethereum/go-ethereum/swarm/storage/feed/lookup"
...@@ -36,8 +35,6 @@ type Handler struct { ...@@ -36,8 +35,6 @@ type Handler struct {
HashSize int HashSize int
cache map[uint64]*cacheEntry cache map[uint64]*cacheEntry
cacheLock sync.RWMutex cacheLock sync.RWMutex
storeTimeout time.Duration
queryMaxPeriods uint32
} }
// HandlerParams pass parameters to the Handler constructor NewHandler // HandlerParams pass parameters to the Handler constructor NewHandler
......
...@@ -40,7 +40,6 @@ var ( ...@@ -40,7 +40,6 @@ var (
} }
cleanF func() cleanF func()
subtopicName = "føø.bar" subtopicName = "føø.bar"
hashfunc = storage.MakeHashFunc(storage.DefaultHash)
) )
func init() { func init() {
......
...@@ -17,7 +17,6 @@ ...@@ -17,7 +17,6 @@
package feed package feed
import ( import (
"encoding/binary"
"encoding/json" "encoding/json"
"time" "time"
) )
...@@ -30,32 +29,11 @@ type Timestamp struct { ...@@ -30,32 +29,11 @@ type Timestamp struct {
Time uint64 `json:"time"` // Unix epoch timestamp, in seconds Time uint64 `json:"time"` // Unix epoch timestamp, in seconds
} }
// 8 bytes uint64 Time
const timestampLength = 8
// timestampProvider interface describes a source of timestamp information // timestampProvider interface describes a source of timestamp information
type timestampProvider interface { type timestampProvider interface {
Now() Timestamp // returns the current timestamp information Now() Timestamp // returns the current timestamp information
} }
// binaryGet populates the timestamp structure from the given byte slice
func (t *Timestamp) binaryGet(data []byte) error {
if len(data) != timestampLength {
return NewError(ErrCorruptData, "timestamp data has the wrong size")
}
t.Time = binary.LittleEndian.Uint64(data[:8])
return nil
}
// binaryPut Serializes a Timestamp to a byte slice
func (t *Timestamp) binaryPut(data []byte) error {
if len(data) != timestampLength {
return NewError(ErrCorruptData, "timestamp data has the wrong size")
}
binary.LittleEndian.PutUint64(data, t.Time)
return nil
}
// UnmarshalJSON implements the json.Unmarshaller interface // UnmarshalJSON implements the json.Unmarshaller interface
func (t *Timestamp) UnmarshalJSON(data []byte) error { func (t *Timestamp) UnmarshalJSON(data []byte) error {
return json.Unmarshal(data, &t.Time) return json.Unmarshal(data, &t.Time)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment