forked from cerc-io/plugeth
eth/tracers: refactor exporting js buffer (#27472)
We had to do this workaround because it wasn't possible to export typed arrays from JS to []byte. This was added in dop251/goja@2352993, so we can use the better way now.
This commit is contained in:
@@ -86,7 +86,7 @@ func fromBuf(vm *goja.Runtime, bufType goja.Value, buf goja.Value, allowString b
|
||||
if !obj.Get("constructor").SameAs(bufType) {
|
||||
break
|
||||
}
|
||||
b := obj.Get("buffer").Export().(goja.ArrayBuffer).Bytes()
|
||||
b := obj.Export().([]byte)
|
||||
return b, nil
|
||||
}
|
||||
return nil, errors.New("invalid buffer type")
|
||||
|
||||
Reference in New Issue
Block a user