@@ -79,8 +79,8 @@ type StructLog struct {
79
79
Err error `json:"-"`
80
80
}
81
81
82
- func NewStructlog (pc uint64 , op OpCode , gas , cost uint64 , depth int , err error ) * StructLog {
83
- return & StructLog {
82
+ func NewStructlog (pc uint64 , op OpCode , gas , cost uint64 , depth int , err error ) StructLog {
83
+ return StructLog {
84
84
Pc : pc ,
85
85
Op : op ,
86
86
Gas : gas ,
@@ -90,14 +90,6 @@ func NewStructlog(pc uint64, op OpCode, gas, cost uint64, depth int, err error)
90
90
}
91
91
}
92
92
93
- func (s * StructLog ) clean () {
94
- s .Memory .Reset ()
95
- s .Stack = s .Stack [:0 ]
96
- s .ReturnData .Reset ()
97
- s .Storage = nil
98
- s .Err = nil
99
- }
100
-
101
93
// overrides for gencodec
102
94
type structLogMarshaling struct {
103
95
Gas math.HexOrDecimal64
@@ -159,7 +151,7 @@ type StructLogger struct {
159
151
createdAccount * types.AccountWrapper
160
152
161
153
callStackLogInd []int
162
- logs []* StructLog
154
+ logs []StructLog
163
155
output []byte
164
156
err error
165
157
}
@@ -359,7 +351,7 @@ func (l *StructLogger) TracedBytecodes() map[common.Hash]CodeInfo {
359
351
func (l * StructLogger ) CreatedAccount () * types.AccountWrapper { return l .createdAccount }
360
352
361
353
// StructLogs returns the captured log entries.
362
- func (l * StructLogger ) StructLogs () []* StructLog { return l .logs }
354
+ func (l * StructLogger ) StructLogs () []StructLog { return l .logs }
363
355
364
356
// Error returns the VM error captured by the trace.
365
357
func (l * StructLogger ) Error () error { return l .err }
@@ -368,7 +360,7 @@ func (l *StructLogger) Error() error { return l.err }
368
360
func (l * StructLogger ) Output () []byte { return l .output }
369
361
370
362
// WriteTrace writes a formatted trace to the given writer
371
- func WriteTrace (writer io.Writer , logs []* StructLog ) {
363
+ func WriteTrace (writer io.Writer , logs []StructLog ) {
372
364
for _ , log := range logs {
373
365
fmt .Fprintf (writer , "%-16spc=%08d gas=%v cost=%v" , log .Op , log .Pc , log .Gas , log .GasCost )
374
366
if log .Err != nil {
@@ -488,8 +480,8 @@ func (t *mdLogger) CaptureEnter(typ OpCode, from common.Address, to common.Addre
488
480
func (t * mdLogger ) CaptureExit (output []byte , gasUsed uint64 , err error ) {}
489
481
490
482
// FormatLogs formats EVM returned structured logs for json output
491
- func FormatLogs (logs []* StructLog ) []* types.StructLogRes {
492
- formatted := make ([]* types.StructLogRes , 0 , len (logs ))
483
+ func FormatLogs (logs []StructLog ) []types.StructLogRes {
484
+ formatted := make ([]types.StructLogRes , 0 , len (logs ))
493
485
494
486
for _ , trace := range logs {
495
487
logRes := types .NewStructLogResBasic (trace .Pc , trace .Op .String (), trace .Gas , trace .GasCost , trace .Depth , trace .RefundCounter , trace .Err )
0 commit comments