aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnton Evangelatov <anton.evangelatov@gmail.com>2018-12-17 18:32:55 +0800
committerGitHub <noreply@github.com>2018-12-17 18:32:55 +0800
commitd322c9d5504ad3fd4dfeb9dff29e92b35856042f (patch)
treebcfa44a0e72d249f58daa8cd22a1593da758ae98
parent3ad73443c7a96c928577234df5c742d53f3293ef (diff)
downloadgo-tangerine-d322c9d5504ad3fd4dfeb9dff29e92b35856042f.tar.gz
go-tangerine-d322c9d5504ad3fd4dfeb9dff29e92b35856042f.tar.zst
go-tangerine-d322c9d5504ad3fd4dfeb9dff29e92b35856042f.zip
swarm/storage/feed: remove unused code (#18324)
-rw-r--r--swarm/storage/feed/handler.go11
-rw-r--r--swarm/storage/feed/handler_test.go1
-rw-r--r--swarm/storage/feed/timestampprovider.go22
3 files changed, 4 insertions, 30 deletions
diff --git a/swarm/storage/feed/handler.go b/swarm/storage/feed/handler.go
index 33542b6e4..063d3e92a 100644
--- a/swarm/storage/feed/handler.go
+++ b/swarm/storage/feed/handler.go
@@ -23,7 +23,6 @@ import (
"context"
"fmt"
"sync"
- "time"
"github.com/ethereum/go-ethereum/swarm/storage/feed/lookup"
@@ -32,12 +31,10 @@ import (
)
type Handler struct {
- chunkStore *storage.NetStore
- HashSize int
- cache map[uint64]*cacheEntry
- cacheLock sync.RWMutex
- storeTimeout time.Duration
- queryMaxPeriods uint32
+ chunkStore *storage.NetStore
+ HashSize int
+ cache map[uint64]*cacheEntry
+ cacheLock sync.RWMutex
}
// HandlerParams pass parameters to the Handler constructor NewHandler
diff --git a/swarm/storage/feed/handler_test.go b/swarm/storage/feed/handler_test.go
index 9c39215c5..2f8a52453 100644
--- a/swarm/storage/feed/handler_test.go
+++ b/swarm/storage/feed/handler_test.go
@@ -40,7 +40,6 @@ var (
}
cleanF func()
subtopicName = "føø.bar"
- hashfunc = storage.MakeHashFunc(storage.DefaultHash)
)
func init() {
diff --git a/swarm/storage/feed/timestampprovider.go b/swarm/storage/feed/timestampprovider.go
index 072dc3a48..fb60cea9c 100644
--- a/swarm/storage/feed/timestampprovider.go
+++ b/swarm/storage/feed/timestampprovider.go
@@ -17,7 +17,6 @@
package feed
import (
- "encoding/binary"
"encoding/json"
"time"
)
@@ -30,32 +29,11 @@ type Timestamp struct {
Time uint64 `json:"time"` // Unix epoch timestamp, in seconds
}
-// 8 bytes uint64 Time
-const timestampLength = 8
-
// timestampProvider interface describes a source of timestamp information
type timestampProvider interface {
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
func (t *Timestamp) UnmarshalJSON(data []byte) error {
return json.Unmarshal(data, &t.Time)