From 948a600ed590ec46c8f294e164852de8c292a077 Mon Sep 17 00:00:00 2001 From: williamberman Date: Thu, 24 Jun 2021 23:02:15 -0700 Subject: [PATCH] eth/tracers: convert int/hash values from context into js object (#23108) * Convert int/hash values from context into js object * Use js fixed buffer Co-authored-by: William --- eth/tracers/tracer.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/eth/tracers/tracer.go b/eth/tracers/tracer.go index 0b216e362..bf4bd634a 100644 --- a/eth/tracers/tracer.go +++ b/eth/tracers/tracer.go @@ -662,6 +662,13 @@ func (jst *Tracer) GetResult() (json.RawMessage, error) { case *big.Int: pushBigInt(val, jst.vm) + case int: + jst.vm.PushInt(val) + + case common.Hash: + ptr := jst.vm.PushFixedBuffer(32) + copy(makeSlice(ptr, 32), val[:]) + default: panic(fmt.Sprintf("unsupported type: %T", val)) }