Skip to content

Commit d322c9d

Browse files
authored
swarm/storage/feed: remove unused code (#18324)
1 parent 3ad7344 commit d322c9d

3 files changed

Lines changed: 4 additions & 30 deletions

File tree

‎swarm/storage/feed/handler.go‎

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff 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

3433
type 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

‎swarm/storage/feed/handler_test.go‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ var (
4040
}
4141
cleanF func()
4242
subtopicName = "føø.bar"
43-
hashfunc = storage.MakeHashFunc(storage.DefaultHash)
4443
)
4544

4645
func init() {

‎swarm/storage/feed/timestampprovider.go‎

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
package feed
1818

1919
import (
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
3733
type 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
6038
func (t *Timestamp) UnmarshalJSON(data []byte) error {
6139
return json.Unmarshal(data, &t.Time)

0 commit comments

Comments
 (0)