Skip to content

Commit

Permalink
eth/tracers: convert int/hash values from context into js object (eth…
Browse files Browse the repository at this point in the history
…ereum#23108)

* Convert int/hash values from context into js object

* Use js fixed buffer

Co-authored-by: William <[email protected]>
  • Loading branch information
williamberman and William authored Jun 25, 2021
1 parent 9e23610 commit 948a600
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions eth/tracers/tracer.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))
}
Expand Down

0 comments on commit 948a600

Please sign in to comment.