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
696bc9b0
Commit
696bc9b0
authored
Oct 02, 2018
by
Javier Peletier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
swarm/storage/feeds: renamed vars that can conflict with package name
parent
58c0879c
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
19 additions
and
19 deletions
+19
-19
feeds_test.go
cmd/swarm/feeds_test.go
+4
-4
client_test.go
swarm/api/client/client_test.go
+2
-2
handler_test.go
swarm/storage/feeds/handler_test.go
+11
-11
request_test.go
swarm/storage/feeds/request_test.go
+2
-2
No files found.
cmd/swarm/feeds_test.go
View file @
696bc9b0
...
...
@@ -101,13 +101,13 @@ func TestCLIFeedUpdate(t *testing.T) {
}
// Feed configures whose updates we will be looking up.
f
ee
d
:=
feeds
.
Feed
{
fd
:=
feeds
.
Feed
{
Topic
:
topic
,
User
:
address
,
}
// Build a query to get the latest update
query
:=
feeds
.
NewQueryLatest
(
&
f
ee
d
,
lookup
.
NoClue
)
query
:=
feeds
.
NewQueryLatest
(
&
fd
,
lookup
.
NoClue
)
// retrieve content!
reader
,
err
:=
client
.
QueryFeed
(
query
,
""
)
...
...
@@ -146,8 +146,8 @@ func TestCLIFeedUpdate(t *testing.T) {
}
// make sure the retrieved feed is the same
if
request
.
Feed
!=
f
ee
d
{
t
.
Fatalf
(
"Expected feed to be: %s, got %s"
,
f
ee
d
,
request
.
Feed
)
if
request
.
Feed
!=
fd
{
t
.
Fatalf
(
"Expected feed to be: %s, got %s"
,
fd
,
request
.
Feed
)
}
// test publishing a manifest
...
...
swarm/api/client/client_test.go
View file @
696bc9b0
...
...
@@ -508,12 +508,12 @@ func TestClientCreateUpdateFeed(t *testing.T) {
// now try retrieving feed updates without a manifest
f
ee
d
:=
&
feeds
.
Feed
{
fd
:=
&
feeds
.
Feed
{
Topic
:
topic
,
User
:
signer
.
Address
(),
}
lookupParams
:=
feeds
.
NewQueryLatest
(
f
ee
d
,
lookup
.
NoClue
)
lookupParams
:=
feeds
.
NewQueryLatest
(
fd
,
lookup
.
NoClue
)
reader
,
err
=
client
.
QueryFeed
(
lookupParams
,
""
)
if
err
!=
nil
{
t
.
Fatalf
(
"Error retrieving feed updates: %s"
,
err
)
...
...
swarm/storage/feeds/handler_test.go
View file @
696bc9b0
...
...
@@ -94,7 +94,7 @@ func TestFeedsHandler(t *testing.T) {
defer
cancel
()
topic
,
_
:=
NewTopic
(
"Mess with Swarm feeds code and see what ghost catches you"
,
nil
)
f
ee
d
:=
Feed
{
fd
:=
Feed
{
Topic
:
topic
,
User
:
signer
.
Address
(),
}
...
...
@@ -107,7 +107,7 @@ func TestFeedsHandler(t *testing.T) {
"clyde"
,
// t=4285
}
request
:=
NewFirstRequest
(
f
ee
d
.
Topic
)
// this timestamps the update at t = 4200 (start time)
request
:=
NewFirstRequest
(
fd
.
Topic
)
// this timestamps the update at t = 4200 (start time)
chunkAddress
:=
make
(
map
[
string
]
storage
.
Address
)
data
:=
[]
byte
(
updates
[
0
])
request
.
SetData
(
data
)
...
...
@@ -270,7 +270,7 @@ func TestSparseUpdates(t *testing.T) {
ctx
,
cancel
:=
context
.
WithCancel
(
context
.
Background
())
defer
cancel
()
topic
,
_
:=
NewTopic
(
"Very slow updates"
,
nil
)
f
ee
d
:=
Feed
{
fd
:=
Feed
{
Topic
:
topic
,
User
:
signer
.
Address
(),
}
...
...
@@ -280,7 +280,7 @@ func TestSparseUpdates(t *testing.T) {
var
epoch
lookup
.
Epoch
var
lastUpdateTime
uint64
for
T
:=
uint64
(
0
);
T
<
today
;
T
+=
5
*
Year
{
request
:=
NewFirstRequest
(
f
ee
d
.
Topic
)
request
:=
NewFirstRequest
(
fd
.
Topic
)
request
.
Epoch
=
lookup
.
GetNextEpoch
(
epoch
,
T
)
request
.
data
=
generateData
(
T
)
// this generates some data that depends on T, so we can check later
request
.
Sign
(
signer
)
...
...
@@ -295,14 +295,14 @@ func TestSparseUpdates(t *testing.T) {
lastUpdateTime
=
T
}
query
:=
NewQuery
(
&
f
ee
d
,
today
,
lookup
.
NoClue
)
query
:=
NewQuery
(
&
fd
,
today
,
lookup
.
NoClue
)
_
,
err
=
rh
.
Lookup
(
ctx
,
query
)
if
err
!=
nil
{
t
.
Fatal
(
err
)
}
_
,
content
,
err
:=
rh
.
GetContent
(
&
f
ee
d
)
_
,
content
,
err
:=
rh
.
GetContent
(
&
fd
)
if
err
!=
nil
{
t
.
Fatal
(
err
)
}
...
...
@@ -321,7 +321,7 @@ func TestSparseUpdates(t *testing.T) {
t
.
Fatal
(
err
)
}
_
,
content
,
err
=
rh
.
GetContent
(
&
f
ee
d
)
_
,
content
,
err
=
rh
.
GetContent
(
&
fd
)
if
err
!=
nil
{
t
.
Fatal
(
err
)
}
...
...
@@ -350,11 +350,11 @@ func TestValidator(t *testing.T) {
// create new feed
topic
,
_
:=
NewTopic
(
subtopicName
,
nil
)
f
ee
d
:=
Feed
{
fd
:=
Feed
{
Topic
:
topic
,
User
:
signer
.
Address
(),
}
mr
:=
NewFirstRequest
(
f
ee
d
.
Topic
)
mr
:=
NewFirstRequest
(
fd
.
Topic
)
// chunk with address
data
:=
[]
byte
(
"foo"
)
...
...
@@ -420,7 +420,7 @@ func TestValidatorInStore(t *testing.T) {
badChunk
:=
storage
.
NewChunk
(
chunks
[
1
]
.
Address
(),
goodChunk
.
Data
())
topic
,
_
:=
NewTopic
(
"xyzzy"
,
nil
)
f
ee
d
:=
Feed
{
fd
:=
Feed
{
Topic
:
topic
,
User
:
signer
.
Address
(),
}
...
...
@@ -430,7 +430,7 @@ func TestValidatorInStore(t *testing.T) {
Epoch
:
lookup
.
Epoch
{
Time
:
42
,
Level
:
1
,
},
Feed
:
f
ee
d
,
Feed
:
fd
,
}
updateAddr
:=
id
.
Addr
()
...
...
swarm/storage/feeds/request_test.go
View file @
696bc9b0
...
...
@@ -256,7 +256,7 @@ func TestReverse(t *testing.T) {
defer
teardownTest
()
topic
,
_
:=
NewTopic
(
"Cervantes quotes"
,
nil
)
f
ee
d
:=
Feed
{
fd
:=
Feed
{
Topic
:
topic
,
User
:
signer
.
Address
(),
}
...
...
@@ -264,7 +264,7 @@ func TestReverse(t *testing.T) {
data
:=
[]
byte
(
"Donde una puerta se cierra, otra se abre"
)
request
:=
new
(
Request
)
request
.
Feed
=
f
ee
d
request
.
Feed
=
fd
request
.
Epoch
=
epoch
request
.
data
=
data
...
...
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