Commit 115ce5fb authored by Levin Zimmermann's avatar Levin Zimmermann

go/proto/msgpack: Simplify debugging by printing function name in case of overflow

parent b59f0b04
......@@ -44,7 +44,7 @@ func (e *mstructDecodeError) Error() string {
// mdecodeErr is called to normilize error when msgp.ReadXXX returns err when decoding path.
func mdecodeErr(path string, err error) error {
if err == msgp.ErrShortBytes {
return ErrDecodeOverflow
return &ErrDecodeOverflow{path}
}
return &mdecodeError{path, err}
}
......
......@@ -228,3 +228,12 @@ func (addr Address) String() string {
return net.JoinHostPort(addr.Host, fmt.Sprintf("%d", addr.Port))
}
}
// ErrDecodeOverflow is the error returned by neoMsgDecode when decoding hits buffer overflow
type ErrDecodeOverflow struct {
function string
}
func (e *ErrDecodeOverflow) Error() string {
return fmt.Sprintf("decode '%s': buffer overflow", e.function)
}
......@@ -70,7 +70,6 @@ import (
"lab.nexedi.com/kirr/neo/go/internal/packed"
"encoding/binary"
"errors"
"math"
)
......@@ -168,9 +167,6 @@ func (e Encoding) MsgDecode(msg Msg, data []byte) (nread int, err error) {
}
// ErrDecodeOverflow is the error returned by neoMsgDecode when decoding hits buffer overflow
var ErrDecodeOverflow = errors.New("decode: buffer overflow")
// ---- messages ----
//neo:proto enum
......
......@@ -22,6 +22,7 @@ package proto
import (
"encoding/binary"
"errors"
hexpkg "encoding/hex"
"fmt"
"reflect"
......@@ -152,7 +153,8 @@ func testMsgMarshal(t *testing.T, enc Encoding, msg Msg, encoded string) {
// decode must detect buffer overflow
for l := len(encoded) - 1; l >= 0; l-- {
n, err = enc.MsgDecode(msg2, data[:l])
if !(n == 0 && err == ErrDecodeOverflow) {
errDecodeOverflow := new(ErrDecodeOverflow)
if !(n == 0 && errors.As(err, &errDecodeOverflow)) {
t.Errorf("%c/%v: decode overflow not detected on [:%v]", enc, typ, l)
}
......@@ -429,9 +431,10 @@ func TestMsgDecodeLenOverflowN(t *testing.T) {
}()
n, err := enc.MsgDecode(tt.msg, data)
if !(n == 0 && err == ErrDecodeOverflow) {
errDecodeOverflow := new(ErrDecodeOverflow)
if !(n == 0 && errors.As(err, &errDecodeOverflow)) {
t.Errorf("%T: decode %x\nhave: %d, %v\nwant: %d, %v", tt.msg, data,
n, err, 0, ErrDecodeOverflow)
n, err, 0, errDecodeOverflow)
}
}()
}
......
......@@ -320,6 +320,7 @@ package proto
import (
"encoding/binary"
"errors"
"math"
"reflect"
"sort"
......@@ -917,7 +918,7 @@ func (d *decoderCommon) generatedCode() string {
// NOTE for >0 check actual X in StdSizes{X} does not particularly matter
if ((&types.StdSizes{8, 8}).Sizeof(d.typ) > 0 || d.enc != 'N') && d.overflow.gotoEmitted {
code.emit("\noverflow:")
code.emit("return 0, ErrDecodeOverflow")
code.emit("return 0, &ErrDecodeOverflow{\"%s\"}", d.typeName)
}
code.emit("}\n")
......@@ -1155,7 +1156,8 @@ func (d *decoderM) genBasic(assignto string, typ *types.Basic, userType types.Ty
// correct float, but data is too short - catch this to return
// 'ErrDecodeOverflow' instead of type error.
d.emit(" err = mdecodeErr(%q, err)", d.pathName(assignto))
d.emit(" if err == ErrDecodeOverflow {")
d.emit(" errDecodeOverflow := new(ErrDecodeOverflow)")
d.emit(" if errors.As(err, &errDecodeOverflow) {")
d.emit(" return 0, err")
d.emit(" }")
d.emit(" tail, err = msgp.ReadNilBytes(data)")
......
......@@ -6,6 +6,7 @@ package proto
import (
"encoding/binary"
"errors"
"math"
"reflect"
"sort"
......@@ -59,7 +60,7 @@ func (p *Error) neoMsgDecodeN(data []byte) (int, error) {
return 8 + int(nread), nil
overflow:
return 0, ErrDecodeOverflow
return 0, &ErrDecodeOverflow{"Error"}
}
func (p *Error) neoMsgEncodedLenM() int {
......@@ -122,7 +123,7 @@ func (p *Error) neoMsgDecodeM(data []byte) (int, error) {
return 3 + int(nread), nil
overflow:
return 0, ErrDecodeOverflow
return 0, &ErrDecodeOverflow{"Error"}
}
// 1. RequestIdentification
......@@ -267,7 +268,7 @@ func (p *RequestIdentification) neoMsgDecodeN(data []byte) (int, error) {
return 17 + int(nread), nil
overflow:
return 0, ErrDecodeOverflow
return 0, &ErrDecodeOverflow{"RequestIdentification"}
}
func (p *RequestIdentification) neoMsgEncodedLenM() int {
......@@ -420,7 +421,8 @@ func (p *RequestIdentification) neoMsgDecodeM(data []byte) (int, error) {
v, tail, err := msgp.ReadFloat64Bytes(data)
if err != nil {
err = mdecodeErr("RequestIdentification.IdTime", err)
if err == ErrDecodeOverflow {
errDecodeOverflow := new(ErrDecodeOverflow)
if errors.As(err, &errDecodeOverflow) {
return 0, err
}
tail, err = msgp.ReadNilBytes(data)
......@@ -478,7 +480,7 @@ func (p *RequestIdentification) neoMsgDecodeM(data []byte) (int, error) {
return 3 + int(nread), nil
overflow:
return 0, ErrDecodeOverflow
return 0, &ErrDecodeOverflow{"RequestIdentification"}
}
// 1 | answerBit. AcceptIdentification
......@@ -507,7 +509,7 @@ func (p *AcceptIdentification) neoMsgDecodeN(data []byte) (int, error) {
return 9, nil
overflow:
return 0, ErrDecodeOverflow
return 0, &ErrDecodeOverflow{"AcceptIdentification"}
}
func (p *AcceptIdentification) neoMsgEncodedLenM() int {
......@@ -580,7 +582,7 @@ func (p *AcceptIdentification) neoMsgDecodeM(data []byte) (int, error) {
return 3 + int(nread), nil
overflow:
return 0, ErrDecodeOverflow
return 0, &ErrDecodeOverflow{"AcceptIdentification"}
}
// 3. Ping
......@@ -757,7 +759,7 @@ func (p *AnswerPrimary) neoMsgDecodeN(data []byte) (int, error) {
return 4, nil
overflow:
return 0, ErrDecodeOverflow
return 0, &ErrDecodeOverflow{"AnswerPrimary"}
}
func (p *AnswerPrimary) neoMsgEncodedLenM() int {
......@@ -850,7 +852,7 @@ func (p *NotPrimaryMaster) neoMsgDecodeN(data []byte) (int, error) {
return 8 + int(nread), nil
overflow:
return 0, ErrDecodeOverflow
return 0, &ErrDecodeOverflow{"NotPrimaryMaster"}
}
func (p *NotPrimaryMaster) neoMsgEncodedLenM() int {
......@@ -1052,7 +1054,7 @@ func (p *NotifyNodeInformation) neoMsgDecodeN(data []byte) (int, error) {
return 4 + int(nread), nil
overflow:
return 0, ErrDecodeOverflow
return 0, &ErrDecodeOverflow{"NotifyNodeInformation"}
}
func (p *NotifyNodeInformation) neoMsgEncodedLenM() int {
......@@ -1124,7 +1126,8 @@ func (p *NotifyNodeInformation) neoMsgDecodeM(data []byte) (int, error) {
v, tail, err := msgp.ReadFloat64Bytes(data)
if err != nil {
err = mdecodeErr("NotifyNodeInformation.IdTime", err)
if err == ErrDecodeOverflow {
errDecodeOverflow := new(ErrDecodeOverflow)
if errors.As(err, &errDecodeOverflow) {
return 0, err
}
tail, err = msgp.ReadNilBytes(data)
......@@ -1228,7 +1231,8 @@ func (p *NotifyNodeInformation) neoMsgDecodeM(data []byte) (int, error) {
v, tail, err := msgp.ReadFloat64Bytes(data)
if err != nil {
err = mdecodeErr("NotifyNodeInformation.IdTime", err)
if err == ErrDecodeOverflow {
errDecodeOverflow := new(ErrDecodeOverflow)
if errors.As(err, &errDecodeOverflow) {
return 0, err
}
tail, err = msgp.ReadNilBytes(data)
......@@ -1247,7 +1251,7 @@ func (p *NotifyNodeInformation) neoMsgDecodeM(data []byte) (int, error) {
return 0 + int(nread), nil
overflow:
return 0, ErrDecodeOverflow
return 0, &ErrDecodeOverflow{"NotifyNodeInformation"}
}
// 10. Recovery
......@@ -1314,7 +1318,7 @@ func (p *AnswerRecovery) neoMsgDecodeN(data []byte) (int, error) {
return 24, nil
overflow:
return 0, ErrDecodeOverflow
return 0, &ErrDecodeOverflow{"AnswerRecovery"}
}
func (p *AnswerRecovery) neoMsgEncodedLenM() int {
......@@ -1414,7 +1418,7 @@ func (p *AnswerRecovery) neoMsgDecodeM(data []byte) (int, error) {
return 0 + int(nread), nil
overflow:
return 0, ErrDecodeOverflow
return 0, &ErrDecodeOverflow{"AnswerRecovery"}
}
// 12. LastIDs
......@@ -1479,7 +1483,7 @@ func (p *AnswerLastIDs) neoMsgDecodeN(data []byte) (int, error) {
return 16, nil
overflow:
return 0, ErrDecodeOverflow
return 0, &ErrDecodeOverflow{"AnswerLastIDs"}
}
func (p *AnswerLastIDs) neoMsgEncodedLenM() int {
......@@ -1566,7 +1570,7 @@ func (p *AnswerLastIDs) neoMsgDecodeM(data []byte) (int, error) {
return 0 + int(nread), nil
overflow:
return 0, ErrDecodeOverflow
return 0, &ErrDecodeOverflow{"AnswerLastIDs"}
}
// 14. AskPartitionTable
......@@ -1683,7 +1687,7 @@ func (p *AnswerPartitionTable) neoMsgDecodeN(data []byte) (int, error) {
return 16 + int(nread), nil
overflow:
return 0, ErrDecodeOverflow
return 0, &ErrDecodeOverflow{"AnswerPartitionTable"}
}
func (p *AnswerPartitionTable) neoMsgEncodedLenM() int {
......@@ -1829,7 +1833,7 @@ func (p *AnswerPartitionTable) neoMsgDecodeM(data []byte) (int, error) {
return 0 + int(nread), nil
overflow:
return 0, ErrDecodeOverflow
return 0, &ErrDecodeOverflow{"AnswerPartitionTable"}
}
// 16. SendPartitionTable
......@@ -1908,7 +1912,7 @@ func (p *SendPartitionTable) neoMsgDecodeN(data []byte) (int, error) {
return 16 + int(nread), nil
overflow:
return 0, ErrDecodeOverflow
return 0, &ErrDecodeOverflow{"SendPartitionTable"}
}
func (p *SendPartitionTable) neoMsgEncodedLenM() int {
......@@ -2054,7 +2058,7 @@ func (p *SendPartitionTable) neoMsgDecodeM(data []byte) (int, error) {
return 0 + int(nread), nil
overflow:
return 0, ErrDecodeOverflow
return 0, &ErrDecodeOverflow{"SendPartitionTable"}
}
// 17. NotifyPartitionChanges
......@@ -2113,7 +2117,7 @@ func (p *NotifyPartitionChanges) neoMsgDecodeN(data []byte) (int, error) {
return 16 + int(nread), nil
overflow:
return 0, ErrDecodeOverflow
return 0, &ErrDecodeOverflow{"NotifyPartitionChanges"}
}
func (p *NotifyPartitionChanges) neoMsgEncodedLenM() int {
......@@ -2260,7 +2264,7 @@ func (p *NotifyPartitionChanges) neoMsgDecodeM(data []byte) (int, error) {
return 0 + int(nread), nil
overflow:
return 0, ErrDecodeOverflow
return 0, &ErrDecodeOverflow{"NotifyPartitionChanges"}
}
// 18. StartOperation
......@@ -2285,7 +2289,7 @@ func (p *StartOperation) neoMsgDecodeN(data []byte) (int, error) {
return 1, nil
overflow:
return 0, ErrDecodeOverflow
return 0, &ErrDecodeOverflow{"StartOperation"}
}
func (p *StartOperation) neoMsgEncodedLenM() int {
......@@ -2321,7 +2325,7 @@ func (p *StartOperation) neoMsgDecodeM(data []byte) (int, error) {
return 1 + int(nread), nil
overflow:
return 0, ErrDecodeOverflow
return 0, &ErrDecodeOverflow{"StartOperation"}
}
// 19. StopOperation
......@@ -2407,7 +2411,7 @@ func (p *UnfinishedTransactions) neoMsgDecodeN(data []byte) (int, error) {
return 4 + int(nread), nil
overflow:
return 0, ErrDecodeOverflow
return 0, &ErrDecodeOverflow{"UnfinishedTransactions"}
}
func (p *UnfinishedTransactions) neoMsgEncodedLenM() int {
......@@ -2525,7 +2529,7 @@ func (p *AnswerUnfinishedTransactions) neoMsgDecodeN(data []byte) (int, error) {
return 12 + int(nread), nil
overflow:
return 0, ErrDecodeOverflow
return 0, &ErrDecodeOverflow{"AnswerUnfinishedTransactions"}
}
func (p *AnswerUnfinishedTransactions) neoMsgEncodedLenM() int {
......@@ -2645,7 +2649,7 @@ func (p *AnswerUnfinishedTransactions) neoMsgDecodeM(data []byte) (int, error) {
return 0 + int(nread), nil
overflow:
return 0, ErrDecodeOverflow
return 0, &ErrDecodeOverflow{"AnswerUnfinishedTransactions"}
}
// 22. LockedTransactions
......@@ -2738,7 +2742,7 @@ func (p *AnswerLockedTransactions) neoMsgDecodeN(data []byte) (int, error) {
return 4 + int(nread), nil
overflow:
return 0, ErrDecodeOverflow
return 0, &ErrDecodeOverflow{"AnswerLockedTransactions"}
}
func (p *AnswerLockedTransactions) neoMsgEncodedLenM() int {
......@@ -2835,7 +2839,7 @@ func (p *AnswerLockedTransactions) neoMsgDecodeM(data []byte) (int, error) {
return 0 + int(nread), nil
overflow:
return 0, ErrDecodeOverflow
return 0, &ErrDecodeOverflow{"AnswerLockedTransactions"}
}
// 24. FinalTID
......@@ -2860,7 +2864,7 @@ func (p *FinalTID) neoMsgDecodeN(data []byte) (int, error) {
return 8, nil
overflow:
return 0, ErrDecodeOverflow
return 0, &ErrDecodeOverflow{"FinalTID"}
}
func (p *FinalTID) neoMsgEncodedLenM() int {
......@@ -2916,7 +2920,7 @@ func (p *FinalTID) neoMsgDecodeM(data []byte) (int, error) {
return 0 + int(nread), nil
overflow:
return 0, ErrDecodeOverflow
return 0, &ErrDecodeOverflow{"FinalTID"}
}
// 24 | answerBit. AnswerFinalTID
......@@ -2941,7 +2945,7 @@ func (p *AnswerFinalTID) neoMsgDecodeN(data []byte) (int, error) {
return 8, nil
overflow:
return 0, ErrDecodeOverflow
return 0, &ErrDecodeOverflow{"AnswerFinalTID"}
}
func (p *AnswerFinalTID) neoMsgEncodedLenM() int {
......@@ -2997,7 +3001,7 @@ func (p *AnswerFinalTID) neoMsgDecodeM(data []byte) (int, error) {
return 0 + int(nread), nil
overflow:
return 0, ErrDecodeOverflow
return 0, &ErrDecodeOverflow{"AnswerFinalTID"}
}
// 26. ValidateTransaction
......@@ -3024,7 +3028,7 @@ func (p *ValidateTransaction) neoMsgDecodeN(data []byte) (int, error) {
return 16, nil
overflow:
return 0, ErrDecodeOverflow
return 0, &ErrDecodeOverflow{"ValidateTransaction"}
}
func (p *ValidateTransaction) neoMsgEncodedLenM() int {
......@@ -3111,7 +3115,7 @@ func (p *ValidateTransaction) neoMsgDecodeM(data []byte) (int, error) {
return 0 + int(nread), nil
overflow:
return 0, ErrDecodeOverflow
return 0, &ErrDecodeOverflow{"ValidateTransaction"}
}
// 27. BeginTransaction
......@@ -3136,7 +3140,7 @@ func (p *BeginTransaction) neoMsgDecodeN(data []byte) (int, error) {
return 8, nil
overflow:
return 0, ErrDecodeOverflow
return 0, &ErrDecodeOverflow{"BeginTransaction"}
}
func (p *BeginTransaction) neoMsgEncodedLenM() int {
......@@ -3192,7 +3196,7 @@ func (p *BeginTransaction) neoMsgDecodeM(data []byte) (int, error) {
return 0 + int(nread), nil
overflow:
return 0, ErrDecodeOverflow
return 0, &ErrDecodeOverflow{"BeginTransaction"}
}
// 27 | answerBit. AnswerBeginTransaction
......@@ -3217,7 +3221,7 @@ func (p *AnswerBeginTransaction) neoMsgDecodeN(data []byte) (int, error) {
return 8, nil
overflow:
return 0, ErrDecodeOverflow
return 0, &ErrDecodeOverflow{"AnswerBeginTransaction"}
}
func (p *AnswerBeginTransaction) neoMsgEncodedLenM() int {
......@@ -3273,7 +3277,7 @@ func (p *AnswerBeginTransaction) neoMsgDecodeM(data []byte) (int, error) {
return 0 + int(nread), nil
overflow:
return 0, ErrDecodeOverflow
return 0, &ErrDecodeOverflow{"AnswerBeginTransaction"}
}
// 29. FailedVote
......@@ -3323,7 +3327,7 @@ func (p *FailedVote) neoMsgDecodeN(data []byte) (int, error) {
return 12 + int(nread), nil
overflow:
return 0, ErrDecodeOverflow
return 0, &ErrDecodeOverflow{"FailedVote"}
}
func (p *FailedVote) neoMsgEncodedLenM() int {
......@@ -3416,7 +3420,7 @@ func (p *FailedVote) neoMsgDecodeM(data []byte) (int, error) {
return 0 + int(nread), nil
overflow:
return 0, ErrDecodeOverflow
return 0, &ErrDecodeOverflow{"FailedVote"}
}
// 30. FinishTransaction
......@@ -3490,7 +3494,7 @@ func (p *FinishTransaction) neoMsgDecodeN(data []byte) (int, error) {
return 12 + int(nread), nil
overflow:
return 0, ErrDecodeOverflow
return 0, &ErrDecodeOverflow{"FinishTransaction"}
}
func (p *FinishTransaction) neoMsgEncodedLenM() int {
......@@ -3638,7 +3642,7 @@ func (p *FinishTransaction) neoMsgDecodeM(data []byte) (int, error) {
return 0 + int(nread), nil
overflow:
return 0, ErrDecodeOverflow
return 0, &ErrDecodeOverflow{"FinishTransaction"}
}
// 30 | answerBit. AnswerTransactionFinished
......@@ -3665,7 +3669,7 @@ func (p *AnswerTransactionFinished) neoMsgDecodeN(data []byte) (int, error) {
return 16, nil
overflow:
return 0, ErrDecodeOverflow
return 0, &ErrDecodeOverflow{"AnswerTransactionFinished"}
}
func (p *AnswerTransactionFinished) neoMsgEncodedLenM() int {
......@@ -3752,7 +3756,7 @@ func (p *AnswerTransactionFinished) neoMsgDecodeM(data []byte) (int, error) {
return 0 + int(nread), nil
overflow:
return 0, ErrDecodeOverflow
return 0, &ErrDecodeOverflow{"AnswerTransactionFinished"}
}
// 32. LockInformation
......@@ -3779,7 +3783,7 @@ func (p *LockInformation) neoMsgDecodeN(data []byte) (int, error) {
return 16, nil
overflow:
return 0, ErrDecodeOverflow
return 0, &ErrDecodeOverflow{"LockInformation"}
}
func (p *LockInformation) neoMsgEncodedLenM() int {
......@@ -3866,7 +3870,7 @@ func (p *LockInformation) neoMsgDecodeM(data []byte) (int, error) {
return 0 + int(nread), nil
overflow:
return 0, ErrDecodeOverflow
return 0, &ErrDecodeOverflow{"LockInformation"}
}
// 32 | answerBit. AnswerInformationLocked
......@@ -3891,7 +3895,7 @@ func (p *AnswerInformationLocked) neoMsgDecodeN(data []byte) (int, error) {
return 8, nil
overflow:
return 0, ErrDecodeOverflow
return 0, &ErrDecodeOverflow{"AnswerInformationLocked"}
}
func (p *AnswerInformationLocked) neoMsgEncodedLenM() int {
......@@ -3947,7 +3951,7 @@ func (p *AnswerInformationLocked) neoMsgDecodeM(data []byte) (int, error) {
return 0 + int(nread), nil
overflow:
return 0, ErrDecodeOverflow
return 0, &ErrDecodeOverflow{"AnswerInformationLocked"}
}
// 34. InvalidateObjects
......@@ -3997,7 +4001,7 @@ func (p *InvalidateObjects) neoMsgDecodeN(data []byte) (int, error) {
return 12 + int(nread), nil
overflow:
return 0, ErrDecodeOverflow
return 0, &ErrDecodeOverflow{"InvalidateObjects"}
}
func (p *InvalidateObjects) neoMsgEncodedLenM() int {
......@@ -4099,7 +4103,7 @@ func (p *InvalidateObjects) neoMsgDecodeM(data []byte) (int, error) {
return 0 + int(nread), nil
overflow:
return 0, ErrDecodeOverflow
return 0, &ErrDecodeOverflow{"InvalidateObjects"}
}
// 35. NotifyUnlockInformation
......@@ -4124,7 +4128,7 @@ func (p *NotifyUnlockInformation) neoMsgDecodeN(data []byte) (int, error) {
return 8, nil
overflow:
return 0, ErrDecodeOverflow
return 0, &ErrDecodeOverflow{"NotifyUnlockInformation"}
}
func (p *NotifyUnlockInformation) neoMsgEncodedLenM() int {
......@@ -4180,7 +4184,7 @@ func (p *NotifyUnlockInformation) neoMsgDecodeM(data []byte) (int, error) {
return 0 + int(nread), nil
overflow:
return 0, ErrDecodeOverflow
return 0, &ErrDecodeOverflow{"NotifyUnlockInformation"}
}
// 36. AskNewOIDs
......@@ -4205,7 +4209,7 @@ func (p *AskNewOIDs) neoMsgDecodeN(data []byte) (int, error) {
return 4, nil
overflow:
return 0, ErrDecodeOverflow
return 0, &ErrDecodeOverflow{"AskNewOIDs"}
}
func (p *AskNewOIDs) neoMsgEncodedLenM() int {
......@@ -4287,7 +4291,7 @@ func (p *AnswerNewOIDs) neoMsgDecodeN(data []byte) (int, error) {
return 4 + int(nread), nil
overflow:
return 0, ErrDecodeOverflow
return 0, &ErrDecodeOverflow{"AnswerNewOIDs"}
}
func (p *AnswerNewOIDs) neoMsgEncodedLenM() int {
......@@ -4357,7 +4361,7 @@ func (p *AnswerNewOIDs) neoMsgDecodeM(data []byte) (int, error) {
return 0 + int(nread), nil
overflow:
return 0, ErrDecodeOverflow
return 0, &ErrDecodeOverflow{"AnswerNewOIDs"}
}
// 38. NotifyDeadlock
......@@ -4384,7 +4388,7 @@ func (p *NotifyDeadlock) neoMsgDecodeN(data []byte) (int, error) {
return 16, nil
overflow:
return 0, ErrDecodeOverflow
return 0, &ErrDecodeOverflow{"NotifyDeadlock"}
}
func (p *NotifyDeadlock) neoMsgEncodedLenM() int {
......@@ -4471,7 +4475,7 @@ func (p *NotifyDeadlock) neoMsgDecodeM(data []byte) (int, error) {
return 0 + int(nread), nil
overflow:
return 0, ErrDecodeOverflow
return 0, &ErrDecodeOverflow{"NotifyDeadlock"}
}
// 39. RebaseTransaction
......@@ -4498,7 +4502,7 @@ func (p *RebaseTransaction) neoMsgDecodeN(data []byte) (int, error) {
return 16, nil
overflow:
return 0, ErrDecodeOverflow
return 0, &ErrDecodeOverflow{"RebaseTransaction"}
}
func (p *RebaseTransaction) neoMsgEncodedLenM() int {
......@@ -4585,7 +4589,7 @@ func (p *RebaseTransaction) neoMsgDecodeM(data []byte) (int, error) {
return 0 + int(nread), nil
overflow:
return 0, ErrDecodeOverflow
return 0, &ErrDecodeOverflow{"RebaseTransaction"}
}
// 39 | answerBit. AnswerRebaseTransaction
......@@ -4633,7 +4637,7 @@ func (p *AnswerRebaseTransaction) neoMsgDecodeN(data []byte) (int, error) {
return 4 + int(nread), nil
overflow:
return 0, ErrDecodeOverflow
return 0, &ErrDecodeOverflow{"AnswerRebaseTransaction"}
}
func (p *AnswerRebaseTransaction) neoMsgEncodedLenM() int {
......@@ -4703,7 +4707,7 @@ func (p *AnswerRebaseTransaction) neoMsgDecodeM(data []byte) (int, error) {
return 0 + int(nread), nil
overflow:
return 0, ErrDecodeOverflow
return 0, &ErrDecodeOverflow{"AnswerRebaseTransaction"}
}
// 41. RebaseObject
......@@ -4730,7 +4734,7 @@ func (p *RebaseObject) neoMsgDecodeN(data []byte) (int, error) {
return 16, nil
overflow:
return 0, ErrDecodeOverflow
return 0, &ErrDecodeOverflow{"RebaseObject"}
}
func (p *RebaseObject) neoMsgEncodedLenM() int {
......@@ -4817,7 +4821,7 @@ func (p *RebaseObject) neoMsgDecodeM(data []byte) (int, error) {
return 0 + int(nread), nil
overflow:
return 0, ErrDecodeOverflow
return 0, &ErrDecodeOverflow{"RebaseObject"}
}
// 41 | answerBit. AnswerRebaseObject
......@@ -4867,7 +4871,7 @@ func (p *AnswerRebaseObject) neoMsgDecodeN(data []byte) (int, error) {
return 41 + int(nread), nil
overflow:
return 0, ErrDecodeOverflow
return 0, &ErrDecodeOverflow{"AnswerRebaseObject"}
}
func (p *AnswerRebaseObject) neoMsgEncodedLenM() int {
......@@ -4969,7 +4973,8 @@ func (p *AnswerRebaseObject) neoMsgDecodeM(data []byte) (int, error) {
v, tail, err := msgp.ReadUint64Bytes(data)
if err != nil {
err = mdecodeErr("AnswerRebaseObject.Compression", err)
if err == ErrDecodeOverflow {
errDecodeOverflow := new(ErrDecodeOverflow)
if errors.As(err, &errDecodeOverflow) {
return 0, err
}
tail, err = msgp.ReadNilBytes(data)
......@@ -5006,7 +5011,7 @@ func (p *AnswerRebaseObject) neoMsgDecodeM(data []byte) (int, error) {
return 22 + int(nread), nil
overflow:
return 0, ErrDecodeOverflow
return 0, &ErrDecodeOverflow{"AnswerRebaseObject"}
}
// 43. StoreObject
......@@ -5060,7 +5065,7 @@ func (p *StoreObject) neoMsgDecodeN(data []byte) (int, error) {
return 41 + int(nread), nil
overflow:
return 0, ErrDecodeOverflow
return 0, &ErrDecodeOverflow{"StoreObject"}
}
func (p *StoreObject) neoMsgEncodedLenM() int {
......@@ -5190,7 +5195,8 @@ func (p *StoreObject) neoMsgDecodeM(data []byte) (int, error) {
v, tail, err := msgp.ReadUint64Bytes(data)
if err != nil {
err = mdecodeErr("StoreObject.Compression", err)
if err == ErrDecodeOverflow {
errDecodeOverflow := new(ErrDecodeOverflow)
if errors.As(err, &errDecodeOverflow) {
return 0, err
}
tail, err = msgp.ReadNilBytes(data)
......@@ -5261,7 +5267,7 @@ func (p *StoreObject) neoMsgDecodeM(data []byte) (int, error) {
return 22 + int(nread), nil
overflow:
return 0, ErrDecodeOverflow
return 0, &ErrDecodeOverflow{"StoreObject"}
}
// 43 | answerBit. AnswerStoreObject
......@@ -5286,7 +5292,7 @@ func (p *AnswerStoreObject) neoMsgDecodeN(data []byte) (int, error) {
return 8, nil
overflow:
return 0, ErrDecodeOverflow
return 0, &ErrDecodeOverflow{"AnswerStoreObject"}
}
func (p *AnswerStoreObject) neoMsgEncodedLenM() int {
......@@ -5342,7 +5348,7 @@ func (p *AnswerStoreObject) neoMsgDecodeM(data []byte) (int, error) {
return 0 + int(nread), nil
overflow:
return 0, ErrDecodeOverflow
return 0, &ErrDecodeOverflow{"AnswerStoreObject"}
}
// 45. AbortTransaction
......@@ -5392,7 +5398,7 @@ func (p *AbortTransaction) neoMsgDecodeN(data []byte) (int, error) {
return 12 + int(nread), nil
overflow:
return 0, ErrDecodeOverflow
return 0, &ErrDecodeOverflow{"AbortTransaction"}
}
func (p *AbortTransaction) neoMsgEncodedLenM() int {
......@@ -5485,7 +5491,7 @@ func (p *AbortTransaction) neoMsgDecodeM(data []byte) (int, error) {
return 0 + int(nread), nil
overflow:
return 0, ErrDecodeOverflow
return 0, &ErrDecodeOverflow{"AbortTransaction"}
}
// 46. StoreTransaction
......@@ -5586,7 +5592,7 @@ func (p *StoreTransaction) neoMsgDecodeN(data []byte) (int, error) {
return 12 + int(nread), nil
overflow:
return 0, ErrDecodeOverflow
return 0, &ErrDecodeOverflow{"StoreTransaction"}
}
func (p *StoreTransaction) neoMsgEncodedLenM() int {
......@@ -5736,7 +5742,7 @@ func (p *StoreTransaction) neoMsgDecodeM(data []byte) (int, error) {
return 0 + int(nread), nil
overflow:
return 0, ErrDecodeOverflow
return 0, &ErrDecodeOverflow{"StoreTransaction"}
}
// 46 | answerBit. AnswerStoreTransaction
......@@ -5799,7 +5805,7 @@ func (p *VoteTransaction) neoMsgDecodeN(data []byte) (int, error) {
return 8, nil
overflow:
return 0, ErrDecodeOverflow
return 0, &ErrDecodeOverflow{"VoteTransaction"}
}
func (p *VoteTransaction) neoMsgEncodedLenM() int {
......@@ -5855,7 +5861,7 @@ func (p *VoteTransaction) neoMsgDecodeM(data []byte) (int, error) {
return 0 + int(nread), nil
overflow:
return 0, ErrDecodeOverflow
return 0, &ErrDecodeOverflow{"VoteTransaction"}
}
// 48 | answerBit. AnswerVoteTransaction
......@@ -5922,7 +5928,7 @@ func (p *GetObject) neoMsgDecodeN(data []byte) (int, error) {
return 24, nil
overflow:
return 0, ErrDecodeOverflow
return 0, &ErrDecodeOverflow{"GetObject"}
}
func (p *GetObject) neoMsgEncodedLenM() int {
......@@ -6040,7 +6046,7 @@ func (p *GetObject) neoMsgDecodeM(data []byte) (int, error) {
return 0 + int(nread), nil
overflow:
return 0, ErrDecodeOverflow
return 0, &ErrDecodeOverflow{"GetObject"}
}
// 50 | answerBit. AnswerObject
......@@ -6094,7 +6100,7 @@ func (p *AnswerObject) neoMsgDecodeN(data []byte) (int, error) {
return 49 + int(nread), nil
overflow:
return 0, ErrDecodeOverflow
return 0, &ErrDecodeOverflow{"AnswerObject"}
}
func (p *AnswerObject) neoMsgEncodedLenM() int {
......@@ -6241,7 +6247,8 @@ func (p *AnswerObject) neoMsgDecodeM(data []byte) (int, error) {
v, tail, err := msgp.ReadUint64Bytes(data)
if err != nil {
err = mdecodeErr("AnswerObject.Compression", err)
if err == ErrDecodeOverflow {
errDecodeOverflow := new(ErrDecodeOverflow)
if errors.As(err, &errDecodeOverflow) {
return 0, err
}
tail, err = msgp.ReadNilBytes(data)
......@@ -6295,7 +6302,7 @@ func (p *AnswerObject) neoMsgDecodeM(data []byte) (int, error) {
return 22 + int(nread), nil
overflow:
return 0, ErrDecodeOverflow
return 0, &ErrDecodeOverflow{"AnswerObject"}
}
// 52. AskTIDs
......@@ -6324,7 +6331,7 @@ func (p *AskTIDs) neoMsgDecodeN(data []byte) (int, error) {
return 20, nil
overflow:
return 0, ErrDecodeOverflow
return 0, &ErrDecodeOverflow{"AskTIDs"}
}
func (p *AskTIDs) neoMsgEncodedLenM() int {
......@@ -6432,7 +6439,7 @@ func (p *AnswerTIDs) neoMsgDecodeN(data []byte) (int, error) {
return 4 + int(nread), nil
overflow:
return 0, ErrDecodeOverflow
return 0, &ErrDecodeOverflow{"AnswerTIDs"}
}
func (p *AnswerTIDs) neoMsgEncodedLenM() int {
......@@ -6502,7 +6509,7 @@ func (p *AnswerTIDs) neoMsgDecodeM(data []byte) (int, error) {
return 0 + int(nread), nil
overflow:
return 0, ErrDecodeOverflow
return 0, &ErrDecodeOverflow{"AnswerTIDs"}
}
// 54. TransactionInformation
......@@ -6527,7 +6534,7 @@ func (p *TransactionInformation) neoMsgDecodeN(data []byte) (int, error) {
return 8, nil
overflow:
return 0, ErrDecodeOverflow
return 0, &ErrDecodeOverflow{"TransactionInformation"}
}
func (p *TransactionInformation) neoMsgEncodedLenM() int {
......@@ -6583,7 +6590,7 @@ func (p *TransactionInformation) neoMsgDecodeM(data []byte) (int, error) {
return 0 + int(nread), nil
overflow:
return 0, ErrDecodeOverflow
return 0, &ErrDecodeOverflow{"TransactionInformation"}
}
// 54 | answerBit. AnswerTransactionInformation
......@@ -6686,7 +6693,7 @@ func (p *AnswerTransactionInformation) neoMsgDecodeN(data []byte) (int, error) {
return 12 + int(nread), nil
overflow:
return 0, ErrDecodeOverflow
return 0, &ErrDecodeOverflow{"AnswerTransactionInformation"}
}
func (p *AnswerTransactionInformation) neoMsgEncodedLenM() int {
......@@ -6849,7 +6856,7 @@ func (p *AnswerTransactionInformation) neoMsgDecodeM(data []byte) (int, error) {
return 1 + int(nread), nil
overflow:
return 0, ErrDecodeOverflow
return 0, &ErrDecodeOverflow{"AnswerTransactionInformation"}
}
// 56. ObjectHistory
......@@ -6878,7 +6885,7 @@ func (p *ObjectHistory) neoMsgDecodeN(data []byte) (int, error) {
return 24, nil
overflow:
return 0, ErrDecodeOverflow
return 0, &ErrDecodeOverflow{"ObjectHistory"}
}
func (p *ObjectHistory) neoMsgEncodedLenM() int {
......@@ -6960,7 +6967,7 @@ func (p *ObjectHistory) neoMsgDecodeM(data []byte) (int, error) {
return 0 + int(nread), nil
overflow:
return 0, ErrDecodeOverflow
return 0, &ErrDecodeOverflow{"ObjectHistory"}
}
// 56 | answerBit. AnswerObjectHistory
......@@ -7015,7 +7022,7 @@ func (p *AnswerObjectHistory) neoMsgDecodeN(data []byte) (int, error) {
return 12 + int(nread), nil
overflow:
return 0, ErrDecodeOverflow
return 0, &ErrDecodeOverflow{"AnswerObjectHistory"}
}
func (p *AnswerObjectHistory) neoMsgEncodedLenM() int {
......@@ -7151,7 +7158,7 @@ func (p *AnswerObjectHistory) neoMsgDecodeM(data []byte) (int, error) {
return 0 + int(nread), nil
overflow:
return 0, ErrDecodeOverflow
return 0, &ErrDecodeOverflow{"AnswerObjectHistory"}
}
// 58. PartitionList
......@@ -7180,7 +7187,7 @@ func (p *PartitionList) neoMsgDecodeN(data []byte) (int, error) {
return 12, nil
overflow:
return 0, ErrDecodeOverflow
return 0, &ErrDecodeOverflow{"PartitionList"}
}
func (p *PartitionList) neoMsgEncodedLenM() int {
......@@ -7319,7 +7326,7 @@ func (p *AnswerPartitionList) neoMsgDecodeN(data []byte) (int, error) {
return 16 + int(nread), nil
overflow:
return 0, ErrDecodeOverflow
return 0, &ErrDecodeOverflow{"AnswerPartitionList"}
}
func (p *AnswerPartitionList) neoMsgEncodedLenM() int {
......@@ -7465,7 +7472,7 @@ func (p *AnswerPartitionList) neoMsgDecodeM(data []byte) (int, error) {
return 0 + int(nread), nil
overflow:
return 0, ErrDecodeOverflow
return 0, &ErrDecodeOverflow{"AnswerPartitionList"}
}
// 60. NodeList
......@@ -7490,7 +7497,7 @@ func (p *NodeList) neoMsgDecodeN(data []byte) (int, error) {
return 1, nil
overflow:
return 0, ErrDecodeOverflow
return 0, &ErrDecodeOverflow{"NodeList"}
}
func (p *NodeList) neoMsgEncodedLenM() int {
......@@ -7536,7 +7543,7 @@ func (p *NodeList) neoMsgDecodeM(data []byte) (int, error) {
return 3 + int(nread), nil
overflow:
return 0, ErrDecodeOverflow
return 0, &ErrDecodeOverflow{"NodeList"}
}
// 60 | answerBit. AnswerNodeList
......@@ -7620,7 +7627,7 @@ func (p *AnswerNodeList) neoMsgDecodeN(data []byte) (int, error) {
return 4 + int(nread), nil
overflow:
return 0, ErrDecodeOverflow
return 0, &ErrDecodeOverflow{"AnswerNodeList"}
}
func (p *AnswerNodeList) neoMsgEncodedLenM() int {
......@@ -7777,7 +7784,8 @@ func (p *AnswerNodeList) neoMsgDecodeM(data []byte) (int, error) {
v, tail, err := msgp.ReadFloat64Bytes(data)
if err != nil {
err = mdecodeErr("AnswerNodeList.IdTime", err)
if err == ErrDecodeOverflow {
errDecodeOverflow := new(ErrDecodeOverflow)
if errors.As(err, &errDecodeOverflow) {
return 0, err
}
tail, err = msgp.ReadNilBytes(data)
......@@ -7796,7 +7804,7 @@ func (p *AnswerNodeList) neoMsgDecodeM(data []byte) (int, error) {
return 0 + int(nread), nil
overflow:
return 0, ErrDecodeOverflow
return 0, &ErrDecodeOverflow{"AnswerNodeList"}
}
// 62. SetNodeState
......@@ -7823,7 +7831,7 @@ func (p *SetNodeState) neoMsgDecodeN(data []byte) (int, error) {
return 5, nil
overflow:
return 0, ErrDecodeOverflow
return 0, &ErrDecodeOverflow{"SetNodeState"}
}
func (p *SetNodeState) neoMsgEncodedLenM() int {
......@@ -7882,7 +7890,7 @@ func (p *SetNodeState) neoMsgDecodeM(data []byte) (int, error) {
return 3 + int(nread), nil
overflow:
return 0, ErrDecodeOverflow
return 0, &ErrDecodeOverflow{"SetNodeState"}
}
// 63. AddPendingNodes
......@@ -7930,7 +7938,7 @@ func (p *AddPendingNodes) neoMsgDecodeN(data []byte) (int, error) {
return 4 + int(nread), nil
overflow:
return 0, ErrDecodeOverflow
return 0, &ErrDecodeOverflow{"AddPendingNodes"}
}
func (p *AddPendingNodes) neoMsgEncodedLenM() int {
......@@ -8039,7 +8047,7 @@ func (p *TweakPartitionTable) neoMsgDecodeN(data []byte) (int, error) {
return 5 + int(nread), nil
overflow:
return 0, ErrDecodeOverflow
return 0, &ErrDecodeOverflow{"TweakPartitionTable"}
}
func (p *TweakPartitionTable) neoMsgEncodedLenM() int {
......@@ -8114,7 +8122,7 @@ func (p *TweakPartitionTable) neoMsgDecodeM(data []byte) (int, error) {
return 1 + int(nread), nil
overflow:
return 0, ErrDecodeOverflow
return 0, &ErrDecodeOverflow{"TweakPartitionTable"}
}
// 64 | answerBit. AnswerTweakPartitionTable
......@@ -8191,7 +8199,7 @@ func (p *AnswerTweakPartitionTable) neoMsgDecodeN(data []byte) (int, error) {
return 5 + int(nread), nil
overflow:
return 0, ErrDecodeOverflow
return 0, &ErrDecodeOverflow{"AnswerTweakPartitionTable"}
}
func (p *AnswerTweakPartitionTable) neoMsgEncodedLenM() int {
......@@ -8324,7 +8332,7 @@ func (p *AnswerTweakPartitionTable) neoMsgDecodeM(data []byte) (int, error) {
return 1 + int(nread), nil
overflow:
return 0, ErrDecodeOverflow
return 0, &ErrDecodeOverflow{"AnswerTweakPartitionTable"}
}
// 66. SetNumReplicas
......@@ -8349,7 +8357,7 @@ func (p *SetNumReplicas) neoMsgDecodeN(data []byte) (int, error) {
return 4, nil
overflow:
return 0, ErrDecodeOverflow
return 0, &ErrDecodeOverflow{"SetNumReplicas"}
}
func (p *SetNumReplicas) neoMsgEncodedLenM() int {
......@@ -8408,7 +8416,7 @@ func (p *SetClusterState) neoMsgDecodeN(data []byte) (int, error) {
return 1, nil
overflow:
return 0, ErrDecodeOverflow
return 0, &ErrDecodeOverflow{"SetClusterState"}
}
func (p *SetClusterState) neoMsgEncodedLenM() int {
......@@ -8454,7 +8462,7 @@ func (p *SetClusterState) neoMsgDecodeM(data []byte) (int, error) {
return 3 + int(nread), nil
overflow:
return 0, ErrDecodeOverflow
return 0, &ErrDecodeOverflow{"SetClusterState"}
}
// 68. Repair
......@@ -8504,7 +8512,7 @@ func (p *Repair) neoMsgDecodeN(data []byte) (int, error) {
return 4 + int(nread), nil
overflow:
return 0, ErrDecodeOverflow
return 0, &ErrDecodeOverflow{"Repair"}
}
func (p *Repair) neoMsgEncodedLenM() int {
......@@ -8587,7 +8595,7 @@ func (p *Repair) neoMsgDecodeM(data []byte) (int, error) {
return 1 + int(nread), nil
overflow:
return 0, ErrDecodeOverflow
return 0, &ErrDecodeOverflow{"Repair"}
}
// 69. RepairOne
......@@ -8612,7 +8620,7 @@ func (p *RepairOne) neoMsgDecodeN(data []byte) (int, error) {
return 1, nil
overflow:
return 0, ErrDecodeOverflow
return 0, &ErrDecodeOverflow{"RepairOne"}
}
func (p *RepairOne) neoMsgEncodedLenM() int {
......@@ -8657,7 +8665,7 @@ func (p *RepairOne) neoMsgDecodeM(data []byte) (int, error) {
return 1 + int(nread), nil
overflow:
return 0, ErrDecodeOverflow
return 0, &ErrDecodeOverflow{"RepairOne"}
}
// 70. NotifyClusterState
......@@ -8682,7 +8690,7 @@ func (p *NotifyClusterState) neoMsgDecodeN(data []byte) (int, error) {
return 1, nil
overflow:
return 0, ErrDecodeOverflow
return 0, &ErrDecodeOverflow{"NotifyClusterState"}
}
func (p *NotifyClusterState) neoMsgEncodedLenM() int {
......@@ -8728,7 +8736,7 @@ func (p *NotifyClusterState) neoMsgDecodeM(data []byte) (int, error) {
return 3 + int(nread), nil
overflow:
return 0, ErrDecodeOverflow
return 0, &ErrDecodeOverflow{"NotifyClusterState"}
}
// 71. AskClusterState
......@@ -8791,7 +8799,7 @@ func (p *AnswerClusterState) neoMsgDecodeN(data []byte) (int, error) {
return 1, nil
overflow:
return 0, ErrDecodeOverflow
return 0, &ErrDecodeOverflow{"AnswerClusterState"}
}
func (p *AnswerClusterState) neoMsgEncodedLenM() int {
......@@ -8837,7 +8845,7 @@ func (p *AnswerClusterState) neoMsgDecodeM(data []byte) (int, error) {
return 3 + int(nread), nil
overflow:
return 0, ErrDecodeOverflow
return 0, &ErrDecodeOverflow{"AnswerClusterState"}
}
// 73. ObjectUndoSerial
......@@ -8891,7 +8899,7 @@ func (p *ObjectUndoSerial) neoMsgDecodeN(data []byte) (int, error) {
return 28 + int(nread), nil
overflow:
return 0, ErrDecodeOverflow
return 0, &ErrDecodeOverflow{"ObjectUndoSerial"}
}
func (p *ObjectUndoSerial) neoMsgEncodedLenM() int {
......@@ -9055,7 +9063,7 @@ func (p *ObjectUndoSerial) neoMsgDecodeM(data []byte) (int, error) {
return 0 + int(nread), nil
overflow:
return 0, ErrDecodeOverflow
return 0, &ErrDecodeOverflow{"ObjectUndoSerial"}
}
// 73 | answerBit. AnswerObjectUndoSerial
......@@ -9124,7 +9132,7 @@ func (p *AnswerObjectUndoSerial) neoMsgDecodeN(data []byte) (int, error) {
return 4 + int(nread), nil
overflow:
return 0, ErrDecodeOverflow
return 0, &ErrDecodeOverflow{"AnswerObjectUndoSerial"}
}
func (p *AnswerObjectUndoSerial) neoMsgEncodedLenM() int {
......@@ -9304,7 +9312,7 @@ func (p *AnswerObjectUndoSerial) neoMsgDecodeM(data []byte) (int, error) {
return 0 + int(nread), nil
overflow:
return 0, ErrDecodeOverflow
return 0, &ErrDecodeOverflow{"AnswerObjectUndoSerial"}
}
// 75. AskTIDsFrom
......@@ -9335,7 +9343,7 @@ func (p *AskTIDsFrom) neoMsgDecodeN(data []byte) (int, error) {
return 24, nil
overflow:
return 0, ErrDecodeOverflow
return 0, &ErrDecodeOverflow{"AskTIDsFrom"}
}
func (p *AskTIDsFrom) neoMsgEncodedLenM() int {
......@@ -9448,7 +9456,7 @@ func (p *AskTIDsFrom) neoMsgDecodeM(data []byte) (int, error) {
return 0 + int(nread), nil
overflow:
return 0, ErrDecodeOverflow
return 0, &ErrDecodeOverflow{"AskTIDsFrom"}
}
// 75 | answerBit. AnswerTIDsFrom
......@@ -9496,7 +9504,7 @@ func (p *AnswerTIDsFrom) neoMsgDecodeN(data []byte) (int, error) {
return 4 + int(nread), nil
overflow:
return 0, ErrDecodeOverflow
return 0, &ErrDecodeOverflow{"AnswerTIDsFrom"}
}
func (p *AnswerTIDsFrom) neoMsgEncodedLenM() int {
......@@ -9566,7 +9574,7 @@ func (p *AnswerTIDsFrom) neoMsgDecodeM(data []byte) (int, error) {
return 0 + int(nread), nil
overflow:
return 0, ErrDecodeOverflow
return 0, &ErrDecodeOverflow{"AnswerTIDsFrom"}
}
// 77. Pack
......@@ -9591,7 +9599,7 @@ func (p *Pack) neoMsgDecodeN(data []byte) (int, error) {
return 8, nil
overflow:
return 0, ErrDecodeOverflow
return 0, &ErrDecodeOverflow{"Pack"}
}
func (p *Pack) neoMsgEncodedLenM() int {
......@@ -9647,7 +9655,7 @@ func (p *Pack) neoMsgDecodeM(data []byte) (int, error) {
return 0 + int(nread), nil
overflow:
return 0, ErrDecodeOverflow
return 0, &ErrDecodeOverflow{"Pack"}
}
// 77 | answerBit. AnswerPack
......@@ -9672,7 +9680,7 @@ func (p *AnswerPack) neoMsgDecodeN(data []byte) (int, error) {
return 1, nil
overflow:
return 0, ErrDecodeOverflow
return 0, &ErrDecodeOverflow{"AnswerPack"}
}
func (p *AnswerPack) neoMsgEncodedLenM() int {
......@@ -9708,7 +9716,7 @@ func (p *AnswerPack) neoMsgDecodeM(data []byte) (int, error) {
return 1 + int(nread), nil
overflow:
return 0, ErrDecodeOverflow
return 0, &ErrDecodeOverflow{"AnswerPack"}
}
// 79. CheckReplicas
......@@ -9767,7 +9775,7 @@ func (p *CheckReplicas) neoMsgDecodeN(data []byte) (int, error) {
return 4 + int(nread), nil
overflow:
return 0, ErrDecodeOverflow
return 0, &ErrDecodeOverflow{"CheckReplicas"}
}
func (p *CheckReplicas) neoMsgEncodedLenM() int {
......@@ -9908,7 +9916,7 @@ func (p *CheckReplicas) neoMsgDecodeM(data []byte) (int, error) {
return 0 + int(nread), nil
overflow:
return 0, ErrDecodeOverflow
return 0, &ErrDecodeOverflow{"CheckReplicas"}
}
// 80. CheckPartition
......@@ -9970,7 +9978,7 @@ func (p *CheckPartition) neoMsgDecodeN(data []byte) (int, error) {
return 24 + int(nread), nil
overflow:
return 0, ErrDecodeOverflow
return 0, &ErrDecodeOverflow{"CheckPartition"}
}
func (p *CheckPartition) neoMsgEncodedLenM() int {
......@@ -10133,7 +10141,7 @@ func (p *CheckPartition) neoMsgDecodeM(data []byte) (int, error) {
return 0 + int(nread), nil
overflow:
return 0, ErrDecodeOverflow
return 0, &ErrDecodeOverflow{"CheckPartition"}
}
// 81. CheckTIDRange
......@@ -10164,7 +10172,7 @@ func (p *CheckTIDRange) neoMsgDecodeN(data []byte) (int, error) {
return 24, nil
overflow:
return 0, ErrDecodeOverflow
return 0, &ErrDecodeOverflow{"CheckTIDRange"}
}
func (p *CheckTIDRange) neoMsgEncodedLenM() int {
......@@ -10277,7 +10285,7 @@ func (p *CheckTIDRange) neoMsgDecodeM(data []byte) (int, error) {
return 0 + int(nread), nil
overflow:
return 0, ErrDecodeOverflow
return 0, &ErrDecodeOverflow{"CheckTIDRange"}
}
// 81 | answerBit. AnswerCheckTIDRange
......@@ -10306,7 +10314,7 @@ func (p *AnswerCheckTIDRange) neoMsgDecodeN(data []byte) (int, error) {
return 32, nil
overflow:
return 0, ErrDecodeOverflow
return 0, &ErrDecodeOverflow{"AnswerCheckTIDRange"}
}
func (p *AnswerCheckTIDRange) neoMsgEncodedLenM() int {
......@@ -10389,7 +10397,7 @@ func (p *AnswerCheckTIDRange) neoMsgDecodeM(data []byte) (int, error) {
return 22 + int(nread), nil
overflow:
return 0, ErrDecodeOverflow
return 0, &ErrDecodeOverflow{"AnswerCheckTIDRange"}
}
// 83. CheckSerialRange
......@@ -10422,7 +10430,7 @@ func (p *CheckSerialRange) neoMsgDecodeN(data []byte) (int, error) {
return 32, nil
overflow:
return 0, ErrDecodeOverflow
return 0, &ErrDecodeOverflow{"CheckSerialRange"}
}
func (p *CheckSerialRange) neoMsgEncodedLenM() int {
......@@ -10566,7 +10574,7 @@ func (p *CheckSerialRange) neoMsgDecodeM(data []byte) (int, error) {
return 0 + int(nread), nil
overflow:
return 0, ErrDecodeOverflow
return 0, &ErrDecodeOverflow{"CheckSerialRange"}
}
// 83 | answerBit. AnswerCheckSerialRange
......@@ -10599,7 +10607,7 @@ func (p *AnswerCheckSerialRange) neoMsgDecodeN(data []byte) (int, error) {
return 60, nil
overflow:
return 0, ErrDecodeOverflow
return 0, &ErrDecodeOverflow{"AnswerCheckSerialRange"}
}
func (p *AnswerCheckSerialRange) neoMsgEncodedLenM() int {
......@@ -10727,7 +10735,7 @@ func (p *AnswerCheckSerialRange) neoMsgDecodeM(data []byte) (int, error) {
return 44 + int(nread), nil
overflow:
return 0, ErrDecodeOverflow
return 0, &ErrDecodeOverflow{"AnswerCheckSerialRange"}
}
// 85. PartitionCorrupted
......@@ -10777,7 +10785,7 @@ func (p *PartitionCorrupted) neoMsgDecodeN(data []byte) (int, error) {
return 8 + int(nread), nil
overflow:
return 0, ErrDecodeOverflow
return 0, &ErrDecodeOverflow{"PartitionCorrupted"}
}
func (p *PartitionCorrupted) neoMsgEncodedLenM() int {
......@@ -10950,7 +10958,7 @@ func (p *AnswerLastTransaction) neoMsgDecodeN(data []byte) (int, error) {
return 8, nil
overflow:
return 0, ErrDecodeOverflow
return 0, &ErrDecodeOverflow{"AnswerLastTransaction"}
}
func (p *AnswerLastTransaction) neoMsgEncodedLenM() int {
......@@ -11006,7 +11014,7 @@ func (p *AnswerLastTransaction) neoMsgDecodeM(data []byte) (int, error) {
return 0 + int(nread), nil
overflow:
return 0, ErrDecodeOverflow
return 0, &ErrDecodeOverflow{"AnswerLastTransaction"}
}
// 89. CheckCurrentSerial
......@@ -11035,7 +11043,7 @@ func (p *CheckCurrentSerial) neoMsgDecodeN(data []byte) (int, error) {
return 24, nil
overflow:
return 0, ErrDecodeOverflow
return 0, &ErrDecodeOverflow{"CheckCurrentSerial"}
}
func (p *CheckCurrentSerial) neoMsgEncodedLenM() int {
......@@ -11153,7 +11161,7 @@ func (p *CheckCurrentSerial) neoMsgDecodeM(data []byte) (int, error) {
return 0 + int(nread), nil
overflow:
return 0, ErrDecodeOverflow
return 0, &ErrDecodeOverflow{"CheckCurrentSerial"}
}
// 89 | answerBit. AnswerCheckCurrentSerial
......@@ -11178,7 +11186,7 @@ func (p *AnswerCheckCurrentSerial) neoMsgDecodeN(data []byte) (int, error) {
return 8, nil
overflow:
return 0, ErrDecodeOverflow
return 0, &ErrDecodeOverflow{"AnswerCheckCurrentSerial"}
}
func (p *AnswerCheckCurrentSerial) neoMsgEncodedLenM() int {
......@@ -11243,7 +11251,7 @@ func (p *AnswerCheckCurrentSerial) neoMsgDecodeM(data []byte) (int, error) {
return 0 + int(nread), nil
overflow:
return 0, ErrDecodeOverflow
return 0, &ErrDecodeOverflow{"AnswerCheckCurrentSerial"}
}
// 91. NotifyTransactionFinished
......@@ -11270,7 +11278,7 @@ func (p *NotifyTransactionFinished) neoMsgDecodeN(data []byte) (int, error) {
return 16, nil
overflow:
return 0, ErrDecodeOverflow
return 0, &ErrDecodeOverflow{"NotifyTransactionFinished"}
}
func (p *NotifyTransactionFinished) neoMsgEncodedLenM() int {
......@@ -11357,7 +11365,7 @@ func (p *NotifyTransactionFinished) neoMsgDecodeM(data []byte) (int, error) {
return 0 + int(nread), nil
overflow:
return 0, ErrDecodeOverflow
return 0, &ErrDecodeOverflow{"NotifyTransactionFinished"}
}
// 92. Replicate
......@@ -11448,7 +11456,7 @@ func (p *Replicate) neoMsgDecodeN(data []byte) (int, error) {
return 12 + int(nread), nil
overflow:
return 0, ErrDecodeOverflow
return 0, &ErrDecodeOverflow{"Replicate"}
}
func (p *Replicate) neoMsgEncodedLenM() int {
......@@ -11577,7 +11585,7 @@ func (p *Replicate) neoMsgDecodeM(data []byte) (int, error) {
return 0 + int(nread), nil
overflow:
return 0, ErrDecodeOverflow
return 0, &ErrDecodeOverflow{"Replicate"}
}
// 93. ReplicationDone
......@@ -11604,7 +11612,7 @@ func (p *ReplicationDone) neoMsgDecodeN(data []byte) (int, error) {
return 12, nil
overflow:
return 0, ErrDecodeOverflow
return 0, &ErrDecodeOverflow{"ReplicationDone"}
}
func (p *ReplicationDone) neoMsgEncodedLenM() int {
......@@ -11673,7 +11681,7 @@ func (p *ReplicationDone) neoMsgDecodeM(data []byte) (int, error) {
return 0 + int(nread), nil
overflow:
return 0, ErrDecodeOverflow
return 0, &ErrDecodeOverflow{"ReplicationDone"}
}
// 94. FetchTransactions
......@@ -11729,7 +11737,7 @@ func (p *FetchTransactions) neoMsgDecodeN(data []byte) (int, error) {
return 28 + int(nread), nil
overflow:
return 0, ErrDecodeOverflow
return 0, &ErrDecodeOverflow{"FetchTransactions"}
}
func (p *FetchTransactions) neoMsgEncodedLenM() int {
......@@ -11888,7 +11896,7 @@ func (p *FetchTransactions) neoMsgDecodeM(data []byte) (int, error) {
return 0 + int(nread), nil
overflow:
return 0, ErrDecodeOverflow
return 0, &ErrDecodeOverflow{"FetchTransactions"}
}
// 94 | answerBit. AnswerFetchTransactions
......@@ -11940,7 +11948,7 @@ func (p *AnswerFetchTransactions) neoMsgDecodeN(data []byte) (int, error) {
return 20 + int(nread), nil
overflow:
return 0, ErrDecodeOverflow
return 0, &ErrDecodeOverflow{"AnswerFetchTransactions"}
}
func (p *AnswerFetchTransactions) neoMsgEncodedLenM() int {
......@@ -12073,7 +12081,7 @@ func (p *AnswerFetchTransactions) neoMsgDecodeM(data []byte) (int, error) {
return 0 + int(nread), nil
overflow:
return 0, ErrDecodeOverflow
return 0, &ErrDecodeOverflow{"AnswerFetchTransactions"}
}
// 96. FetchObjects
......@@ -12164,7 +12172,7 @@ func (p *FetchObjects) neoMsgDecodeN(data []byte) (int, error) {
return 36 + int(nread), nil
overflow:
return 0, ErrDecodeOverflow
return 0, &ErrDecodeOverflow{"FetchObjects"}
}
func (p *FetchObjects) neoMsgEncodedLenM() int {
......@@ -12415,7 +12423,7 @@ func (p *FetchObjects) neoMsgDecodeM(data []byte) (int, error) {
return 0 + int(nread), nil
overflow:
return 0, ErrDecodeOverflow
return 0, &ErrDecodeOverflow{"FetchObjects"}
}
// 96 | answerBit. AnswerFetchObjects
......@@ -12502,7 +12510,7 @@ func (p *AnswerFetchObjects) neoMsgDecodeN(data []byte) (int, error) {
return 28 + int(nread), nil
overflow:
return 0, ErrDecodeOverflow
return 0, &ErrDecodeOverflow{"AnswerFetchObjects"}
}
func (p *AnswerFetchObjects) neoMsgEncodedLenM() int {
......@@ -12727,7 +12735,7 @@ func (p *AnswerFetchObjects) neoMsgDecodeM(data []byte) (int, error) {
return 0 + int(nread), nil
overflow:
return 0, ErrDecodeOverflow
return 0, &ErrDecodeOverflow{"AnswerFetchObjects"}
}
// 98. AddTransaction
......@@ -12832,7 +12840,7 @@ func (p *AddTransaction) neoMsgDecodeN(data []byte) (int, error) {
return 12 + int(nread), nil
overflow:
return 0, ErrDecodeOverflow
return 0, &ErrDecodeOverflow{"AddTransaction"}
}
func (p *AddTransaction) neoMsgEncodedLenM() int {
......@@ -13026,7 +13034,7 @@ func (p *AddTransaction) neoMsgDecodeM(data []byte) (int, error) {
return 1 + int(nread), nil
overflow:
return 0, ErrDecodeOverflow
return 0, &ErrDecodeOverflow{"AddTransaction"}
}
// 99. AddObject
......@@ -13078,7 +13086,7 @@ func (p *AddObject) neoMsgDecodeN(data []byte) (int, error) {
return 41 + int(nread), nil
overflow:
return 0, ErrDecodeOverflow
return 0, &ErrDecodeOverflow{"AddObject"}
}
func (p *AddObject) neoMsgEncodedLenM() int {
......@@ -13194,7 +13202,8 @@ func (p *AddObject) neoMsgDecodeM(data []byte) (int, error) {
v, tail, err := msgp.ReadUint64Bytes(data)
if err != nil {
err = mdecodeErr("AddObject.Compression", err)
if err == ErrDecodeOverflow {
errDecodeOverflow := new(ErrDecodeOverflow)
if errors.As(err, &errDecodeOverflow) {
return 0, err
}
tail, err = msgp.ReadNilBytes(data)
......@@ -13248,7 +13257,7 @@ func (p *AddObject) neoMsgDecodeM(data []byte) (int, error) {
return 22 + int(nread), nil
overflow:
return 0, ErrDecodeOverflow
return 0, &ErrDecodeOverflow{"AddObject"}
}
// 100. Truncate
......@@ -13273,7 +13282,7 @@ func (p *Truncate) neoMsgDecodeN(data []byte) (int, error) {
return 8, nil
overflow:
return 0, ErrDecodeOverflow
return 0, &ErrDecodeOverflow{"Truncate"}
}
func (p *Truncate) neoMsgEncodedLenM() int {
......@@ -13329,7 +13338,7 @@ func (p *Truncate) neoMsgDecodeM(data []byte) (int, error) {
return 0 + int(nread), nil
overflow:
return 0, ErrDecodeOverflow
return 0, &ErrDecodeOverflow{"Truncate"}
}
// 101. FlushLog
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment