vm, core: move invocation counter from InteropContext to VM

This commit is contained in:
Anna Shaleva 2020-10-05 13:08:55 +03:00
parent 45bfce60a5
commit 6ce00fde82
5 changed files with 8 additions and 6 deletions

View file

@ -59,10 +59,10 @@ func GetNotifications(ic *interop.Context) error {
// GetInvocationCounter returns how many times current contract was invoked during current tx execution.
func GetInvocationCounter(ic *interop.Context) error {
currentScriptHash := ic.VM.GetCurrentScriptHash()
count, ok := ic.Invocations[currentScriptHash]
count, ok := ic.VM.Invocations[currentScriptHash]
if !ok {
count = 1
ic.Invocations[currentScriptHash] = count
ic.VM.Invocations[currentScriptHash] = count
}
ic.VM.Estack().PushVal(count)
return nil