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
f42bd73c
Commit
f42bd73c
authored
Aug 07, 2017
by
Egon Elbre
Committed by
Felix Lange
Aug 07, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
internal: fix megacheck warnings (#14919)
parent
f5925b04
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
34 deletions
+3
-34
api.go
internal/ethapi/api.go
+3
-26
pretty.go
internal/jsre/pretty.go
+0
-8
No files found.
internal/ethapi/api.go
View file @
f42bd73c
...
@@ -46,7 +46,6 @@ import (
...
@@ -46,7 +46,6 @@ import (
const
(
const
(
defaultGas
=
90000
defaultGas
=
90000
defaultGasPrice
=
50
*
params
.
Shannon
defaultGasPrice
=
50
*
params
.
Shannon
emptyHex
=
"0x"
)
)
// PublicEthereumAPI provides an API to access Ethereum related information.
// PublicEthereumAPI provides an API to access Ethereum related information.
...
@@ -548,26 +547,6 @@ func (s *PublicBlockChainAPI) GetStorageAt(ctx context.Context, address common.A
...
@@ -548,26 +547,6 @@ func (s *PublicBlockChainAPI) GetStorageAt(ctx context.Context, address common.A
return
res
[
:
],
state
.
Error
()
return
res
[
:
],
state
.
Error
()
}
}
// callmsg is the message type used for call transitions.
type
callmsg
struct
{
addr
common
.
Address
to
*
common
.
Address
gas
,
gasPrice
*
big
.
Int
value
*
big
.
Int
data
[]
byte
}
// accessor boilerplate to implement core.Message
func
(
m
callmsg
)
From
()
(
common
.
Address
,
error
)
{
return
m
.
addr
,
nil
}
func
(
m
callmsg
)
FromFrontier
()
(
common
.
Address
,
error
)
{
return
m
.
addr
,
nil
}
func
(
m
callmsg
)
Nonce
()
uint64
{
return
0
}
func
(
m
callmsg
)
CheckNonce
()
bool
{
return
false
}
func
(
m
callmsg
)
To
()
*
common
.
Address
{
return
m
.
to
}
func
(
m
callmsg
)
GasPrice
()
*
big
.
Int
{
return
m
.
gasPrice
}
func
(
m
callmsg
)
Gas
()
*
big
.
Int
{
return
m
.
gas
}
func
(
m
callmsg
)
Value
()
*
big
.
Int
{
return
m
.
value
}
func
(
m
callmsg
)
Data
()
[]
byte
{
return
m
.
data
}
// CallArgs represents the arguments for a call.
// CallArgs represents the arguments for a call.
type
CallArgs
struct
{
type
CallArgs
struct
{
From
common
.
Address
`json:"from"`
From
common
.
Address
`json:"from"`
...
@@ -626,10 +605,8 @@ func (s *PublicBlockChainAPI) doCall(ctx context.Context, args CallArgs, blockNr
...
@@ -626,10 +605,8 @@ func (s *PublicBlockChainAPI) doCall(ctx context.Context, args CallArgs, blockNr
// Wait for the context to be done and cancel the evm. Even if the
// Wait for the context to be done and cancel the evm. Even if the
// EVM has finished, cancelling may be done (repeatedly)
// EVM has finished, cancelling may be done (repeatedly)
go
func
()
{
go
func
()
{
select
{
<-
ctx
.
Done
()
case
<-
ctx
.
Done
()
:
evm
.
Cancel
()
evm
.
Cancel
()
}
}()
}()
// Setup the gas pool (also for unmetered requests)
// Setup the gas pool (also for unmetered requests)
...
@@ -1306,7 +1283,7 @@ func (api *PublicDebugAPI) PrintBlock(ctx context.Context, number uint64) (strin
...
@@ -1306,7 +1283,7 @@ func (api *PublicDebugAPI) PrintBlock(ctx context.Context, number uint64) (strin
if
block
==
nil
{
if
block
==
nil
{
return
""
,
fmt
.
Errorf
(
"block #%d not found"
,
number
)
return
""
,
fmt
.
Errorf
(
"block #%d not found"
,
number
)
}
}
return
fmt
.
Sprintf
(
"%s"
,
block
),
nil
return
block
.
String
(
),
nil
}
}
// SeedHash retrieves the seed hash of a block.
// SeedHash retrieves the seed hash of a block.
...
...
internal/jsre/pretty.go
View file @
f42bd73c
...
@@ -65,14 +65,6 @@ func prettyError(vm *otto.Otto, err error, w io.Writer) {
...
@@ -65,14 +65,6 @@ func prettyError(vm *otto.Otto, err error, w io.Writer) {
fmt
.
Fprint
(
w
,
ErrorColor
(
"%s"
,
failure
))
fmt
.
Fprint
(
w
,
ErrorColor
(
"%s"
,
failure
))
}
}
// jsErrorString adds a backtrace to errors generated by otto.
func
jsErrorString
(
err
error
)
string
{
if
ottoErr
,
ok
:=
err
.
(
*
otto
.
Error
);
ok
{
return
ottoErr
.
String
()
}
return
err
.
Error
()
}
func
(
re
*
JSRE
)
prettyPrintJS
(
call
otto
.
FunctionCall
)
otto
.
Value
{
func
(
re
*
JSRE
)
prettyPrintJS
(
call
otto
.
FunctionCall
)
otto
.
Value
{
for
_
,
v
:=
range
call
.
ArgumentList
{
for
_
,
v
:=
range
call
.
ArgumentList
{
prettyPrint
(
call
.
Otto
,
v
,
re
.
output
)
prettyPrint
(
call
.
Otto
,
v
,
re
.
output
)
...
...
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