transaction: raise max oracle response size

Follow neo-project/neo#1984.
This commit is contained in:
Roman Khimov 2020-11-05 21:48:20 +03:00
parent 679846c1a1
commit 39a38dc5f5

View file

@ -2,6 +2,7 @@ package transaction
import (
"errors"
"math"
"github.com/nspcc-dev/neo-go/pkg/io"
)
@ -16,7 +17,8 @@ type OracleResponse struct {
Result []byte `json:"result"`
}
const maxResultSize = 1024
// MaxOracleResultSize is the maximum allowed oracle answer size.
const MaxOracleResultSize = math.MaxUint16
// Enumeration of possible oracle response types.
const (
@ -46,7 +48,7 @@ func (r *OracleResponse) DecodeBinary(br *io.BinReader) {
br.Err = ErrInvalidResponseCode
return
}
r.Result = br.ReadVarBytes(maxResultSize)
r.Result = br.ReadVarBytes(MaxOracleResultSize)
if r.Code != Success && len(r.Result) > 0 {
br.Err = ErrInvalidResult
}