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.Context().Jump(mainOffset)
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)
if initMD != nil {
v.Call(v.Context(), initMD.Offset)
v.Call(initMD.Offset)
}
}
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)
if md != nil {
ic.VM.Call(ic.VM.Context(), md.Offset)
ic.VM.Call(md.Offset)
}
return nil

View file

@ -460,7 +460,7 @@ func handleRun(c *ishell.Context) {
}
v.Context().Jump(offset)
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.
func (v *VM) Call(ctx *Context, offset int) {
v.call(ctx, offset)
func (v *VM) Call(offset int) {
v.call(v.Context(), offset)
}
// call is an internal representation of Call, which does not