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 <william.berman@coinbase.com>
This commit is contained in:
williamberman 2021-06-24 23:02:15 -07:00 committed by GitHub
parent 9e23610b0f
commit 948a600ed5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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))
}