good morning!!!!

Skip to content
Snippets Groups Projects
Commit 6ae94736 authored by Guillaume Ballet's avatar Guillaume Ballet Committed by Igor Mandrigin
Browse files

core/vm: dedup config check in markdown logger (#21655)

* core/vm: dedup config check

* review feedback: reuse buffer
# Conflicts:
#	core/vm/logger.go
parent 121fe99e
No related branches found
No related tags found
No related merge requests found
......@@ -339,20 +339,21 @@ func (t *mdLogger) CaptureStart(from common.Address, to common.Address, create b
func (t *mdLogger) CaptureState(env *EVM, pc uint64, op OpCode, gas, cost uint64, memory *Memory, stack *stack.Stack, rStack *stack.ReturnStack, rData []byte, contract *Contract, depth int, err error) error {
fmt.Fprintf(t.out, "| %4d | %10v | %3d |", pc, op, cost)
if !t.cfg.DisableStack { // format stack
if !t.cfg.DisableStack {
// format stack
var a []string
for _, elem := range stack.Data {
a = append(a, fmt.Sprintf("%d", elem))
}
b := fmt.Sprintf("[%v]", strings.Join(a, ","))
fmt.Fprintf(t.out, "%10v |", b)
}
if !t.cfg.DisableStack { // format return stack
var a []string
for _, elem := range rStack.Data() {
// format return stack
a = a[:0]
for _, elem := range rStack.data {
a = append(a, fmt.Sprintf("%2d", elem))
}
b := fmt.Sprintf("[%v]", strings.Join(a, ","))
b = fmt.Sprintf("[%v]", strings.Join(a, ","))
fmt.Fprintf(t.out, "%10v |", b)
}
fmt.Fprintln(t.out, "")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment