backupds: Allow larger values in write log

This commit is contained in:
Łukasz Magiera
2021-03-11 12:03:24 +01:00
parent 3be4984d9d
commit ea58bee3f5
2 changed files with 0 additions and 34 deletions
@@ -1,21 +1,12 @@
// Code generated by github.com/whyrusleeping/cbor-gen. DO NOT EDIT.
package backupds
import (
"fmt"
"io"
"sort"
cid "github.com/ipfs/go-cid"
cbg "github.com/whyrusleeping/cbor-gen"
xerrors "golang.org/x/xerrors"
)
var _ = xerrors.Errorf
var _ = cid.Undef
var _ = sort.Sort
var lengthBufEntry = []byte{131}
func (t *Entry) MarshalCBOR(w io.Writer) error {
@@ -29,11 +20,6 @@ func (t *Entry) MarshalCBOR(w io.Writer) error {
scratch := make([]byte, 9)
// t.Key ([]uint8) (slice)
if len(t.Key) > cbg.ByteArrayMaxLen {
return xerrors.Errorf("Byte array in field t.Key was too long")
}
if err := cbg.WriteMajorTypeHeaderBuf(scratch, w, cbg.MajByteString, uint64(len(t.Key))); err != nil {
return err
}
@@ -42,11 +28,6 @@ func (t *Entry) MarshalCBOR(w io.Writer) error {
return err
}
// t.Value ([]uint8) (slice)
if len(t.Value) > cbg.ByteArrayMaxLen {
return xerrors.Errorf("Byte array in field t.Value was too long")
}
if err := cbg.WriteMajorTypeHeaderBuf(scratch, w, cbg.MajByteString, uint64(len(t.Value))); err != nil {
return err
}
@@ -93,9 +74,6 @@ func (t *Entry) UnmarshalCBOR(r io.Reader) error {
return err
}
if extra > cbg.ByteArrayMaxLen {
return fmt.Errorf("t.Key: byte array too large (%d)", extra)
}
if maj != cbg.MajByteString {
return fmt.Errorf("expected byte array")
}
@@ -114,9 +92,6 @@ func (t *Entry) UnmarshalCBOR(r io.Reader) error {
return err
}
if extra > cbg.ByteArrayMaxLen {
return fmt.Errorf("t.Value: byte array too large (%d)", extra)
}
if maj != cbg.MajByteString {
return fmt.Errorf("expected byte array")
}