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:
Sina Mahmoodi
2023-06-14 19:07:24 +02:00
committed by GitHub
parent acc2a2ac61
commit 7823ff6d06
3 changed files with 21 additions and 2 deletions
+1 -1
View File
@@ -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")