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
702f52fb
Commit
702f52fb
authored
Jun 27, 2019
by
Matthew Halpern
Committed by
Péter Szilágyi
Jun 27, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
les: prefer nil slices over zero-length slices (#19081)
parent
6069b1a5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
+6
-4
handler_test.go
les/handler_test.go
+6
-4
No files found.
les/handler_test.go
View file @
702f52fb
...
...
@@ -159,7 +159,7 @@ func testGetBlockHeaders(t *testing.T, protocol int) {
var
reqID
uint64
for
i
,
tt
:=
range
tests
{
// Collect the headers to expect in the response
headers
:=
[]
*
types
.
Header
{}
var
headers
[]
*
types
.
Header
for
_
,
hash
:=
range
tt
.
expect
{
headers
=
append
(
headers
,
bc
.
GetHeaderByHash
(
hash
))
}
...
...
@@ -212,8 +212,9 @@ func testGetBlockBodies(t *testing.T, protocol int) {
var
reqID
uint64
for
i
,
tt
:=
range
tests
{
// Collect the hashes to request, and the response to expect
hashes
,
seen
:=
[]
common
.
Hash
{},
make
(
map
[
int64
]
bool
)
bodies
:=
[]
*
types
.
Body
{}
var
hashes
[]
common
.
Hash
seen
:=
make
(
map
[
int64
]
bool
)
var
bodies
[]
*
types
.
Body
for
j
:=
0
;
j
<
tt
.
random
;
j
++
{
for
{
...
...
@@ -313,7 +314,8 @@ func testGetReceipt(t *testing.T, protocol int) {
bc
:=
server
.
pm
.
blockchain
.
(
*
core
.
BlockChain
)
// Collect the hashes to request, and the response to expect
hashes
,
receipts
:=
[]
common
.
Hash
{},
[]
types
.
Receipts
{}
var
receipts
[]
types
.
Receipts
var
hashes
[]
common
.
Hash
for
i
:=
uint64
(
0
);
i
<=
bc
.
CurrentBlock
()
.
NumberU64
();
i
++
{
block
:=
bc
.
GetBlockByNumber
(
i
)
...
...
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