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
e0bf5f0c
Commit
e0bf5f0c
authored
Nov 29, 2019
by
Guillaume Ballet
Committed by
Felix Lange
Nov 29, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
internal: fix staticcheck warnings (#20380)
parent
1ff3d7c2
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
14 deletions
+27
-14
test_cmd.go
internal/cmdtest/test_cmd.go
+2
-2
api.go
internal/ethapi/api.go
+4
-4
bindata.go
internal/jsre/deps/bindata.go
+21
-8
No files found.
internal/cmdtest/test_cmd.go
View file @
e0bf5f0c
...
...
@@ -127,12 +127,12 @@ func (tt *TestCmd) matchExactOutput(want []byte) error {
// Find the mismatch position.
for
i
:=
0
;
i
<
n
;
i
++
{
if
want
[
i
]
!=
buf
[
i
]
{
return
fmt
.
Errorf
(
"
O
utput mismatch at ◊:
\n
---------------- (stdout text)
\n
%s◊%s
\n
---------------- (expected text)
\n
%s"
,
return
fmt
.
Errorf
(
"
o
utput mismatch at ◊:
\n
---------------- (stdout text)
\n
%s◊%s
\n
---------------- (expected text)
\n
%s"
,
buf
[
:
i
],
buf
[
i
:
n
],
want
)
}
}
if
n
<
len
(
want
)
{
return
fmt
.
Errorf
(
"
N
ot enough output, got until ◊:
\n
---------------- (stdout text)
\n
%s
\n
---------------- (expected text)
\n
%s◊%s"
,
return
fmt
.
Errorf
(
"
n
ot enough output, got until ◊:
\n
---------------- (stdout text)
\n
%s
\n
---------------- (expected text)
\n
%s◊%s"
,
buf
,
want
[
:
n
],
want
[
n
:
])
}
}
...
...
internal/ethapi/api.go
View file @
e0bf5f0c
...
...
@@ -486,7 +486,7 @@ func (s *PrivateAccountAPI) InitializeWallet(ctx context.Context, url string) (s
case
*
scwallet
.
Wallet
:
return
mnemonic
,
wallet
.
Initialize
(
seed
)
default
:
return
""
,
fmt
.
Errorf
(
"
S
pecified wallet does not support initialization"
)
return
""
,
fmt
.
Errorf
(
"
s
pecified wallet does not support initialization"
)
}
}
...
...
@@ -501,7 +501,7 @@ func (s *PrivateAccountAPI) Unpair(ctx context.Context, url string, pin string)
case
*
scwallet
.
Wallet
:
return
wallet
.
Unpair
([]
byte
(
pin
))
default
:
return
fmt
.
Errorf
(
"
S
pecified wallet does not support pairing"
)
return
fmt
.
Errorf
(
"
s
pecified wallet does not support pairing"
)
}
}
...
...
@@ -1389,7 +1389,7 @@ func (args *SendTxArgs) setDefaults(ctx context.Context, b Backend) error {
args
.
Nonce
=
(
*
hexutil
.
Uint64
)(
&
nonce
)
}
if
args
.
Data
!=
nil
&&
args
.
Input
!=
nil
&&
!
bytes
.
Equal
(
*
args
.
Data
,
*
args
.
Input
)
{
return
errors
.
New
(
`
Both "data" and "input" are set and not equal. Please use "input" to pass transaction call data.
`
)
return
errors
.
New
(
`
both "data" and "input" are set and not equal. Please use "input" to pass transaction call data
`
)
}
if
args
.
To
==
nil
{
// Contract creation
...
...
@@ -1645,7 +1645,7 @@ func (s *PublicTransactionPoolAPI) Resend(ctx context.Context, sendArgs SendTxAr
}
}
return
common
.
Hash
{},
fmt
.
Errorf
(
"
T
ransaction %#x not found"
,
matchTx
.
Hash
())
return
common
.
Hash
{},
fmt
.
Errorf
(
"
t
ransaction %#x not found"
,
matchTx
.
Hash
())
}
// PublicDebugAPI is the collection of Ethereum APIs exposed over the public
...
...
internal/jsre/deps/bindata.go
View file @
e0bf5f0c
//
Code generated by go-bindata.
DO NOT EDIT.
//
Package deps Code generated by go-bindata. (@generated)
DO NOT EDIT.
// sources:
// bignumber.js
// web3.js
package
deps
import
(
...
...
@@ -20,7 +19,7 @@ import (
func
bindataRead
(
data
[]
byte
,
name
string
)
([]
byte
,
error
)
{
gz
,
err
:=
gzip
.
NewReader
(
bytes
.
NewBuffer
(
data
))
if
err
!=
nil
{
return
nil
,
fmt
.
Errorf
(
"
R
ead %q: %v"
,
name
,
err
)
return
nil
,
fmt
.
Errorf
(
"
r
ead %q: %v"
,
name
,
err
)
}
var
buf
bytes
.
Buffer
...
...
@@ -28,7 +27,7 @@ func bindataRead(data []byte, name string) ([]byte, error) {
clErr
:=
gz
.
Close
()
if
err
!=
nil
{
return
nil
,
fmt
.
Errorf
(
"
R
ead %q: %v"
,
name
,
err
)
return
nil
,
fmt
.
Errorf
(
"
r
ead %q: %v"
,
name
,
err
)
}
if
clErr
!=
nil
{
return
nil
,
err
...
...
@@ -49,21 +48,32 @@ type bindataFileInfo struct {
modTime
time
.
Time
}
// Name return file name
func
(
fi
bindataFileInfo
)
Name
()
string
{
return
fi
.
name
}
// Size return file size
func
(
fi
bindataFileInfo
)
Size
()
int64
{
return
fi
.
size
}
// Mode return file mode
func
(
fi
bindataFileInfo
)
Mode
()
os
.
FileMode
{
return
fi
.
mode
}
// ModTime return file modify time
func
(
fi
bindataFileInfo
)
ModTime
()
time
.
Time
{
return
fi
.
modTime
}
// IsDir return file whether a directory
func
(
fi
bindataFileInfo
)
IsDir
()
bool
{
return
f
alse
return
f
i
.
mode
&
os
.
ModeDir
!=
0
}
// Sys return file is sys mode
func
(
fi
bindataFileInfo
)
Sys
()
interface
{}
{
return
nil
}
...
...
@@ -161,8 +171,7 @@ func AssetNames() []string {
// _bindata is a table, holding each asset generator, mapped to its name.
var
_bindata
=
map
[
string
]
func
()
(
*
asset
,
error
){
"bignumber.js"
:
bignumberJs
,
"web3.js"
:
web3Js
,
"web3.js"
:
web3Js
,
}
// AssetDir returns the file names below a certain
...
...
@@ -228,7 +237,11 @@ func RestoreAsset(dir, name string) error {
if
err
!=
nil
{
return
err
}
return
os
.
Chtimes
(
_filePath
(
dir
,
name
),
info
.
ModTime
(),
info
.
ModTime
())
err
=
os
.
Chtimes
(
_filePath
(
dir
,
name
),
info
.
ModTime
(),
info
.
ModTime
())
if
err
!=
nil
{
return
err
}
return
nil
}
// RestoreAssets restores an asset under the given directory recursively
...
...
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