diff --git a/cli/nep11_test.go b/cli/nep11_test.go index a1d967cc9..519f152ce 100644 --- a/cli/nep11_test.go +++ b/cli/nep11_test.go @@ -312,7 +312,7 @@ func TestNEP11_OwnerOf_BalanceOf_Transfer(t *testing.T) { ScriptHash: verifyH, Name: "OnNEP11Payment", Item: stackitem.NewArray([]stackitem.Item{ - stackitem.NewByteArray(nftOwnerHash.BytesBE()), + stackitem.NewBuffer(nftOwnerHash.BytesBE()), stackitem.NewBigInteger(big.NewInt(1)), stackitem.NewByteArray(tokenID1), stackitem.NewByteArray([]byte("some_data")), diff --git a/pkg/vm/stackitem/serialization.go b/pkg/vm/stackitem/serialization.go index 3a40f4590..b30cb02c1 100644 --- a/pkg/vm/stackitem/serialization.go +++ b/pkg/vm/stackitem/serialization.go @@ -129,7 +129,10 @@ func decodeBinaryStackItem(r *io.BinReader, allowInvalid bool) Item { switch t { case ByteArrayT, BufferT: data := r.ReadVarBytes(MaxSize) - return NewByteArray(data) + if t == ByteArrayT { + return NewByteArray(data) + } + return NewBuffer(data) case BooleanT: var b = r.ReadBool() return NewBool(b)