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
c9300458
Commit
c9300458
authored
Apr 29, 2015
by
obscuren
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
core: fixed tetst to reflect (int, error) return by insertChain
parent
dfbf5803
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
chain_manager_test.go
core/chain_manager_test.go
+2
-2
downloader_test.go
eth/downloader/downloader_test.go
+2
-2
No files found.
core/chain_manager_test.go
View file @
c9300458
...
@@ -44,7 +44,7 @@ func testFork(t *testing.T, bman *BlockProcessor, i, N int, f func(td1, td2 *big
...
@@ -44,7 +44,7 @@ func testFork(t *testing.T, bman *BlockProcessor, i, N int, f func(td1, td2 *big
// extend the fork
// extend the fork
parent
:=
bman2
.
bc
.
CurrentBlock
()
parent
:=
bman2
.
bc
.
CurrentBlock
()
chainB
:=
makeChain
(
bman2
,
parent
,
N
,
db
,
ForkSeed
)
chainB
:=
makeChain
(
bman2
,
parent
,
N
,
db
,
ForkSeed
)
err
=
bman2
.
bc
.
InsertChain
(
chainB
)
_
,
err
=
bman2
.
bc
.
InsertChain
(
chainB
)
if
err
!=
nil
{
if
err
!=
nil
{
t
.
Fatal
(
"Insert chain error for fork:"
,
err
)
t
.
Fatal
(
"Insert chain error for fork:"
,
err
)
}
}
...
@@ -108,7 +108,7 @@ func loadChain(fn string, t *testing.T) (types.Blocks, error) {
...
@@ -108,7 +108,7 @@ func loadChain(fn string, t *testing.T) (types.Blocks, error) {
}
}
func
insertChain
(
done
chan
bool
,
chainMan
*
ChainManager
,
chain
types
.
Blocks
,
t
*
testing
.
T
)
{
func
insertChain
(
done
chan
bool
,
chainMan
*
ChainManager
,
chain
types
.
Blocks
,
t
*
testing
.
T
)
{
err
:=
chainMan
.
InsertChain
(
chain
)
_
,
err
:=
chainMan
.
InsertChain
(
chain
)
if
err
!=
nil
{
if
err
!=
nil
{
fmt
.
Println
(
err
)
fmt
.
Println
(
err
)
t
.
FailNow
()
t
.
FailNow
()
...
...
eth/downloader/downloader_test.go
View file @
c9300458
...
@@ -62,10 +62,10 @@ func (dl *downloadTester) hasBlock(hash common.Hash) bool {
...
@@ -62,10 +62,10 @@ func (dl *downloadTester) hasBlock(hash common.Hash) bool {
return
false
return
false
}
}
func
(
dl
*
downloadTester
)
insertChain
(
blocks
types
.
Blocks
)
error
{
func
(
dl
*
downloadTester
)
insertChain
(
blocks
types
.
Blocks
)
(
int
,
error
)
{
dl
.
insertedBlocks
+=
len
(
blocks
)
dl
.
insertedBlocks
+=
len
(
blocks
)
return
nil
return
0
,
nil
}
}
func
(
dl
*
downloadTester
)
getHashes
(
hash
common
.
Hash
)
error
{
func
(
dl
*
downloadTester
)
getHashes
(
hash
common
.
Hash
)
error
{
...
...
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