Update cbor-gen to latest master

This commit is contained in:
whyrusleeping
2019-12-17 19:06:06 -08:00
parent 0f7be020d1
commit fda3811dcf
9 changed files with 284 additions and 54 deletions
+8
View File
@@ -28,6 +28,10 @@ func (t *VoucherInfo) MarshalCBOR(w io.Writer) error {
}
// t.Proof ([]uint8) (slice)
if len(t.Proof) > cbg.ByteArrayMaxLen {
return xerrors.Errorf("Byte array in field t.Proof was too long")
}
if _, err := w.Write(cbg.CborEncodeMajorType(cbg.MajByteString, uint64(len(t.Proof)))); err != nil {
return err
}
@@ -123,6 +127,10 @@ func (t *ChannelInfo) MarshalCBOR(w io.Writer) error {
}
// t.Vouchers ([]*paych.VoucherInfo) (slice)
if len(t.Vouchers) > cbg.MaxLength {
return xerrors.Errorf("Slice value in field t.Vouchers was too long")
}
if _, err := w.Write(cbg.CborEncodeMajorType(cbg.MajArray, uint64(len(t.Vouchers)))); err != nil {
return err
}