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
732f5468
Commit
732f5468
authored
Dec 09, 2017
by
Michael Ruminer
Committed by
Felix Lange
Dec 09, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
eth: make tracing API errors more user friendly (#15589)
parent
bbfe0b8d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
2 deletions
+12
-2
api.go
eth/api.go
+12
-2
No files found.
eth/api.go
View file @
732f5468
...
@@ -452,8 +452,13 @@ func (api *PrivateDebugAPI) traceBlock(block *types.Block, logConfig *vm.LogConf
...
@@ -452,8 +452,13 @@ func (api *PrivateDebugAPI) traceBlock(block *types.Block, logConfig *vm.LogConf
}
}
statedb
,
err
:=
blockchain
.
StateAt
(
blockchain
.
GetBlock
(
block
.
ParentHash
(),
block
.
NumberU64
()
-
1
)
.
Root
())
statedb
,
err
:=
blockchain
.
StateAt
(
blockchain
.
GetBlock
(
block
.
ParentHash
(),
block
.
NumberU64
()
-
1
)
.
Root
())
if
err
!=
nil
{
if
err
!=
nil
{
switch
err
.
(
type
)
{
case
*
trie
.
MissingNodeError
:
return
false
,
structLogger
.
StructLogs
(),
fmt
.
Errorf
(
"required historical state unavailable"
)
default
:
return
false
,
structLogger
.
StructLogs
(),
err
return
false
,
structLogger
.
StructLogs
(),
err
}
}
}
receipts
,
_
,
usedGas
,
err
:=
processor
.
Process
(
block
,
statedb
,
config
)
receipts
,
_
,
usedGas
,
err
:=
processor
.
Process
(
block
,
statedb
,
config
)
if
err
!=
nil
{
if
err
!=
nil
{
...
@@ -518,8 +523,13 @@ func (api *PrivateDebugAPI) TraceTransaction(ctx context.Context, txHash common.
...
@@ -518,8 +523,13 @@ func (api *PrivateDebugAPI) TraceTransaction(ctx context.Context, txHash common.
}
}
msg
,
context
,
statedb
,
err
:=
api
.
computeTxEnv
(
blockHash
,
int
(
txIndex
))
msg
,
context
,
statedb
,
err
:=
api
.
computeTxEnv
(
blockHash
,
int
(
txIndex
))
if
err
!=
nil
{
if
err
!=
nil
{
switch
err
.
(
type
)
{
case
*
trie
.
MissingNodeError
:
return
nil
,
fmt
.
Errorf
(
"required historical state unavailable"
)
default
:
return
nil
,
err
return
nil
,
err
}
}
}
// Run the transaction with tracing enabled.
// Run the transaction with tracing enabled.
vmenv
:=
vm
.
NewEVM
(
context
,
statedb
,
api
.
config
,
vm
.
Config
{
Debug
:
true
,
Tracer
:
tracer
})
vmenv
:=
vm
.
NewEVM
(
context
,
statedb
,
api
.
config
,
vm
.
Config
{
Debug
:
true
,
Tracer
:
tracer
})
...
...
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