Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
Geth-Modification
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张蕾
Geth-Modification
Commits
d322c9d5
Unverified
Commit
d322c9d5
authored
Dec 17, 2018
by
Anton Evangelatov
Committed by
GitHub
Dec 17, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
swarm/storage/feed: remove unused code (#18324)
parent
3ad73443
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
30 deletions
+4
-30
handler.go
swarm/storage/feed/handler.go
+4
-7
handler_test.go
swarm/storage/feed/handler_test.go
+0
-1
timestampprovider.go
swarm/storage/feed/timestampprovider.go
+0
-22
No files found.
swarm/storage/feed/handler.go
View file @
d322c9d5
...
...
@@ -23,7 +23,6 @@ import (
"context"
"fmt"
"sync"
"time"
"github.com/ethereum/go-ethereum/swarm/storage/feed/lookup"
...
...
@@ -36,8 +35,6 @@ type Handler struct {
HashSize
int
cache
map
[
uint64
]
*
cacheEntry
cacheLock
sync
.
RWMutex
storeTimeout
time
.
Duration
queryMaxPeriods
uint32
}
// HandlerParams pass parameters to the Handler constructor NewHandler
...
...
swarm/storage/feed/handler_test.go
View file @
d322c9d5
...
...
@@ -40,7 +40,6 @@ var (
}
cleanF
func
()
subtopicName
=
"føø.bar"
hashfunc
=
storage
.
MakeHashFunc
(
storage
.
DefaultHash
)
)
func
init
()
{
...
...
swarm/storage/feed/timestampprovider.go
View file @
d322c9d5
...
...
@@ -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
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment