@@ -81,8 +81,8 @@ type StructLog struct {
81
81
Err error `json:"-"`
82
82
}
83
83
84
- func NewStructlog (pc uint64 , op OpCode , gas , cost uint64 , depth int , err error ) * StructLog {
85
- return & StructLog {
84
+ func NewStructlog (pc uint64 , op OpCode , gas , cost uint64 , depth int , err error ) StructLog {
85
+ return StructLog {
86
86
Pc : pc ,
87
87
Op : op ,
88
88
Gas : gas ,
@@ -92,14 +92,6 @@ func NewStructlog(pc uint64, op OpCode, gas, cost uint64, depth int, err error)
92
92
}
93
93
}
94
94
95
- func (s * StructLog ) clean () {
96
- s .Memory .Reset ()
97
- s .Stack = s .Stack [:0 ]
98
- s .ReturnData .Reset ()
99
- s .Storage = nil
100
- s .Err = nil
101
- }
102
-
103
95
// overrides for gencodec
104
96
type structLogMarshaling struct {
105
97
Gas math.HexOrDecimal64
@@ -165,7 +157,7 @@ type StructLogger struct {
165
157
createdAccount * types.AccountWrapper
166
158
167
159
callStackLogInd []int
168
- logs []* StructLog
160
+ logs []StructLog
169
161
output []byte
170
162
err error
171
163
@@ -405,7 +397,7 @@ func (l *StructLogger) TracedBytecodes() map[common.Hash]CodeInfo {
405
397
func (l * StructLogger ) CreatedAccount () * types.AccountWrapper { return l .createdAccount }
406
398
407
399
// StructLogs returns the captured log entries.
408
- func (l * StructLogger ) StructLogs () []* StructLog { return l .logs }
400
+ func (l * StructLogger ) StructLogs () []StructLog { return l .logs }
409
401
410
402
// Error returns the VM error captured by the trace.
411
403
func (l * StructLogger ) Error () error { return l .err }
@@ -414,7 +406,7 @@ func (l *StructLogger) Error() error { return l.err }
414
406
func (l * StructLogger ) Output () []byte { return l .output }
415
407
416
408
// WriteTrace writes a formatted trace to the given writer
417
- func WriteTrace (writer io.Writer , logs []* StructLog ) {
409
+ func WriteTrace (writer io.Writer , logs []StructLog ) {
418
410
for _ , log := range logs {
419
411
fmt .Fprintf (writer , "%-16spc=%08d gas=%v cost=%v" , log .Op , log .Pc , log .Gas , log .GasCost )
420
412
if log .Err != nil {
@@ -534,8 +526,8 @@ func (t *mdLogger) CaptureEnter(typ OpCode, from common.Address, to common.Addre
534
526
func (t * mdLogger ) CaptureExit (output []byte , gasUsed uint64 , err error ) {}
535
527
536
528
// FormatLogs formats EVM returned structured logs for json output
537
- func FormatLogs (logs []* StructLog ) []* types.StructLogRes {
538
- formatted := make ([]* types.StructLogRes , 0 , len (logs ))
529
+ func FormatLogs (logs []StructLog ) []types.StructLogRes {
530
+ formatted := make ([]types.StructLogRes , 0 , len (logs ))
539
531
540
532
for _ , trace := range logs {
541
533
logRes := types .NewStructLogResBasic (trace .Pc , trace .Op .String (), trace .Gas , trace .GasCost , trace .Depth , trace .RefundCounter , trace .Err )
0 commit comments