Skip to content

Commit 948a600

Browse files
williambermanWilliam
andauthored
eth/tracers: convert int/hash values from context into js object (ethereum#23108)
* Convert int/hash values from context into js object * Use js fixed buffer Co-authored-by: William <[email protected]>
1 parent 9e23610 commit 948a600

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

eth/tracers/tracer.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -662,6 +662,13 @@ func (jst *Tracer) GetResult() (json.RawMessage, error) {
662662
case *big.Int:
663663
pushBigInt(val, jst.vm)
664664

665+
case int:
666+
jst.vm.PushInt(val)
667+
668+
case common.Hash:
669+
ptr := jst.vm.PushFixedBuffer(32)
670+
copy(makeSlice(ptr, 32), val[:])
671+
665672
default:
666673
panic(fmt.Sprintf("unsupported type: %T", val))
667674
}

0 commit comments

Comments
 (0)