From 39a38dc5f5e5f2e9acf372e2633f43b008cb41a3 Mon Sep 17 00:00:00 2001 From: Roman Khimov Date: Thu, 5 Nov 2020 21:48:20 +0300 Subject: [PATCH] transaction: raise max oracle response size Follow neo-project/neo#1984. --- pkg/core/transaction/oracle.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pkg/core/transaction/oracle.go b/pkg/core/transaction/oracle.go index 67c16fb83..0477373d5 100644 --- a/pkg/core/transaction/oracle.go +++ b/pkg/core/transaction/oracle.go @@ -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 }