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
7910dd51
Unverified
Commit
7910dd51
authored
Sep 28, 2018
by
Viktor Trón
Committed by
GitHub
Sep 28, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #17781 from ethersphere/trim_newline
cmd/swarm: trim new lines from files
parents
dcaabfe7
0ee44e79
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
7 additions
and
9 deletions
+7
-9
access.go
cmd/swarm/access.go
+2
-2
epoch_test.go
swarm/storage/mru/lookup/epoch_test.go
+3
-3
lookup_test.go
swarm/storage/mru/lookup/lookup_test.go
+1
-3
query.go
swarm/storage/mru/query.go
+1
-1
No files found.
cmd/swarm/access.go
View file @
7910dd51
...
...
@@ -130,7 +130,7 @@ func accessNewACT(ctx *cli.Context) {
if
err
!=
nil
{
utils
.
Fatalf
(
"had an error reading the grantee public key list"
)
}
pkGrantees
=
strings
.
Split
(
string
(
bytes
),
"
\n
"
)
pkGrantees
=
strings
.
Split
(
string
s
.
Trim
(
string
(
bytes
),
"
\n
"
),
"
\n
"
)
}
if
passGranteesFilename
!=
""
{
...
...
@@ -138,7 +138,7 @@ func accessNewACT(ctx *cli.Context) {
if
err
!=
nil
{
utils
.
Fatalf
(
"could not read password filename: %v"
,
err
)
}
passGrantees
=
strings
.
Split
(
string
(
bytes
),
"
\n
"
)
passGrantees
=
strings
.
Split
(
string
s
.
Trim
(
string
(
bytes
),
"
\n
"
),
"
\n
"
)
}
accessKey
,
ae
,
actManifest
,
err
=
api
.
DoACT
(
ctx
,
privateKey
,
salt
,
pkGrantees
,
passGrantees
)
if
err
!=
nil
{
...
...
swarm/storage/mru/lookup/epoch_test.go
View file @
7910dd51
...
...
@@ -42,15 +42,15 @@ func TestAfter(t *testing.T) {
Level
:
4
,
}
if
b
.
After
(
a
)
!=
true
{
if
!
b
.
After
(
a
)
{
t
.
Fatal
(
"Expected 'after' to be true, got false"
)
}
if
b
.
After
(
b
)
!=
false
{
if
b
.
After
(
b
)
{
t
.
Fatal
(
"Expected 'after' to be false when both epochs are identical, got true"
)
}
if
b
.
After
(
c
)
!=
true
{
if
!
b
.
After
(
c
)
{
t
.
Fatal
(
"Expected 'after' to be true when both epochs have the same time but the level is lower in the first one, but got false"
)
}
...
...
swarm/storage/mru/lookup/lookup_test.go
View file @
7910dd51
...
...
@@ -38,9 +38,7 @@ func write(store Store, epoch lookup.Epoch, value *Data) {
}
func
update
(
store
Store
,
last
lookup
.
Epoch
,
now
uint64
,
value
*
Data
)
lookup
.
Epoch
{
var
epoch
lookup
.
Epoch
epoch
=
lookup
.
GetNextEpoch
(
last
,
now
)
epoch
:=
lookup
.
GetNextEpoch
(
last
,
now
)
write
(
store
,
epoch
,
value
)
...
...
swarm/storage/mru/query.go
View file @
7910dd51
...
...
@@ -36,7 +36,7 @@ type Query struct {
// useful to parse query strings
func
(
q
*
Query
)
FromValues
(
values
Values
)
error
{
time
,
_
:=
strconv
.
ParseUint
(
values
.
Get
(
"time"
),
10
,
64
)
q
.
TimeLimit
=
uint64
(
time
)
q
.
TimeLimit
=
time
level
,
_
:=
strconv
.
ParseUint
(
values
.
Get
(
"hint.level"
),
10
,
32
)
q
.
Hint
.
Level
=
uint8
(
level
)
...
...
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