Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
nebula
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
exchain
nebula
Commits
b42177af
Unverified
Commit
b42177af
authored
Aug 16, 2023
by
OptimismBot
Committed by
GitHub
Aug 16, 2023
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #6845 from ethereum-optimism/aj/print-trace
op-e2e: Print tx trace info
parents
a1f16b3d
f23e2fbe
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
7 deletions
+9
-7
waits.go
op-e2e/e2eutils/wait/waits.go
+9
-7
No files found.
op-e2e/e2eutils/wait/waits.go
View file @
b42177af
...
@@ -38,7 +38,8 @@ func ForReceipt(ctx context.Context, client *ethclient.Client, hash common.Hash,
...
@@ -38,7 +38,8 @@ func ForReceipt(ctx context.Context, client *ethclient.Client, hash common.Hash,
return
nil
,
fmt
.
Errorf
(
"failed to get receipt: %w"
,
err
)
return
nil
,
fmt
.
Errorf
(
"failed to get receipt: %w"
,
err
)
}
}
if
receipt
.
Status
!=
status
{
if
receipt
.
Status
!=
status
{
return
receipt
,
addDebugTrace
(
ctx
,
client
,
hash
,
fmt
.
Errorf
(
"expected status %d, but got %d"
,
status
,
receipt
.
Status
))
printDebugTrace
(
ctx
,
client
,
hash
)
return
receipt
,
fmt
.
Errorf
(
"expected status %d, but got %d"
,
status
,
receipt
.
Status
)
}
}
return
receipt
,
nil
return
receipt
,
nil
}
}
...
@@ -52,15 +53,16 @@ func (s *jsonRawString) UnmarshalJSON(input []byte) error {
...
@@ -52,15 +53,16 @@ func (s *jsonRawString) UnmarshalJSON(input []byte) error {
return
nil
return
nil
}
}
//
addDebugTrace adds debug_traceTransaction output to the original error to make debugging
//
printDebugTrace logs debug_traceTransaction output to aid in debugging unexpected receipt statuses
func
addDebugTrace
(
ctx
context
.
Context
,
client
*
ethclient
.
Client
,
txHash
common
.
Hash
,
origErr
error
)
error
{
func
printDebugTrace
(
ctx
context
.
Context
,
client
*
ethclient
.
Client
,
txHash
common
.
Hash
)
{
var
result
jsonRawString
var
trace
jsonRawString
options
:=
map
[
string
]
string
{}
options
:=
map
[
string
]
string
{}
err
:=
client
.
Client
()
.
CallContext
(
ctx
,
&
result
,
"debug_traceTransaction"
,
hexutil
.
Bytes
(
txHash
.
Bytes
()),
options
)
err
:=
client
.
Client
()
.
CallContext
(
ctx
,
&
trace
,
"debug_traceTransaction"
,
hexutil
.
Bytes
(
txHash
.
Bytes
()),
options
)
if
err
!=
nil
{
if
err
!=
nil
{
return
errors
.
Join
(
origErr
,
fmt
.
Errorf
(
"tx trace unavailable: %w"
,
err
))
fmt
.
Printf
(
"TxTrace unavailable: %v
\n
"
,
err
)
return
}
}
return
fmt
.
Errorf
(
"%w
\n
TxTrace: %v"
,
origErr
,
result
)
fmt
.
Printf
(
"TxTrace: %v
\n
"
,
trace
)
}
}
func
ForBlock
(
ctx
context
.
Context
,
client
*
ethclient
.
Client
,
n
uint64
)
error
{
func
ForBlock
(
ctx
context
.
Context
,
client
*
ethclient
.
Client
,
n
uint64
)
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