Merge pull request #1148 from nspcc-dev/neo3/stackitem/serialisation
vm: fix stackitem deserialisation
This commit is contained in:
commit
cb18cd0893
2 changed files with 4 additions and 3 deletions
|
@ -488,7 +488,7 @@ func (s *Server) getApplicationLog(reqParams request.Params) (interface{}, *resp
|
||||||
|
|
||||||
appExecResult, err := s.chain.GetAppExecResult(txHash)
|
appExecResult, err := s.chain.GetAppExecResult(txHash)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, response.NewRPCError("Unknown transaction", "", nil)
|
return nil, response.NewRPCError("Unknown transaction", "", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
return result.NewApplicationLog(appExecResult), nil
|
return result.NewApplicationLog(appExecResult), nil
|
||||||
|
|
|
@ -2,6 +2,7 @@ package stackitem
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"errors"
|
"errors"
|
||||||
|
"fmt"
|
||||||
"math/big"
|
"math/big"
|
||||||
|
|
||||||
"github.com/nspcc-dev/neo-go/pkg/encoding/bigint"
|
"github.com/nspcc-dev/neo-go/pkg/encoding/bigint"
|
||||||
|
@ -96,7 +97,7 @@ func DecodeBinaryStackItem(r *io.BinReader) Item {
|
||||||
}
|
}
|
||||||
|
|
||||||
switch t {
|
switch t {
|
||||||
case ByteArrayT:
|
case ByteArrayT, BufferT:
|
||||||
data := r.ReadVarBytes()
|
data := r.ReadVarBytes()
|
||||||
return NewByteArray(data)
|
return NewByteArray(data)
|
||||||
case BooleanT:
|
case BooleanT:
|
||||||
|
@ -132,7 +133,7 @@ func DecodeBinaryStackItem(r *io.BinReader) Item {
|
||||||
case AnyT:
|
case AnyT:
|
||||||
return Null{}
|
return Null{}
|
||||||
default:
|
default:
|
||||||
r.Err = errors.New("unknown type")
|
r.Err = fmt.Errorf("unknown type: %v", t)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue