vm: omit context parameter from Call()

It's not used and should not be used to switch from contract to contract.
This commit is contained in:
Roman Khimov 2021-11-19 17:15:30 +03:00
parent 7b713762be
commit 765235eca3
5 changed files with 6 additions and 6 deletions

View file

@ -89,7 +89,7 @@ func invokeMethod(t *testing.T, method string, script []byte, v *vm.VM, di *comp
v.LoadScriptWithFlags(script, callflag.All) v.LoadScriptWithFlags(script, callflag.All)
v.Context().Jump(mainOffset) v.Context().Jump(mainOffset)
if initOffset >= 0 { if initOffset >= 0 {
v.Call(v.Context(), initOffset) v.Call(initOffset)
} }
} }

View file

@ -2191,7 +2191,7 @@ func (bc *Blockchain) InitVerificationVM(v *vm.VM, getContract func(util.Uint160
v.Context().Jump(md.Offset) v.Context().Jump(md.Offset)
if initMD != nil { if initMD != nil {
v.Call(v.Context(), initMD.Offset) v.Call(initMD.Offset)
} }
} }
if len(witness.InvocationScript) != 0 { if len(witness.InvocationScript) != 0 {

View file

@ -123,7 +123,7 @@ func callExFromNative(ic *interop.Context, caller util.Uint160, cs *state.Contra
md = cs.Manifest.ABI.GetMethod(manifest.MethodInit, 0) md = cs.Manifest.ABI.GetMethod(manifest.MethodInit, 0)
if md != nil { if md != nil {
ic.VM.Call(ic.VM.Context(), md.Offset) ic.VM.Call(md.Offset)
} }
return nil return nil

View file

@ -460,7 +460,7 @@ func handleRun(c *ishell.Context) {
} }
v.Context().Jump(offset) v.Context().Jump(offset)
if initMD := m.ABI.GetMethod(manifest.MethodInit, 0); initMD != nil { if initMD := m.ABI.GetMethod(manifest.MethodInit, 0); initMD != nil {
v.Call(v.Context(), initMD.Offset) v.Call(initMD.Offset)
} }
} }
} }

View file

@ -1557,8 +1557,8 @@ func (v *VM) throw(item stackitem.Item) {
} }
// Call calls method by offset using new execution context. // Call calls method by offset using new execution context.
func (v *VM) Call(ctx *Context, offset int) { func (v *VM) Call(offset int) {
v.call(ctx, offset) v.call(v.Context(), offset)
} }
// call is an internal representation of Call, which does not // call is an internal representation of Call, which does not