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
efbd508d
Unverified
Commit
efbd508d
authored
Jan 31, 2023
by
rjl493456442
Committed by
GitHub
Jan 31, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
eth/tracer: rename to revertReason (#26574)
parent
78d089b5
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
51 additions
and
51 deletions
+51
-51
calltrace_test.go
eth/tracers/internal/tracetest/calltrace_test.go
+11
-11
call.go
eth/tracers/native/call.go
+12
-12
gen_callframe_json.go
eth/tracers/native/gen_callframe_json.go
+28
-28
No files found.
eth/tracers/internal/tracetest/calltrace_test.go
View file @
efbd508d
...
...
@@ -55,17 +55,17 @@ type callLog struct {
// callTrace is the result of a callTracer run.
type
callTrace
struct
{
From
common
.
Address
`json:"from"`
Gas
*
hexutil
.
Uint64
`json:"gas"`
GasUsed
*
hexutil
.
Uint64
`json:"gasUsed"`
To
common
.
Address
`json:"to,omitempty"`
Input
hexutil
.
Bytes
`json:"input"`
Output
hexutil
.
Bytes
`json:"output,omitempty"`
Error
string
`json:"error,omitempty"`
Revert
al
string
`json:"revertReason,omitempty"`
Calls
[]
callTrace
`json:"calls,omitempty"`
Logs
[]
callLog
`json:"logs,omitempty"`
Value
*
hexutil
.
Big
`json:"value,omitempty"`
From
common
.
Address
`json:"from"`
Gas
*
hexutil
.
Uint64
`json:"gas"`
GasUsed
*
hexutil
.
Uint64
`json:"gasUsed"`
To
common
.
Address
`json:"to,omitempty"`
Input
hexutil
.
Bytes
`json:"input"`
Output
hexutil
.
Bytes
`json:"output,omitempty"`
Error
string
`json:"error,omitempty"`
Revert
Reason
string
`json:"revertReason,omitempty"`
Calls
[]
callTrace
`json:"calls,omitempty"`
Logs
[]
callLog
`json:"logs,omitempty"`
Value
*
hexutil
.
Big
`json:"value,omitempty"`
// Gencodec adds overridden fields at the end
Type
string
`json:"type"`
}
...
...
eth/tracers/native/call.go
View file @
efbd508d
...
...
@@ -42,17 +42,17 @@ type callLog struct {
}
type
callFrame
struct
{
Type
vm
.
OpCode
`json:"-"`
From
common
.
Address
`json:"from"`
Gas
uint64
`json:"gas"`
GasUsed
uint64
`json:"gasUsed"`
To
common
.
Address
`json:"to,omitempty" rlp:"optional"`
Input
[]
byte
`json:"input" rlp:"optional"`
Output
[]
byte
`json:"output,omitempty" rlp:"optional"`
Error
string
`json:"error,omitempty" rlp:"optional"`
Revert
al
string
`json:"revertReason,omitempty"`
Calls
[]
callFrame
`json:"calls,omitempty" rlp:"optional"`
Logs
[]
callLog
`json:"logs,omitempty" rlp:"optional"`
Type
vm
.
OpCode
`json:"-"`
From
common
.
Address
`json:"from"`
Gas
uint64
`json:"gas"`
GasUsed
uint64
`json:"gasUsed"`
To
common
.
Address
`json:"to,omitempty" rlp:"optional"`
Input
[]
byte
`json:"input" rlp:"optional"`
Output
[]
byte
`json:"output,omitempty" rlp:"optional"`
Error
string
`json:"error,omitempty" rlp:"optional"`
Revert
Reason
string
`json:"revertReason,omitempty"`
Calls
[]
callFrame
`json:"calls,omitempty" rlp:"optional"`
Logs
[]
callLog
`json:"logs,omitempty" rlp:"optional"`
// Placed at end on purpose. The RLP will be decoded to 0 instead of
// nil if there are non-empty elements after in the struct.
Value
*
big
.
Int
`json:"value,omitempty" rlp:"optional"`
...
...
@@ -84,7 +84,7 @@ func (f *callFrame) processOutput(output []byte, err error) {
return
}
if
unpacked
,
err
:=
abi
.
UnpackRevert
(
output
);
err
==
nil
{
f
.
Revert
al
=
unpacked
f
.
Revert
Reason
=
unpacked
}
}
...
...
eth/tracers/native/gen_callframe_json.go
View file @
efbd508d
...
...
@@ -16,19 +16,19 @@ var _ = (*callFrameMarshaling)(nil)
// MarshalJSON marshals as JSON.
func
(
c
callFrame
)
MarshalJSON
()
([]
byte
,
error
)
{
type
callFrame0
struct
{
Type
vm
.
OpCode
`json:"-"`
From
common
.
Address
`json:"from"`
Gas
hexutil
.
Uint64
`json:"gas"`
GasUsed
hexutil
.
Uint64
`json:"gasUsed"`
To
common
.
Address
`json:"to,omitempty" rlp:"optional"`
Input
hexutil
.
Bytes
`json:"input" rlp:"optional"`
Output
hexutil
.
Bytes
`json:"output,omitempty" rlp:"optional"`
Error
string
`json:"error,omitempty" rlp:"optional"`
Revert
al
string
`json:"revertReason,omitempty"`
Calls
[]
callFrame
`json:"calls,omitempty" rlp:"optional"`
Logs
[]
callLog
`json:"logs,omitempty" rlp:"optional"`
Value
*
hexutil
.
Big
`json:"value,omitempty" rlp:"optional"`
TypeString
string
`json:"type"`
Type
vm
.
OpCode
`json:"-"`
From
common
.
Address
`json:"from"`
Gas
hexutil
.
Uint64
`json:"gas"`
GasUsed
hexutil
.
Uint64
`json:"gasUsed"`
To
common
.
Address
`json:"to,omitempty" rlp:"optional"`
Input
hexutil
.
Bytes
`json:"input" rlp:"optional"`
Output
hexutil
.
Bytes
`json:"output,omitempty" rlp:"optional"`
Error
string
`json:"error,omitempty" rlp:"optional"`
Revert
Reason
string
`json:"revertReason,omitempty"`
Calls
[]
callFrame
`json:"calls,omitempty" rlp:"optional"`
Logs
[]
callLog
`json:"logs,omitempty" rlp:"optional"`
Value
*
hexutil
.
Big
`json:"value,omitempty" rlp:"optional"`
TypeString
string
`json:"type"`
}
var
enc
callFrame0
enc
.
Type
=
c
.
Type
...
...
@@ -39,7 +39,7 @@ func (c callFrame) MarshalJSON() ([]byte, error) {
enc
.
Input
=
c
.
Input
enc
.
Output
=
c
.
Output
enc
.
Error
=
c
.
Error
enc
.
Revert
al
=
c
.
Revertal
enc
.
Revert
Reason
=
c
.
RevertReason
enc
.
Calls
=
c
.
Calls
enc
.
Logs
=
c
.
Logs
enc
.
Value
=
(
*
hexutil
.
Big
)(
c
.
Value
)
...
...
@@ -50,18 +50,18 @@ func (c callFrame) MarshalJSON() ([]byte, error) {
// UnmarshalJSON unmarshals from JSON.
func
(
c
*
callFrame
)
UnmarshalJSON
(
input
[]
byte
)
error
{
type
callFrame0
struct
{
Type
*
vm
.
OpCode
`json:"-"`
From
*
common
.
Address
`json:"from"`
Gas
*
hexutil
.
Uint64
`json:"gas"`
GasUsed
*
hexutil
.
Uint64
`json:"gasUsed"`
To
*
common
.
Address
`json:"to,omitempty" rlp:"optional"`
Input
*
hexutil
.
Bytes
`json:"input" rlp:"optional"`
Output
*
hexutil
.
Bytes
`json:"output,omitempty" rlp:"optional"`
Error
*
string
`json:"error,omitempty" rlp:"optional"`
Revert
al
*
string
`json:"revertReason,omitempty"`
Calls
[]
callFrame
`json:"calls,omitempty" rlp:"optional"`
Logs
[]
callLog
`json:"logs,omitempty" rlp:"optional"`
Value
*
hexutil
.
Big
`json:"value,omitempty" rlp:"optional"`
Type
*
vm
.
OpCode
`json:"-"`
From
*
common
.
Address
`json:"from"`
Gas
*
hexutil
.
Uint64
`json:"gas"`
GasUsed
*
hexutil
.
Uint64
`json:"gasUsed"`
To
*
common
.
Address
`json:"to,omitempty" rlp:"optional"`
Input
*
hexutil
.
Bytes
`json:"input" rlp:"optional"`
Output
*
hexutil
.
Bytes
`json:"output,omitempty" rlp:"optional"`
Error
*
string
`json:"error,omitempty" rlp:"optional"`
Revert
Reason
*
string
`json:"revertReason,omitempty"`
Calls
[]
callFrame
`json:"calls,omitempty" rlp:"optional"`
Logs
[]
callLog
`json:"logs,omitempty" rlp:"optional"`
Value
*
hexutil
.
Big
`json:"value,omitempty" rlp:"optional"`
}
var
dec
callFrame0
if
err
:=
json
.
Unmarshal
(
input
,
&
dec
);
err
!=
nil
{
...
...
@@ -91,8 +91,8 @@ func (c *callFrame) UnmarshalJSON(input []byte) error {
if
dec
.
Error
!=
nil
{
c
.
Error
=
*
dec
.
Error
}
if
dec
.
Revert
al
!=
nil
{
c
.
Revert
al
=
*
dec
.
Revertal
if
dec
.
Revert
Reason
!=
nil
{
c
.
Revert
Reason
=
*
dec
.
RevertReason
}
if
dec
.
Calls
!=
nil
{
c
.
Calls
=
dec
.
Calls
...
...
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