From ef114d627471d6f33f775ccd4b58ee6b80a0869e Mon Sep 17 00:00:00 2001 From: Anna Shaleva Date: Fri, 8 Jul 2022 16:32:00 +0300 Subject: [PATCH] rpc: fail invoke.Result unmarshalling on stack unmarshalling error --- pkg/rpc/response/result/invoke.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pkg/rpc/response/result/invoke.go b/pkg/rpc/response/result/invoke.go index 65100693f..5f84ba5cc 100644 --- a/pkg/rpc/response/result/invoke.go +++ b/pkg/rpc/response/result/invoke.go @@ -270,9 +270,10 @@ func (r *Invoke) UnmarshalJSON(data []byte) error { } } } - if err == nil { - r.Stack = st + if err != nil { + return fmt.Errorf("failed to unmarshal stack: %w", err) } + r.Stack = st } var tx *transaction.Transaction if len(aux.Transaction) != 0 {