Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

swarm/storage/feed: remove unused code #18324

Merged
merged 1 commit into from
Dec 17, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 4 additions & 7 deletions swarm/storage/feed/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import (
"context"
"fmt"
"sync"
"time"

"github.com/ethereum/go-ethereum/swarm/storage/feed/lookup"

Expand All @@ -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
Expand Down
1 change: 0 additions & 1 deletion swarm/storage/feed/handler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ var (
}
cleanF func()
subtopicName = "føø.bar"
hashfunc = storage.MakeHashFunc(storage.DefaultHash)
)

func init() {
Expand Down
22 changes: 0 additions & 22 deletions swarm/storage/feed/timestampprovider.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
package feed

import (
"encoding/binary"
"encoding/json"
"time"
)
Expand All @@ -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)
Expand Down