From 74ffde83674f6a1af196ce7376816030c75bd0c5 Mon Sep 17 00:00:00 2001 From: Anna Shaleva Date: Wed, 15 Jul 2020 13:05:29 +0300 Subject: [PATCH] core: adjust System.Blockchain.GetTransactionFromBlock interop To match C# implementation, we should pick all arguments from stack first. --- pkg/core/interop_system.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/core/interop_system.go b/pkg/core/interop_system.go index 003c6acda..3d84b7d24 100644 --- a/pkg/core/interop_system.go +++ b/pkg/core/interop_system.go @@ -155,12 +155,12 @@ func bcGetTransactionFromBlock(ic *interop.Context, v *vm.VM) error { if err != nil { return err } + index := v.Estack().Pop().BigInt().Int64() block, err := ic.DAO.GetBlock(hash) if err != nil || !isTraceableBlock(ic, block.Index) { v.Estack().PushVal(stackitem.Null{}) return nil } - index := v.Estack().Pop().BigInt().Int64() if index < 0 || index >= int64(len(block.Transactions)) { return errors.New("wrong transaction index") }