Skip to content

Commit

Permalink
eth/tracers/js: use t.toBig on ctx.GasPrice for js tracing (ethereum#…
Browse files Browse the repository at this point in the history
…27903)

This change fixes a bug in js tracer, where `ctx.GasPrice.toString(16)` returns a number string in base `10`.
  • Loading branch information
nettijoe96 authored Aug 15, 2023
1 parent ab28680 commit e0b1198
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion eth/tracers/js/goja.go
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,12 @@ func (t *jsTracer) CaptureStart(env *vm.EVM, from common.Address, to common.Addr
t.ctx["to"] = t.vm.ToValue(to.Bytes())
t.ctx["input"] = t.vm.ToValue(input)
t.ctx["gas"] = t.vm.ToValue(t.gasLimit)
t.ctx["gasPrice"] = t.vm.ToValue(env.TxContext.GasPrice)
gasPriceBig, err := t.toBig(t.vm, env.TxContext.GasPrice.String())
if err != nil {
t.err = err
return
}
t.ctx["gasPrice"] = gasPriceBig
valueBig, err := t.toBig(t.vm, value.String())
if err != nil {
t.err = err
Expand Down

0 comments on commit e0b1198

Please sign in to comment.