mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2025-01-05 10:32:19 +00:00
97c9a9108d
Remove `callType` argument from `CaptureStart`, and change `callType vm.CallType` to `typ vm.OpCode` in `CaptureEnter` and move to the first position (as it is in geth) Co-authored-by: Alex Sharp <alexsharp@Alexs-MacBook-Pro-2.local>
55 lines
2.0 KiB
Go
55 lines
2.0 KiB
Go
package exec3
|
|
|
|
import (
|
|
"time"
|
|
|
|
"github.com/holiman/uint256"
|
|
"github.com/ledgerwatch/erigon/common"
|
|
"github.com/ledgerwatch/erigon/core/vm"
|
|
)
|
|
|
|
type CallTracer struct {
|
|
froms map[common.Address]struct{}
|
|
tos map[common.Address]struct{}
|
|
}
|
|
|
|
func NewCallTracer() *CallTracer {
|
|
return &CallTracer{
|
|
froms: map[common.Address]struct{}{},
|
|
tos: map[common.Address]struct{}{},
|
|
}
|
|
}
|
|
func (ct *CallTracer) Froms() map[common.Address]struct{} { return ct.froms }
|
|
func (ct *CallTracer) Tos() map[common.Address]struct{} { return ct.tos }
|
|
|
|
func (ct *CallTracer) CaptureTxStart(gasLimit uint64) {}
|
|
func (ct *CallTracer) CaptureTxEnd(restGas uint64) {}
|
|
func (ct *CallTracer) captureStartOrEnter(from, to common.Address) {
|
|
ct.froms[from] = struct{}{}
|
|
ct.tos[to] = struct{}{}
|
|
}
|
|
func (ct *CallTracer) CaptureStart(env *vm.EVM, from common.Address, to common.Address, precompile bool, create bool, input []byte, gas uint64, value *uint256.Int, code []byte) {
|
|
ct.captureStartOrEnter(from, to)
|
|
}
|
|
func (ct *CallTracer) CaptureEnter(typ vm.OpCode, from common.Address, to common.Address, precompile bool, create bool, input []byte, gas uint64, value *uint256.Int, code []byte) {
|
|
ct.captureStartOrEnter(from, to)
|
|
}
|
|
func (ct *CallTracer) CaptureState(pc uint64, op vm.OpCode, gas, cost uint64, scope *vm.ScopeContext, rData []byte, depth int, err error) {
|
|
}
|
|
func (ct *CallTracer) CaptureFault(pc uint64, op vm.OpCode, gas, cost uint64, scope *vm.ScopeContext, depth int, err error) {
|
|
}
|
|
func (ct *CallTracer) CaptureEnd(output []byte, startGas, endGas uint64, t time.Duration, err error) {
|
|
}
|
|
func (ct *CallTracer) CaptureExit(output []byte, startGas, endGas uint64, t time.Duration, err error) {
|
|
}
|
|
func (ct *CallTracer) CaptureSelfDestruct(from common.Address, to common.Address, value *uint256.Int) {
|
|
ct.froms[from] = struct{}{}
|
|
ct.tos[to] = struct{}{}
|
|
}
|
|
func (ct *CallTracer) CaptureAccountRead(account common.Address) error {
|
|
return nil
|
|
}
|
|
func (ct *CallTracer) CaptureAccountWrite(account common.Address) error {
|
|
return nil
|
|
}
|