Skip to content

Commit

Permalink
core,eth: rename callframe type var to typ
Browse files Browse the repository at this point in the history
  • Loading branch information
s1na committed Aug 2, 2021
1 parent 7904052 commit 35f0b78
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion core/vm/access_list_tracer.go
Expand Up @@ -166,7 +166,7 @@ func (*AccessListTracer) CaptureFault(env *EVM, pc uint64, op OpCode, gas, cost

func (*AccessListTracer) CaptureEnd(output []byte, gasUsed uint64, t time.Duration, err error) {}

func (*AccessListTracer) CaptureEnter(type_ CallFrameType, from common.Address, to common.Address, input []byte, gas uint64, value *big.Int) {
func (*AccessListTracer) CaptureEnter(typ CallFrameType, from common.Address, to common.Address, input []byte, gas uint64, value *big.Int) {
}

func (*AccessListTracer) CaptureExit(output []byte, gasUsed uint64, err error) {}
Expand Down
4 changes: 2 additions & 2 deletions core/vm/evm.go
Expand Up @@ -440,7 +440,7 @@ func (c *codeAndHash) Hash() common.Hash {
}

// create creates a new contract using code as deployment code.
func (evm *EVM) create(caller ContractRef, codeAndHash *codeAndHash, gas uint64, value *big.Int, address common.Address, type_ CallFrameType) ([]byte, common.Address, uint64, error) {
func (evm *EVM) create(caller ContractRef, codeAndHash *codeAndHash, gas uint64, value *big.Int, address common.Address, typ CallFrameType) ([]byte, common.Address, uint64, error) {
// Depth check execution. Fail if we're trying to execute above the
// limit.
if evm.depth > int(params.CallCreateDepth) {
Expand Down Expand Up @@ -482,7 +482,7 @@ func (evm *EVM) create(caller ContractRef, codeAndHash *codeAndHash, gas uint64,
evm.Config.Tracer.CaptureStart(evm, caller.Address(), address, true, codeAndHash.code, gas, value)
} else if evm.Config.Debug && evm.depth > 0 {
// TODO: Make sure we should capture init code's call frame for the tracer
evm.Config.Tracer.CaptureEnter(type_, caller.Address(), address, codeAndHash.code, gas, value)
evm.Config.Tracer.CaptureEnter(typ, caller.Address(), address, codeAndHash.code, gas, value)
}

start := time.Now()
Expand Down
8 changes: 4 additions & 4 deletions core/vm/logger.go
Expand Up @@ -135,7 +135,7 @@ type structFrameMarshaling struct {
type Tracer interface {
CaptureStart(env *EVM, from common.Address, to common.Address, create bool, input []byte, gas uint64, value *big.Int)
CaptureState(env *EVM, pc uint64, op OpCode, gas, cost uint64, scope *ScopeContext, rData []byte, depth int, err error)
CaptureEnter(type_ CallFrameType, from common.Address, to common.Address, input []byte, gas uint64, value *big.Int)
CaptureEnter(typ CallFrameType, from common.Address, to common.Address, input []byte, gas uint64, value *big.Int)
CaptureExit(output []byte, gasUsed uint64, err error)
CaptureFault(env *EVM, pc uint64, op OpCode, gas, cost uint64, scope *ScopeContext, depth int, err error)
CaptureEnd(output []byte, gasUsed uint64, t time.Duration, err error)
Expand Down Expand Up @@ -257,11 +257,11 @@ func (l *StructLogger) CaptureEnd(output []byte, gasUsed uint64, t time.Duration
}
}

func (l *StructLogger) CaptureEnter(type_ CallFrameType, from common.Address, to common.Address, input []byte, gas uint64, value *big.Int) {
func (l *StructLogger) CaptureEnter(typ CallFrameType, from common.Address, to common.Address, input []byte, gas uint64, value *big.Int) {
in := make([]byte, len(input))
copy(in, input)
// TODO: should we honor `l.Cfg.Limit` for frames too?
frame := StructFrame{type_.String(), from, to, in, gas, new(big.Int).Set(value), 0, nil, nil}
frame := StructFrame{typ.String(), from, to, in, gas, new(big.Int).Set(value), 0, nil, nil}
l.frames = append(l.frames, frame)
}

Expand Down Expand Up @@ -395,7 +395,7 @@ func (t *mdLogger) CaptureEnd(output []byte, gasUsed uint64, tm time.Duration, e
output, gasUsed, err)
}

func (t *mdLogger) CaptureEnter(env *EVM, type_ CallFrameType, from common.Address, to common.Address, input []byte, gas uint64, value *big.Int) {
func (t *mdLogger) CaptureEnter(env *EVM, typ CallFrameType, from common.Address, to common.Address, input []byte, gas uint64, value *big.Int) {
// TODO
}

Expand Down
4 changes: 2 additions & 2 deletions core/vm/logger_json.go
Expand Up @@ -89,9 +89,9 @@ func (l *JSONLogger) CaptureEnd(output []byte, gasUsed uint64, t time.Duration,
l.encoder.Encode(endLog{common.Bytes2Hex(output), math.HexOrDecimal64(gasUsed), t, errMsg})
}

func (l *JSONLogger) CaptureEnter(type_ CallFrameType, from common.Address, to common.Address, input []byte, gas uint64, value *big.Int) {
func (l *JSONLogger) CaptureEnter(typ CallFrameType, from common.Address, to common.Address, input []byte, gas uint64, value *big.Int) {
frame := StructFrame{
Type: type_.String(),
Type: typ.String(),
From: from,
To: to,
Input: input,
Expand Down
4 changes: 2 additions & 2 deletions eth/tracers/tracer.go
Expand Up @@ -662,7 +662,7 @@ func (jst *Tracer) CaptureEnd(output []byte, gasUsed uint64, t time.Duration, er
}
}

func (jst *Tracer) CaptureEnter(type_ vm.CallFrameType, from common.Address, to common.Address, input []byte, gas uint64, value *big.Int) {
func (jst *Tracer) CaptureEnter(typ vm.CallFrameType, from common.Address, to common.Address, input []byte, gas uint64, value *big.Int) {
if !jst.traceCallFrames {
return
}
Expand All @@ -677,7 +677,7 @@ func (jst *Tracer) CaptureEnter(type_ vm.CallFrameType, from common.Address, to

// Transform the frame into a JavaScript object and inject into the state
obj := jst.vm.PushObject()
jst.addToObj(obj, "type", type_.String())
jst.addToObj(obj, "type", typ.String())
jst.addToObj(obj, "from", from)
jst.addToObj(obj, "to", to)
jst.addToObj(obj, "input", input)
Expand Down

0 comments on commit 35f0b78

Please sign in to comment.