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
d76c5ca5
Commit
d76c5ca5
authored
7 years ago
by
Eli
Committed by
Péter Szilágyi
7 years ago
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tests: golint fixes for tests directory (#16640)
parent
c1ea5275
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
8 additions
and
10 deletions
+8
-10
block_test_util.go
tests/block_test_util.go
+1
-1
init.go
tests/init.go
+1
-1
init_test.go
tests/init_test.go
+5
-6
transaction_test_util.go
tests/transaction_test_util.go
+1
-2
No files found.
tests/block_test_util.go
View file @
d76c5ca5
...
...
@@ -104,7 +104,7 @@ func (t *BlockTest) Run() error {
return
err
}
if
gblock
.
Hash
()
!=
t
.
json
.
Genesis
.
Hash
{
return
fmt
.
Errorf
(
"genesis block hash doesn't match test: computed=%x, test=%x
\n
"
,
gblock
.
Hash
()
.
Bytes
()[
:
6
],
t
.
json
.
Genesis
.
Hash
[
:
6
])
return
fmt
.
Errorf
(
"genesis block hash doesn't match test: computed=%x, test=%x"
,
gblock
.
Hash
()
.
Bytes
()[
:
6
],
t
.
json
.
Genesis
.
Hash
[
:
6
])
}
if
gblock
.
Root
()
!=
t
.
json
.
Genesis
.
StateRoot
{
return
fmt
.
Errorf
(
"genesis block state root does not match test: computed=%x, test=%x"
,
gblock
.
Root
()
.
Bytes
()[
:
6
],
t
.
json
.
Genesis
.
StateRoot
[
:
6
])
...
...
This diff is collapsed.
Click to expand it.
tests/init.go
View file @
d76c5ca5
...
...
@@ -23,7 +23,7 @@ import (
"github.com/ethereum/go-ethereum/params"
)
//
Thi
s table defines supported forks and their chain config.
//
Fork
s table defines supported forks and their chain config.
var
Forks
=
map
[
string
]
*
params
.
ChainConfig
{
"Frontier"
:
{
ChainId
:
big
.
NewInt
(
1
),
...
...
This diff is collapsed.
Click to expand it.
tests/init_test.go
View file @
d76c5ca5
...
...
@@ -42,7 +42,7 @@ var (
difficultyTestDir
=
filepath
.
Join
(
baseDir
,
"BasicTests"
)
)
func
readJ
son
(
reader
io
.
Reader
,
value
interface
{})
error
{
func
readJ
SON
(
reader
io
.
Reader
,
value
interface
{})
error
{
data
,
err
:=
ioutil
.
ReadAll
(
reader
)
if
err
!=
nil
{
return
fmt
.
Errorf
(
"error reading JSON file: %v"
,
err
)
...
...
@@ -57,14 +57,14 @@ func readJson(reader io.Reader, value interface{}) error {
return
nil
}
func
readJ
son
File
(
fn
string
,
value
interface
{})
error
{
func
readJ
SON
File
(
fn
string
,
value
interface
{})
error
{
file
,
err
:=
os
.
Open
(
fn
)
if
err
!=
nil
{
return
err
}
defer
file
.
Close
()
err
=
readJ
son
(
file
,
value
)
err
=
readJ
SON
(
file
,
value
)
if
err
!=
nil
{
return
fmt
.
Errorf
(
"%s in file %s"
,
err
.
Error
(),
fn
)
}
...
...
@@ -169,9 +169,8 @@ func (tm *testMatcher) checkFailure(t *testing.T, name string, err error) error
if
err
!=
nil
{
t
.
Logf
(
"error: %v"
,
err
)
return
nil
}
else
{
return
fmt
.
Errorf
(
"test succeeded unexpectedly"
)
}
return
fmt
.
Errorf
(
"test succeeded unexpectedly"
)
}
return
err
}
...
...
@@ -213,7 +212,7 @@ func (tm *testMatcher) runTestFile(t *testing.T, path, name string, runTest inte
// Load the file as map[string]<testType>.
m
:=
makeMapFromTestFunc
(
runTest
)
if
err
:=
readJ
son
File
(
path
,
m
.
Addr
()
.
Interface
());
err
!=
nil
{
if
err
:=
readJ
SON
File
(
path
,
m
.
Addr
()
.
Interface
());
err
!=
nil
{
t
.
Fatal
(
err
)
}
...
...
This diff is collapsed.
Click to expand it.
tests/transaction_test_util.go
View file @
d76c5ca5
...
...
@@ -72,9 +72,8 @@ func (tt *TransactionTest) Run(config *params.ChainConfig) error {
if
err
:=
rlp
.
DecodeBytes
(
tt
.
json
.
RLP
,
tx
);
err
!=
nil
{
if
tt
.
json
.
Transaction
==
nil
{
return
nil
}
else
{
return
fmt
.
Errorf
(
"RLP decoding failed: %v"
,
err
)
}
return
fmt
.
Errorf
(
"RLP decoding failed: %v"
,
err
)
}
// Check sender derivation.
signer
:=
types
.
MakeSigner
(
config
,
new
(
big
.
Int
)
.
SetUint64
(
uint64
(
tt
.
json
.
BlockNumber
)))
...
...
This diff is collapsed.
Click to expand it.
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