File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -23,7 +23,6 @@ import (
2323 "context"
2424 "fmt"
2525 "sync"
26- "time"
2726
2827 "github.com/ethereum/go-ethereum/swarm/storage/feed/lookup"
2928
@@ -32,12 +31,10 @@ import (
3231)
3332
3433type Handler struct {
35- chunkStore * storage.NetStore
36- HashSize int
37- cache map [uint64 ]* cacheEntry
38- cacheLock sync.RWMutex
39- storeTimeout time.Duration
40- queryMaxPeriods uint32
34+ chunkStore * storage.NetStore
35+ HashSize int
36+ cache map [uint64 ]* cacheEntry
37+ cacheLock sync.RWMutex
4138}
4239
4340// HandlerParams pass parameters to the Handler constructor NewHandler
Original file line number Diff line number Diff line change 4040 }
4141 cleanF func ()
4242 subtopicName = "føø.bar"
43- hashfunc = storage .MakeHashFunc (storage .DefaultHash )
4443)
4544
4645func init () {
Original file line number Diff line number Diff line change 1717package feed
1818
1919import (
20- "encoding/binary"
2120 "encoding/json"
2221 "time"
2322)
@@ -30,32 +29,11 @@ type Timestamp struct {
3029 Time uint64 `json:"time"` // Unix epoch timestamp, in seconds
3130}
3231
33- // 8 bytes uint64 Time
34- const timestampLength = 8
35-
3632// timestampProvider interface describes a source of timestamp information
3733type timestampProvider interface {
3834 Now () Timestamp // returns the current timestamp information
3935}
4036
41- // binaryGet populates the timestamp structure from the given byte slice
42- func (t * Timestamp ) binaryGet (data []byte ) error {
43- if len (data ) != timestampLength {
44- return NewError (ErrCorruptData , "timestamp data has the wrong size" )
45- }
46- t .Time = binary .LittleEndian .Uint64 (data [:8 ])
47- return nil
48- }
49-
50- // binaryPut Serializes a Timestamp to a byte slice
51- func (t * Timestamp ) binaryPut (data []byte ) error {
52- if len (data ) != timestampLength {
53- return NewError (ErrCorruptData , "timestamp data has the wrong size" )
54- }
55- binary .LittleEndian .PutUint64 (data , t .Time )
56- return nil
57- }
58-
5937// UnmarshalJSON implements the json.Unmarshaller interface
6038func (t * Timestamp ) UnmarshalJSON (data []byte ) error {
6139 return json .Unmarshal (data , & t .Time )
You can’t perform that action at this time.
0 commit comments