stackitem: fix Buffer
deserialization
Fix incorrect application log for transaction in N3 testnet 8eb4076f1f1c07e693eda7e810779488a2d2b50aba9b727fd237cbc3adbec9e9 Signed-off-by: Evgeniy Stratonikov <evgeniy@nspcc.ru>
This commit is contained in:
parent
16a8edaa17
commit
8d67a03aec
2 changed files with 5 additions and 2 deletions
|
@ -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")),
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue