core,eth: cancel evm on nativecalltracer stop

This commit is contained in:
Sina Mahmoodi
2021-11-04 21:01:41 +01:00
parent a83925989f
commit 01bb908790
9 changed files with 19 additions and 17 deletions

View File

@@ -255,8 +255,10 @@ func TestEnterExit(t *testing.T) {
scope := &vm.ScopeContext{
Contract: vm.NewContract(&account{}, &account{}, big.NewInt(0), 0),
}
vmctx := testCtx()
env := vm.NewEVM(vmctx.blockCtx, vmctx.txCtx, &dummyStatedb{}, params.TestChainConfig, vm.Config{Debug: true, Tracer: tracer})
tracer.CaptureEnter(vm.CALL, scope.Contract.Caller(), scope.Contract.Address(), []byte{}, 1000, new(big.Int))
tracer.CaptureEnter(env, vm.CALL, scope.Contract.Caller(), scope.Contract.Address(), []byte{}, 1000, new(big.Int))
tracer.CaptureExit([]byte{}, 400, nil)
have, err := tracer.GetResult()