deprecate MarketListRetrievalDeals, make gen
This commit is contained in:
parent
2c6d025ab3
commit
d114d8fe7e
@ -7,12 +7,12 @@ executors:
|
|||||||
golang:
|
golang:
|
||||||
docker:
|
docker:
|
||||||
# Must match GO_VERSION_MIN in project root
|
# Must match GO_VERSION_MIN in project root
|
||||||
- image: cimg/go:1.18.8
|
- image: cimg/go:1.19.7
|
||||||
resource_class: medium+
|
resource_class: medium+
|
||||||
golang-2xl:
|
golang-2xl:
|
||||||
docker:
|
docker:
|
||||||
# Must match GO_VERSION_MIN in project root
|
# Must match GO_VERSION_MIN in project root
|
||||||
- image: cimg/go:1.18.8
|
- image: cimg/go:1.19.7
|
||||||
resource_class: 2xlarge
|
resource_class: 2xlarge
|
||||||
ubuntu:
|
ubuntu:
|
||||||
docker:
|
docker:
|
||||||
|
@ -214,7 +214,9 @@ type StorageMiner interface {
|
|||||||
|
|
||||||
MarketImportDealData(ctx context.Context, propcid cid.Cid, path string) error //perm:write
|
MarketImportDealData(ctx context.Context, propcid cid.Cid, path string) error //perm:write
|
||||||
MarketListDeals(ctx context.Context) ([]*MarketDeal, error) //perm:read
|
MarketListDeals(ctx context.Context) ([]*MarketDeal, error) //perm:read
|
||||||
MarketListRetrievalDeals(ctx context.Context) ([]retrievalmarket.ProviderDealState, error) //perm:read
|
|
||||||
|
// MarketListRetrievalDeals is deprecated, returns empty list
|
||||||
|
MarketListRetrievalDeals(ctx context.Context) ([]struct{}, error) //perm:read
|
||||||
MarketGetDealUpdates(ctx context.Context) (<-chan storagemarket.MinerDeal, error) //perm:read
|
MarketGetDealUpdates(ctx context.Context) (<-chan storagemarket.MinerDeal, error) //perm:read
|
||||||
MarketListIncompleteDeals(ctx context.Context) ([]storagemarket.MinerDeal, error) //perm:read
|
MarketListIncompleteDeals(ctx context.Context) ([]storagemarket.MinerDeal, error) //perm:read
|
||||||
MarketSetAsk(ctx context.Context, price types.BigInt, verifiedPrice types.BigInt, duration abi.ChainEpoch, minPieceSize abi.PaddedPieceSize, maxPieceSize abi.PaddedPieceSize) error //perm:admin
|
MarketSetAsk(ctx context.Context, price types.BigInt, verifiedPrice types.BigInt, duration abi.ChainEpoch, minPieceSize abi.PaddedPieceSize, maxPieceSize abi.PaddedPieceSize) error //perm:admin
|
||||||
|
448
api/cbor_gen.go
448
api/cbor_gen.go
@ -50,22 +50,6 @@ func (t *PaymentInfo) MarshalCBOR(w io.Writer) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
// t.WaitSentinel (cid.Cid) (struct)
|
|
||||||
if len("WaitSentinel") > cbg.MaxLength {
|
|
||||||
return xerrors.Errorf("Value in field \"WaitSentinel\" was too long")
|
|
||||||
}
|
|
||||||
|
|
||||||
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("WaitSentinel"))); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
if _, err := io.WriteString(w, string("WaitSentinel")); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
if err := cbg.WriteCid(cw, t.WaitSentinel); err != nil {
|
|
||||||
return xerrors.Errorf("failed to write cid field t.WaitSentinel: %w", err)
|
|
||||||
}
|
|
||||||
|
|
||||||
// t.Vouchers ([]*paych.SignedVoucher) (slice)
|
// t.Vouchers ([]*paych.SignedVoucher) (slice)
|
||||||
if len("Vouchers") > cbg.MaxLength {
|
if len("Vouchers") > cbg.MaxLength {
|
||||||
return xerrors.Errorf("Value in field \"Vouchers\" was too long")
|
return xerrors.Errorf("Value in field \"Vouchers\" was too long")
|
||||||
@ -90,6 +74,23 @@ func (t *PaymentInfo) MarshalCBOR(w io.Writer) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// t.WaitSentinel (cid.Cid) (struct)
|
||||||
|
if len("WaitSentinel") > cbg.MaxLength {
|
||||||
|
return xerrors.Errorf("Value in field \"WaitSentinel\" was too long")
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("WaitSentinel"))); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if _, err := io.WriteString(w, string("WaitSentinel")); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := cbg.WriteCid(cw, t.WaitSentinel); err != nil {
|
||||||
|
return xerrors.Errorf("failed to write cid field t.WaitSentinel: %w", err)
|
||||||
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -140,19 +141,6 @@ func (t *PaymentInfo) UnmarshalCBOR(r io.Reader) (err error) {
|
|||||||
return xerrors.Errorf("unmarshaling t.Channel: %w", err)
|
return xerrors.Errorf("unmarshaling t.Channel: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
||||||
// t.WaitSentinel (cid.Cid) (struct)
|
|
||||||
case "WaitSentinel":
|
|
||||||
|
|
||||||
{
|
|
||||||
|
|
||||||
c, err := cbg.ReadCid(cr)
|
|
||||||
if err != nil {
|
|
||||||
return xerrors.Errorf("failed to read cid field t.WaitSentinel: %w", err)
|
|
||||||
}
|
|
||||||
|
|
||||||
t.WaitSentinel = c
|
|
||||||
|
|
||||||
}
|
}
|
||||||
// t.Vouchers ([]*paych.SignedVoucher) (slice)
|
// t.Vouchers ([]*paych.SignedVoucher) (slice)
|
||||||
case "Vouchers":
|
case "Vouchers":
|
||||||
@ -184,6 +172,20 @@ func (t *PaymentInfo) UnmarshalCBOR(r io.Reader) (err error) {
|
|||||||
t.Vouchers[i] = &v
|
t.Vouchers[i] = &v
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// t.WaitSentinel (cid.Cid) (struct)
|
||||||
|
case "WaitSentinel":
|
||||||
|
|
||||||
|
{
|
||||||
|
|
||||||
|
c, err := cbg.ReadCid(cr)
|
||||||
|
if err != nil {
|
||||||
|
return xerrors.Errorf("failed to read cid field t.WaitSentinel: %w", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
t.WaitSentinel = c
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
default:
|
default:
|
||||||
// Field doesn't exist on this type, so ignore it
|
// Field doesn't exist on this type, so ignore it
|
||||||
cbg.ScanForLinks(r, func(cid.Cid) {})
|
cbg.ScanForLinks(r, func(cid.Cid) {})
|
||||||
@ -204,19 +206,19 @@ func (t *SealedRef) MarshalCBOR(w io.Writer) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
// t.SectorID (abi.SectorNumber) (uint64)
|
// t.Size (abi.UnpaddedPieceSize) (uint64)
|
||||||
if len("SectorID") > cbg.MaxLength {
|
if len("Size") > cbg.MaxLength {
|
||||||
return xerrors.Errorf("Value in field \"SectorID\" was too long")
|
return xerrors.Errorf("Value in field \"Size\" was too long")
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("SectorID"))); err != nil {
|
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("Size"))); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if _, err := io.WriteString(w, string("SectorID")); err != nil {
|
if _, err := io.WriteString(w, string("Size")); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := cw.WriteMajorTypeHeader(cbg.MajUnsignedInt, uint64(t.SectorID)); err != nil {
|
if err := cw.WriteMajorTypeHeader(cbg.MajUnsignedInt, uint64(t.Size)); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -236,19 +238,19 @@ func (t *SealedRef) MarshalCBOR(w io.Writer) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
// t.Size (abi.UnpaddedPieceSize) (uint64)
|
// t.SectorID (abi.SectorNumber) (uint64)
|
||||||
if len("Size") > cbg.MaxLength {
|
if len("SectorID") > cbg.MaxLength {
|
||||||
return xerrors.Errorf("Value in field \"Size\" was too long")
|
return xerrors.Errorf("Value in field \"SectorID\" was too long")
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("Size"))); err != nil {
|
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("SectorID"))); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if _, err := io.WriteString(w, string("Size")); err != nil {
|
if _, err := io.WriteString(w, string("SectorID")); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := cw.WriteMajorTypeHeader(cbg.MajUnsignedInt, uint64(t.Size)); err != nil {
|
if err := cw.WriteMajorTypeHeader(cbg.MajUnsignedInt, uint64(t.SectorID)); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -293,8 +295,8 @@ func (t *SealedRef) UnmarshalCBOR(r io.Reader) (err error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
switch name {
|
switch name {
|
||||||
// t.SectorID (abi.SectorNumber) (uint64)
|
// t.Size (abi.UnpaddedPieceSize) (uint64)
|
||||||
case "SectorID":
|
case "Size":
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -305,7 +307,7 @@ func (t *SealedRef) UnmarshalCBOR(r io.Reader) (err error) {
|
|||||||
if maj != cbg.MajUnsignedInt {
|
if maj != cbg.MajUnsignedInt {
|
||||||
return fmt.Errorf("wrong type for uint64 field")
|
return fmt.Errorf("wrong type for uint64 field")
|
||||||
}
|
}
|
||||||
t.SectorID = abi.SectorNumber(extra)
|
t.Size = abi.UnpaddedPieceSize(extra)
|
||||||
|
|
||||||
}
|
}
|
||||||
// t.Offset (abi.PaddedPieceSize) (uint64)
|
// t.Offset (abi.PaddedPieceSize) (uint64)
|
||||||
@ -323,8 +325,8 @@ func (t *SealedRef) UnmarshalCBOR(r io.Reader) (err error) {
|
|||||||
t.Offset = abi.PaddedPieceSize(extra)
|
t.Offset = abi.PaddedPieceSize(extra)
|
||||||
|
|
||||||
}
|
}
|
||||||
// t.Size (abi.UnpaddedPieceSize) (uint64)
|
// t.SectorID (abi.SectorNumber) (uint64)
|
||||||
case "Size":
|
case "SectorID":
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -335,7 +337,7 @@ func (t *SealedRef) UnmarshalCBOR(r io.Reader) (err error) {
|
|||||||
if maj != cbg.MajUnsignedInt {
|
if maj != cbg.MajUnsignedInt {
|
||||||
return fmt.Errorf("wrong type for uint64 field")
|
return fmt.Errorf("wrong type for uint64 field")
|
||||||
}
|
}
|
||||||
t.Size = abi.UnpaddedPieceSize(extra)
|
t.SectorID = abi.SectorNumber(extra)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -474,6 +476,28 @@ func (t *SealTicket) MarshalCBOR(w io.Writer) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// t.Epoch (abi.ChainEpoch) (int64)
|
||||||
|
if len("Epoch") > cbg.MaxLength {
|
||||||
|
return xerrors.Errorf("Value in field \"Epoch\" was too long")
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("Epoch"))); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if _, err := io.WriteString(w, string("Epoch")); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
if t.Epoch >= 0 {
|
||||||
|
if err := cw.WriteMajorTypeHeader(cbg.MajUnsignedInt, uint64(t.Epoch)); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if err := cw.WriteMajorTypeHeader(cbg.MajNegativeInt, uint64(-t.Epoch-1)); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// t.Value (abi.SealRandomness) (slice)
|
// t.Value (abi.SealRandomness) (slice)
|
||||||
if len("Value") > cbg.MaxLength {
|
if len("Value") > cbg.MaxLength {
|
||||||
return xerrors.Errorf("Value in field \"Value\" was too long")
|
return xerrors.Errorf("Value in field \"Value\" was too long")
|
||||||
@ -497,28 +521,6 @@ func (t *SealTicket) MarshalCBOR(w io.Writer) error {
|
|||||||
if _, err := cw.Write(t.Value[:]); err != nil {
|
if _, err := cw.Write(t.Value[:]); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
// t.Epoch (abi.ChainEpoch) (int64)
|
|
||||||
if len("Epoch") > cbg.MaxLength {
|
|
||||||
return xerrors.Errorf("Value in field \"Epoch\" was too long")
|
|
||||||
}
|
|
||||||
|
|
||||||
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("Epoch"))); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
if _, err := io.WriteString(w, string("Epoch")); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
if t.Epoch >= 0 {
|
|
||||||
if err := cw.WriteMajorTypeHeader(cbg.MajUnsignedInt, uint64(t.Epoch)); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if err := cw.WriteMajorTypeHeader(cbg.MajNegativeInt, uint64(-t.Epoch-1)); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -560,6 +562,32 @@ func (t *SealTicket) UnmarshalCBOR(r io.Reader) (err error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
switch name {
|
switch name {
|
||||||
|
// t.Epoch (abi.ChainEpoch) (int64)
|
||||||
|
case "Epoch":
|
||||||
|
{
|
||||||
|
maj, extra, err := cr.ReadHeader()
|
||||||
|
var extraI int64
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
switch maj {
|
||||||
|
case cbg.MajUnsignedInt:
|
||||||
|
extraI = int64(extra)
|
||||||
|
if extraI < 0 {
|
||||||
|
return fmt.Errorf("int64 positive overflow")
|
||||||
|
}
|
||||||
|
case cbg.MajNegativeInt:
|
||||||
|
extraI = int64(extra)
|
||||||
|
if extraI < 0 {
|
||||||
|
return fmt.Errorf("int64 negative overflow")
|
||||||
|
}
|
||||||
|
extraI = -1 - extraI
|
||||||
|
default:
|
||||||
|
return fmt.Errorf("wrong type for int64 field: %d", maj)
|
||||||
|
}
|
||||||
|
|
||||||
|
t.Epoch = abi.ChainEpoch(extraI)
|
||||||
|
}
|
||||||
// t.Value (abi.SealRandomness) (slice)
|
// t.Value (abi.SealRandomness) (slice)
|
||||||
case "Value":
|
case "Value":
|
||||||
|
|
||||||
@ -582,32 +610,6 @@ func (t *SealTicket) UnmarshalCBOR(r io.Reader) (err error) {
|
|||||||
if _, err := io.ReadFull(cr, t.Value[:]); err != nil {
|
if _, err := io.ReadFull(cr, t.Value[:]); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
// t.Epoch (abi.ChainEpoch) (int64)
|
|
||||||
case "Epoch":
|
|
||||||
{
|
|
||||||
maj, extra, err := cr.ReadHeader()
|
|
||||||
var extraI int64
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
switch maj {
|
|
||||||
case cbg.MajUnsignedInt:
|
|
||||||
extraI = int64(extra)
|
|
||||||
if extraI < 0 {
|
|
||||||
return fmt.Errorf("int64 positive overflow")
|
|
||||||
}
|
|
||||||
case cbg.MajNegativeInt:
|
|
||||||
extraI = int64(extra)
|
|
||||||
if extraI < 0 {
|
|
||||||
return fmt.Errorf("int64 negative oveflow")
|
|
||||||
}
|
|
||||||
extraI = -1 - extraI
|
|
||||||
default:
|
|
||||||
return fmt.Errorf("wrong type for int64 field: %d", maj)
|
|
||||||
}
|
|
||||||
|
|
||||||
t.Epoch = abi.ChainEpoch(extraI)
|
|
||||||
}
|
|
||||||
|
|
||||||
default:
|
default:
|
||||||
// Field doesn't exist on this type, so ignore it
|
// Field doesn't exist on this type, so ignore it
|
||||||
@ -629,6 +631,28 @@ func (t *SealSeed) MarshalCBOR(w io.Writer) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// t.Epoch (abi.ChainEpoch) (int64)
|
||||||
|
if len("Epoch") > cbg.MaxLength {
|
||||||
|
return xerrors.Errorf("Value in field \"Epoch\" was too long")
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("Epoch"))); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if _, err := io.WriteString(w, string("Epoch")); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
if t.Epoch >= 0 {
|
||||||
|
if err := cw.WriteMajorTypeHeader(cbg.MajUnsignedInt, uint64(t.Epoch)); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if err := cw.WriteMajorTypeHeader(cbg.MajNegativeInt, uint64(-t.Epoch-1)); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// t.Value (abi.InteractiveSealRandomness) (slice)
|
// t.Value (abi.InteractiveSealRandomness) (slice)
|
||||||
if len("Value") > cbg.MaxLength {
|
if len("Value") > cbg.MaxLength {
|
||||||
return xerrors.Errorf("Value in field \"Value\" was too long")
|
return xerrors.Errorf("Value in field \"Value\" was too long")
|
||||||
@ -652,28 +676,6 @@ func (t *SealSeed) MarshalCBOR(w io.Writer) error {
|
|||||||
if _, err := cw.Write(t.Value[:]); err != nil {
|
if _, err := cw.Write(t.Value[:]); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
// t.Epoch (abi.ChainEpoch) (int64)
|
|
||||||
if len("Epoch") > cbg.MaxLength {
|
|
||||||
return xerrors.Errorf("Value in field \"Epoch\" was too long")
|
|
||||||
}
|
|
||||||
|
|
||||||
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("Epoch"))); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
if _, err := io.WriteString(w, string("Epoch")); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
if t.Epoch >= 0 {
|
|
||||||
if err := cw.WriteMajorTypeHeader(cbg.MajUnsignedInt, uint64(t.Epoch)); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if err := cw.WriteMajorTypeHeader(cbg.MajNegativeInt, uint64(-t.Epoch-1)); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -715,6 +717,32 @@ func (t *SealSeed) UnmarshalCBOR(r io.Reader) (err error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
switch name {
|
switch name {
|
||||||
|
// t.Epoch (abi.ChainEpoch) (int64)
|
||||||
|
case "Epoch":
|
||||||
|
{
|
||||||
|
maj, extra, err := cr.ReadHeader()
|
||||||
|
var extraI int64
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
switch maj {
|
||||||
|
case cbg.MajUnsignedInt:
|
||||||
|
extraI = int64(extra)
|
||||||
|
if extraI < 0 {
|
||||||
|
return fmt.Errorf("int64 positive overflow")
|
||||||
|
}
|
||||||
|
case cbg.MajNegativeInt:
|
||||||
|
extraI = int64(extra)
|
||||||
|
if extraI < 0 {
|
||||||
|
return fmt.Errorf("int64 negative overflow")
|
||||||
|
}
|
||||||
|
extraI = -1 - extraI
|
||||||
|
default:
|
||||||
|
return fmt.Errorf("wrong type for int64 field: %d", maj)
|
||||||
|
}
|
||||||
|
|
||||||
|
t.Epoch = abi.ChainEpoch(extraI)
|
||||||
|
}
|
||||||
// t.Value (abi.InteractiveSealRandomness) (slice)
|
// t.Value (abi.InteractiveSealRandomness) (slice)
|
||||||
case "Value":
|
case "Value":
|
||||||
|
|
||||||
@ -737,32 +765,6 @@ func (t *SealSeed) UnmarshalCBOR(r io.Reader) (err error) {
|
|||||||
if _, err := io.ReadFull(cr, t.Value[:]); err != nil {
|
if _, err := io.ReadFull(cr, t.Value[:]); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
// t.Epoch (abi.ChainEpoch) (int64)
|
|
||||||
case "Epoch":
|
|
||||||
{
|
|
||||||
maj, extra, err := cr.ReadHeader()
|
|
||||||
var extraI int64
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
switch maj {
|
|
||||||
case cbg.MajUnsignedInt:
|
|
||||||
extraI = int64(extra)
|
|
||||||
if extraI < 0 {
|
|
||||||
return fmt.Errorf("int64 positive overflow")
|
|
||||||
}
|
|
||||||
case cbg.MajNegativeInt:
|
|
||||||
extraI = int64(extra)
|
|
||||||
if extraI < 0 {
|
|
||||||
return fmt.Errorf("int64 negative oveflow")
|
|
||||||
}
|
|
||||||
extraI = -1 - extraI
|
|
||||||
default:
|
|
||||||
return fmt.Errorf("wrong type for int64 field: %d", maj)
|
|
||||||
}
|
|
||||||
|
|
||||||
t.Epoch = abi.ChainEpoch(extraI)
|
|
||||||
}
|
|
||||||
|
|
||||||
default:
|
default:
|
||||||
// Field doesn't exist on this type, so ignore it
|
// Field doesn't exist on this type, so ignore it
|
||||||
@ -784,6 +786,22 @@ func (t *PieceDealInfo) MarshalCBOR(w io.Writer) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// t.DealID (abi.DealID) (uint64)
|
||||||
|
if len("DealID") > cbg.MaxLength {
|
||||||
|
return xerrors.Errorf("Value in field \"DealID\" was too long")
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("DealID"))); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if _, err := io.WriteString(w, string("DealID")); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := cw.WriteMajorTypeHeader(cbg.MajUnsignedInt, uint64(t.DealID)); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
// t.PublishCid (cid.Cid) (struct)
|
// t.PublishCid (cid.Cid) (struct)
|
||||||
if len("PublishCid") > cbg.MaxLength {
|
if len("PublishCid") > cbg.MaxLength {
|
||||||
return xerrors.Errorf("Value in field \"PublishCid\" was too long")
|
return xerrors.Errorf("Value in field \"PublishCid\" was too long")
|
||||||
@ -806,22 +824,6 @@ func (t *PieceDealInfo) MarshalCBOR(w io.Writer) error {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// t.DealID (abi.DealID) (uint64)
|
|
||||||
if len("DealID") > cbg.MaxLength {
|
|
||||||
return xerrors.Errorf("Value in field \"DealID\" was too long")
|
|
||||||
}
|
|
||||||
|
|
||||||
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("DealID"))); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
if _, err := io.WriteString(w, string("DealID")); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
if err := cw.WriteMajorTypeHeader(cbg.MajUnsignedInt, uint64(t.DealID)); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
// t.DealProposal (market.DealProposal) (struct)
|
// t.DealProposal (market.DealProposal) (struct)
|
||||||
if len("DealProposal") > cbg.MaxLength {
|
if len("DealProposal") > cbg.MaxLength {
|
||||||
return xerrors.Errorf("Value in field \"DealProposal\" was too long")
|
return xerrors.Errorf("Value in field \"DealProposal\" was too long")
|
||||||
@ -910,6 +912,21 @@ func (t *PieceDealInfo) UnmarshalCBOR(r io.Reader) (err error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
switch name {
|
switch name {
|
||||||
|
// t.DealID (abi.DealID) (uint64)
|
||||||
|
case "DealID":
|
||||||
|
|
||||||
|
{
|
||||||
|
|
||||||
|
maj, extra, err = cr.ReadHeader()
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if maj != cbg.MajUnsignedInt {
|
||||||
|
return fmt.Errorf("wrong type for uint64 field")
|
||||||
|
}
|
||||||
|
t.DealID = abi.DealID(extra)
|
||||||
|
|
||||||
|
}
|
||||||
// t.PublishCid (cid.Cid) (struct)
|
// t.PublishCid (cid.Cid) (struct)
|
||||||
case "PublishCid":
|
case "PublishCid":
|
||||||
|
|
||||||
@ -932,21 +949,6 @@ func (t *PieceDealInfo) UnmarshalCBOR(r io.Reader) (err error) {
|
|||||||
t.PublishCid = &c
|
t.PublishCid = &c
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
||||||
// t.DealID (abi.DealID) (uint64)
|
|
||||||
case "DealID":
|
|
||||||
|
|
||||||
{
|
|
||||||
|
|
||||||
maj, extra, err = cr.ReadHeader()
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
if maj != cbg.MajUnsignedInt {
|
|
||||||
return fmt.Errorf("wrong type for uint64 field")
|
|
||||||
}
|
|
||||||
t.DealID = abi.DealID(extra)
|
|
||||||
|
|
||||||
}
|
}
|
||||||
// t.DealProposal (market.DealProposal) (struct)
|
// t.DealProposal (market.DealProposal) (struct)
|
||||||
case "DealProposal":
|
case "DealProposal":
|
||||||
@ -1140,28 +1142,6 @@ func (t *DealSchedule) MarshalCBOR(w io.Writer) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
// t.StartEpoch (abi.ChainEpoch) (int64)
|
|
||||||
if len("StartEpoch") > cbg.MaxLength {
|
|
||||||
return xerrors.Errorf("Value in field \"StartEpoch\" was too long")
|
|
||||||
}
|
|
||||||
|
|
||||||
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("StartEpoch"))); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
if _, err := io.WriteString(w, string("StartEpoch")); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
if t.StartEpoch >= 0 {
|
|
||||||
if err := cw.WriteMajorTypeHeader(cbg.MajUnsignedInt, uint64(t.StartEpoch)); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if err := cw.WriteMajorTypeHeader(cbg.MajNegativeInt, uint64(-t.StartEpoch-1)); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// t.EndEpoch (abi.ChainEpoch) (int64)
|
// t.EndEpoch (abi.ChainEpoch) (int64)
|
||||||
if len("EndEpoch") > cbg.MaxLength {
|
if len("EndEpoch") > cbg.MaxLength {
|
||||||
return xerrors.Errorf("Value in field \"EndEpoch\" was too long")
|
return xerrors.Errorf("Value in field \"EndEpoch\" was too long")
|
||||||
@ -1183,6 +1163,28 @@ func (t *DealSchedule) MarshalCBOR(w io.Writer) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// t.StartEpoch (abi.ChainEpoch) (int64)
|
||||||
|
if len("StartEpoch") > cbg.MaxLength {
|
||||||
|
return xerrors.Errorf("Value in field \"StartEpoch\" was too long")
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("StartEpoch"))); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if _, err := io.WriteString(w, string("StartEpoch")); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
if t.StartEpoch >= 0 {
|
||||||
|
if err := cw.WriteMajorTypeHeader(cbg.MajUnsignedInt, uint64(t.StartEpoch)); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if err := cw.WriteMajorTypeHeader(cbg.MajNegativeInt, uint64(-t.StartEpoch-1)); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1224,32 +1226,6 @@ func (t *DealSchedule) UnmarshalCBOR(r io.Reader) (err error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
switch name {
|
switch name {
|
||||||
// t.StartEpoch (abi.ChainEpoch) (int64)
|
|
||||||
case "StartEpoch":
|
|
||||||
{
|
|
||||||
maj, extra, err := cr.ReadHeader()
|
|
||||||
var extraI int64
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
switch maj {
|
|
||||||
case cbg.MajUnsignedInt:
|
|
||||||
extraI = int64(extra)
|
|
||||||
if extraI < 0 {
|
|
||||||
return fmt.Errorf("int64 positive overflow")
|
|
||||||
}
|
|
||||||
case cbg.MajNegativeInt:
|
|
||||||
extraI = int64(extra)
|
|
||||||
if extraI < 0 {
|
|
||||||
return fmt.Errorf("int64 negative oveflow")
|
|
||||||
}
|
|
||||||
extraI = -1 - extraI
|
|
||||||
default:
|
|
||||||
return fmt.Errorf("wrong type for int64 field: %d", maj)
|
|
||||||
}
|
|
||||||
|
|
||||||
t.StartEpoch = abi.ChainEpoch(extraI)
|
|
||||||
}
|
|
||||||
// t.EndEpoch (abi.ChainEpoch) (int64)
|
// t.EndEpoch (abi.ChainEpoch) (int64)
|
||||||
case "EndEpoch":
|
case "EndEpoch":
|
||||||
{
|
{
|
||||||
@ -1267,7 +1243,7 @@ func (t *DealSchedule) UnmarshalCBOR(r io.Reader) (err error) {
|
|||||||
case cbg.MajNegativeInt:
|
case cbg.MajNegativeInt:
|
||||||
extraI = int64(extra)
|
extraI = int64(extra)
|
||||||
if extraI < 0 {
|
if extraI < 0 {
|
||||||
return fmt.Errorf("int64 negative oveflow")
|
return fmt.Errorf("int64 negative overflow")
|
||||||
}
|
}
|
||||||
extraI = -1 - extraI
|
extraI = -1 - extraI
|
||||||
default:
|
default:
|
||||||
@ -1276,6 +1252,32 @@ func (t *DealSchedule) UnmarshalCBOR(r io.Reader) (err error) {
|
|||||||
|
|
||||||
t.EndEpoch = abi.ChainEpoch(extraI)
|
t.EndEpoch = abi.ChainEpoch(extraI)
|
||||||
}
|
}
|
||||||
|
// t.StartEpoch (abi.ChainEpoch) (int64)
|
||||||
|
case "StartEpoch":
|
||||||
|
{
|
||||||
|
maj, extra, err := cr.ReadHeader()
|
||||||
|
var extraI int64
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
switch maj {
|
||||||
|
case cbg.MajUnsignedInt:
|
||||||
|
extraI = int64(extra)
|
||||||
|
if extraI < 0 {
|
||||||
|
return fmt.Errorf("int64 positive overflow")
|
||||||
|
}
|
||||||
|
case cbg.MajNegativeInt:
|
||||||
|
extraI = int64(extra)
|
||||||
|
if extraI < 0 {
|
||||||
|
return fmt.Errorf("int64 negative overflow")
|
||||||
|
}
|
||||||
|
extraI = -1 - extraI
|
||||||
|
default:
|
||||||
|
return fmt.Errorf("wrong type for int64 field: %d", maj)
|
||||||
|
}
|
||||||
|
|
||||||
|
t.StartEpoch = abi.ChainEpoch(extraI)
|
||||||
|
}
|
||||||
|
|
||||||
default:
|
default:
|
||||||
// Field doesn't exist on this type, so ignore it
|
// Field doesn't exist on this type, so ignore it
|
||||||
|
@ -947,7 +947,7 @@ type StorageMinerMethods struct {
|
|||||||
|
|
||||||
MarketListIncompleteDeals func(p0 context.Context) ([]storagemarket.MinerDeal, error) `perm:"read"`
|
MarketListIncompleteDeals func(p0 context.Context) ([]storagemarket.MinerDeal, error) `perm:"read"`
|
||||||
|
|
||||||
MarketListRetrievalDeals func(p0 context.Context) ([]retrievalmarket.ProviderDealState, error) `perm:"read"`
|
MarketListRetrievalDeals func(p0 context.Context) ([]struct{}, error) `perm:"read"`
|
||||||
|
|
||||||
MarketPendingDeals func(p0 context.Context) (PendingDealInfo, error) `perm:"write"`
|
MarketPendingDeals func(p0 context.Context) (PendingDealInfo, error) `perm:"write"`
|
||||||
|
|
||||||
@ -5645,15 +5645,15 @@ func (s *StorageMinerStub) MarketListIncompleteDeals(p0 context.Context) ([]stor
|
|||||||
return *new([]storagemarket.MinerDeal), ErrNotSupported
|
return *new([]storagemarket.MinerDeal), ErrNotSupported
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *StorageMinerStruct) MarketListRetrievalDeals(p0 context.Context) ([]retrievalmarket.ProviderDealState, error) {
|
func (s *StorageMinerStruct) MarketListRetrievalDeals(p0 context.Context) ([]struct{}, error) {
|
||||||
if s.Internal.MarketListRetrievalDeals == nil {
|
if s.Internal.MarketListRetrievalDeals == nil {
|
||||||
return *new([]retrievalmarket.ProviderDealState), ErrNotSupported
|
return *new([]struct{}), ErrNotSupported
|
||||||
}
|
}
|
||||||
return s.Internal.MarketListRetrievalDeals(p0)
|
return s.Internal.MarketListRetrievalDeals(p0)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *StorageMinerStub) MarketListRetrievalDeals(p0 context.Context) ([]retrievalmarket.ProviderDealState, error) {
|
func (s *StorageMinerStub) MarketListRetrievalDeals(p0 context.Context) ([]struct{}, error) {
|
||||||
return *new([]retrievalmarket.ProviderDealState), ErrNotSupported
|
return *new([]struct{}), ErrNotSupported
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *StorageMinerStruct) MarketPendingDeals(p0 context.Context) (PendingDealInfo, error) {
|
func (s *StorageMinerStruct) MarketPendingDeals(p0 context.Context) (PendingDealInfo, error) {
|
||||||
|
Binary file not shown.
@ -12,6 +12,7 @@ import (
|
|||||||
"github.com/ipfs/go-cid"
|
"github.com/ipfs/go-cid"
|
||||||
blocks "github.com/ipfs/go-libipfs/blocks"
|
blocks "github.com/ipfs/go-libipfs/blocks"
|
||||||
logging "github.com/ipfs/go-log/v2"
|
logging "github.com/ipfs/go-log/v2"
|
||||||
|
"github.com/ipni/storetheindex/announce/message"
|
||||||
pubsub "github.com/libp2p/go-libp2p-pubsub"
|
pubsub "github.com/libp2p/go-libp2p-pubsub"
|
||||||
"github.com/libp2p/go-libp2p/core/connmgr"
|
"github.com/libp2p/go-libp2p/core/connmgr"
|
||||||
"github.com/libp2p/go-libp2p/core/peer"
|
"github.com/libp2p/go-libp2p/core/peer"
|
||||||
@ -20,7 +21,6 @@ import (
|
|||||||
"golang.org/x/xerrors"
|
"golang.org/x/xerrors"
|
||||||
|
|
||||||
"github.com/filecoin-project/go-address"
|
"github.com/filecoin-project/go-address"
|
||||||
"github.com/ipni/storetheindex/announce/message"
|
|
||||||
|
|
||||||
"github.com/filecoin-project/lotus/build"
|
"github.com/filecoin-project/lotus/build"
|
||||||
"github.com/filecoin-project/lotus/chain"
|
"github.com/filecoin-project/lotus/chain"
|
||||||
|
@ -9,12 +9,12 @@ import (
|
|||||||
"github.com/golang/mock/gomock"
|
"github.com/golang/mock/gomock"
|
||||||
"github.com/ipfs/go-cid"
|
"github.com/ipfs/go-cid"
|
||||||
blocks "github.com/ipfs/go-libipfs/blocks"
|
blocks "github.com/ipfs/go-libipfs/blocks"
|
||||||
|
"github.com/ipni/storetheindex/announce/message"
|
||||||
pubsub "github.com/libp2p/go-libp2p-pubsub"
|
pubsub "github.com/libp2p/go-libp2p-pubsub"
|
||||||
pb "github.com/libp2p/go-libp2p-pubsub/pb"
|
pb "github.com/libp2p/go-libp2p-pubsub/pb"
|
||||||
"github.com/libp2p/go-libp2p/core/peer"
|
"github.com/libp2p/go-libp2p/core/peer"
|
||||||
|
|
||||||
"github.com/filecoin-project/go-address"
|
"github.com/filecoin-project/go-address"
|
||||||
"github.com/ipni/storetheindex/announce/message"
|
|
||||||
|
|
||||||
"github.com/filecoin-project/lotus/api/mocks"
|
"github.com/filecoin-project/lotus/api/mocks"
|
||||||
"github.com/filecoin-project/lotus/chain/types"
|
"github.com/filecoin-project/lotus/chain/types"
|
||||||
|
@ -340,7 +340,7 @@ func (t *BlockHeader) UnmarshalCBOR(r io.Reader) (err error) {
|
|||||||
case cbg.MajNegativeInt:
|
case cbg.MajNegativeInt:
|
||||||
extraI = int64(extra)
|
extraI = int64(extra)
|
||||||
if extraI < 0 {
|
if extraI < 0 {
|
||||||
return fmt.Errorf("int64 negative oveflow")
|
return fmt.Errorf("int64 negative overflow")
|
||||||
}
|
}
|
||||||
extraI = -1 - extraI
|
extraI = -1 - extraI
|
||||||
default:
|
default:
|
||||||
@ -618,7 +618,7 @@ func (t *ElectionProof) UnmarshalCBOR(r io.Reader) (err error) {
|
|||||||
case cbg.MajNegativeInt:
|
case cbg.MajNegativeInt:
|
||||||
extraI = int64(extra)
|
extraI = int64(extra)
|
||||||
if extraI < 0 {
|
if extraI < 0 {
|
||||||
return fmt.Errorf("int64 negative oveflow")
|
return fmt.Errorf("int64 negative overflow")
|
||||||
}
|
}
|
||||||
extraI = -1 - extraI
|
extraI = -1 - extraI
|
||||||
default:
|
default:
|
||||||
@ -828,7 +828,7 @@ func (t *Message) UnmarshalCBOR(r io.Reader) (err error) {
|
|||||||
case cbg.MajNegativeInt:
|
case cbg.MajNegativeInt:
|
||||||
extraI = int64(extra)
|
extraI = int64(extra)
|
||||||
if extraI < 0 {
|
if extraI < 0 {
|
||||||
return fmt.Errorf("int64 negative oveflow")
|
return fmt.Errorf("int64 negative overflow")
|
||||||
}
|
}
|
||||||
extraI = -1 - extraI
|
extraI = -1 - extraI
|
||||||
default:
|
default:
|
||||||
@ -1591,7 +1591,7 @@ func (t *ExpTipSet) UnmarshalCBOR(r io.Reader) (err error) {
|
|||||||
case cbg.MajNegativeInt:
|
case cbg.MajNegativeInt:
|
||||||
extraI = int64(extra)
|
extraI = int64(extra)
|
||||||
if extraI < 0 {
|
if extraI < 0 {
|
||||||
return fmt.Errorf("int64 negative oveflow")
|
return fmt.Errorf("int64 negative overflow")
|
||||||
}
|
}
|
||||||
extraI = -1 - extraI
|
extraI = -1 - extraI
|
||||||
default:
|
default:
|
||||||
@ -2202,7 +2202,7 @@ func (t *GasTrace) UnmarshalCBOR(r io.Reader) (err error) {
|
|||||||
case cbg.MajNegativeInt:
|
case cbg.MajNegativeInt:
|
||||||
extraI = int64(extra)
|
extraI = int64(extra)
|
||||||
if extraI < 0 {
|
if extraI < 0 {
|
||||||
return fmt.Errorf("int64 negative oveflow")
|
return fmt.Errorf("int64 negative overflow")
|
||||||
}
|
}
|
||||||
extraI = -1 - extraI
|
extraI = -1 - extraI
|
||||||
default:
|
default:
|
||||||
@ -2227,7 +2227,7 @@ func (t *GasTrace) UnmarshalCBOR(r io.Reader) (err error) {
|
|||||||
case cbg.MajNegativeInt:
|
case cbg.MajNegativeInt:
|
||||||
extraI = int64(extra)
|
extraI = int64(extra)
|
||||||
if extraI < 0 {
|
if extraI < 0 {
|
||||||
return fmt.Errorf("int64 negative oveflow")
|
return fmt.Errorf("int64 negative overflow")
|
||||||
}
|
}
|
||||||
extraI = -1 - extraI
|
extraI = -1 - extraI
|
||||||
default:
|
default:
|
||||||
@ -2252,7 +2252,7 @@ func (t *GasTrace) UnmarshalCBOR(r io.Reader) (err error) {
|
|||||||
case cbg.MajNegativeInt:
|
case cbg.MajNegativeInt:
|
||||||
extraI = int64(extra)
|
extraI = int64(extra)
|
||||||
if extraI < 0 {
|
if extraI < 0 {
|
||||||
return fmt.Errorf("int64 negative oveflow")
|
return fmt.Errorf("int64 negative overflow")
|
||||||
}
|
}
|
||||||
extraI = -1 - extraI
|
extraI = -1 - extraI
|
||||||
default:
|
default:
|
||||||
@ -2277,7 +2277,7 @@ func (t *GasTrace) UnmarshalCBOR(r io.Reader) (err error) {
|
|||||||
case cbg.MajNegativeInt:
|
case cbg.MajNegativeInt:
|
||||||
extraI = int64(extra)
|
extraI = int64(extra)
|
||||||
if extraI < 0 {
|
if extraI < 0 {
|
||||||
return fmt.Errorf("int64 negative oveflow")
|
return fmt.Errorf("int64 negative overflow")
|
||||||
}
|
}
|
||||||
extraI = -1 - extraI
|
extraI = -1 - extraI
|
||||||
default:
|
default:
|
||||||
@ -2534,7 +2534,7 @@ func (t *ReturnTrace) UnmarshalCBOR(r io.Reader) (err error) {
|
|||||||
case cbg.MajNegativeInt:
|
case cbg.MajNegativeInt:
|
||||||
extraI = int64(extra)
|
extraI = int64(extra)
|
||||||
if extraI < 0 {
|
if extraI < 0 {
|
||||||
return fmt.Errorf("int64 negative oveflow")
|
return fmt.Errorf("int64 negative overflow")
|
||||||
}
|
}
|
||||||
extraI = -1 - extraI
|
extraI = -1 - extraI
|
||||||
default:
|
default:
|
||||||
|
@ -150,11 +150,6 @@ var infoAllCmd = &cli.Command{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fmt.Println("\n#: Retrieval Deals")
|
|
||||||
if err := retrievalDealsListCmd.Action(cctx); err != nil {
|
|
||||||
fmt.Println("ERROR: ", err)
|
|
||||||
}
|
|
||||||
|
|
||||||
fmt.Println("\n#: Data Transfers")
|
fmt.Println("\n#: Data Transfers")
|
||||||
{
|
{
|
||||||
fs := &flag.FlagSet{}
|
fs := &flag.FlagSet{}
|
||||||
|
@ -3,13 +3,11 @@ package main
|
|||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
"sort"
|
|
||||||
"text/tabwriter"
|
"text/tabwriter"
|
||||||
|
|
||||||
"github.com/docker/go-units"
|
"github.com/docker/go-units"
|
||||||
"github.com/urfave/cli/v2"
|
"github.com/urfave/cli/v2"
|
||||||
|
|
||||||
"github.com/filecoin-project/go-fil-markets/retrievalmarket"
|
|
||||||
"github.com/filecoin-project/go-state-types/abi"
|
"github.com/filecoin-project/go-state-types/abi"
|
||||||
|
|
||||||
"github.com/filecoin-project/lotus/chain/types"
|
"github.com/filecoin-project/lotus/chain/types"
|
||||||
@ -21,7 +19,6 @@ var retrievalDealsCmd = &cli.Command{
|
|||||||
Usage: "Manage retrieval deals and related configuration",
|
Usage: "Manage retrieval deals and related configuration",
|
||||||
Subcommands: []*cli.Command{
|
Subcommands: []*cli.Command{
|
||||||
retrievalDealSelectionCmd,
|
retrievalDealSelectionCmd,
|
||||||
retrievalDealsListCmd,
|
|
||||||
retrievalSetAskCmd,
|
retrievalSetAskCmd,
|
||||||
retrievalGetAskCmd,
|
retrievalGetAskCmd,
|
||||||
},
|
},
|
||||||
@ -124,47 +121,6 @@ var retrievalDealSelectionRejectCmd = &cli.Command{
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
var retrievalDealsListCmd = &cli.Command{
|
|
||||||
Name: "list",
|
|
||||||
Usage: "List all active retrieval deals for this miner",
|
|
||||||
Action: func(cctx *cli.Context) error {
|
|
||||||
api, closer, err := lcli.GetMarketsAPI(cctx)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
defer closer()
|
|
||||||
|
|
||||||
deals, err := api.MarketListRetrievalDeals(lcli.DaemonContext(cctx))
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
sort.Slice(deals, func(i, j int) bool {
|
|
||||||
return deals[i].ID < deals[j].ID
|
|
||||||
})
|
|
||||||
|
|
||||||
w := tabwriter.NewWriter(os.Stdout, 2, 4, 2, ' ', 0)
|
|
||||||
|
|
||||||
_, _ = fmt.Fprintf(w, "Receiver\tDealID\tPayload\tState\tPricePerByte\tMessage\n")
|
|
||||||
|
|
||||||
for _, deal := range deals {
|
|
||||||
payloadCid := deal.PayloadCID.String()
|
|
||||||
|
|
||||||
_, _ = fmt.Fprintf(w,
|
|
||||||
"%s\t%d\t%s\t%s\t%s\t%s\n",
|
|
||||||
deal.Receiver.String(),
|
|
||||||
deal.ID,
|
|
||||||
"..."+payloadCid[len(payloadCid)-8:],
|
|
||||||
retrievalmarket.DealStatuses[deal.Status],
|
|
||||||
deal.PricePerByte.String(),
|
|
||||||
deal.Message,
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
return w.Flush()
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
||||||
var retrievalSetAskCmd = &cli.Command{
|
var retrievalSetAskCmd = &cli.Command{
|
||||||
Name: "set-ask",
|
Name: "set-ask",
|
||||||
Usage: "Configure the provider's retrieval ask",
|
Usage: "Configure the provider's retrieval ask",
|
||||||
|
@ -223,7 +223,7 @@ func (t *CallerValidationArgs) UnmarshalCBOR(r io.Reader) (err error) {
|
|||||||
case cbg.MajNegativeInt:
|
case cbg.MajNegativeInt:
|
||||||
extraI = int64(extra)
|
extraI = int64(extra)
|
||||||
if extraI < 0 {
|
if extraI < 0 {
|
||||||
return fmt.Errorf("int64 negative oveflow")
|
return fmt.Errorf("int64 negative overflow")
|
||||||
}
|
}
|
||||||
extraI = -1 - extraI
|
extraI = -1 - extraI
|
||||||
default:
|
default:
|
||||||
@ -712,7 +712,7 @@ func (t *SendReturn) UnmarshalCBOR(r io.Reader) (err error) {
|
|||||||
case cbg.MajNegativeInt:
|
case cbg.MajNegativeInt:
|
||||||
extraI = int64(extra)
|
extraI = int64(extra)
|
||||||
if extraI < 0 {
|
if extraI < 0 {
|
||||||
return fmt.Errorf("int64 negative oveflow")
|
return fmt.Errorf("int64 negative overflow")
|
||||||
}
|
}
|
||||||
extraI = -1 - extraI
|
extraI = -1 - extraI
|
||||||
default:
|
default:
|
||||||
@ -812,7 +812,7 @@ func (t *MutateStateArgs) UnmarshalCBOR(r io.Reader) (err error) {
|
|||||||
case cbg.MajNegativeInt:
|
case cbg.MajNegativeInt:
|
||||||
extraI = int64(extra)
|
extraI = int64(extra)
|
||||||
if extraI < 0 {
|
if extraI < 0 {
|
||||||
return fmt.Errorf("int64 negative oveflow")
|
return fmt.Errorf("int64 negative overflow")
|
||||||
}
|
}
|
||||||
extraI = -1 - extraI
|
extraI = -1 - extraI
|
||||||
default:
|
default:
|
||||||
@ -907,7 +907,7 @@ func (t *AbortWithArgs) UnmarshalCBOR(r io.Reader) (err error) {
|
|||||||
case cbg.MajNegativeInt:
|
case cbg.MajNegativeInt:
|
||||||
extraI = int64(extra)
|
extraI = int64(extra)
|
||||||
if extraI < 0 {
|
if extraI < 0 {
|
||||||
return fmt.Errorf("int64 negative oveflow")
|
return fmt.Errorf("int64 negative overflow")
|
||||||
}
|
}
|
||||||
extraI = -1 - extraI
|
extraI = -1 - extraI
|
||||||
default:
|
default:
|
||||||
@ -1064,7 +1064,7 @@ func (t *InspectRuntimeReturn) UnmarshalCBOR(r io.Reader) (err error) {
|
|||||||
case cbg.MajNegativeInt:
|
case cbg.MajNegativeInt:
|
||||||
extraI = int64(extra)
|
extraI = int64(extra)
|
||||||
if extraI < 0 {
|
if extraI < 0 {
|
||||||
return fmt.Errorf("int64 negative oveflow")
|
return fmt.Errorf("int64 negative overflow")
|
||||||
}
|
}
|
||||||
extraI = -1 - extraI
|
extraI = -1 - extraI
|
||||||
default:
|
default:
|
||||||
|
@ -1506,6 +1506,7 @@ Response:
|
|||||||
```
|
```
|
||||||
|
|
||||||
### MarketListRetrievalDeals
|
### MarketListRetrievalDeals
|
||||||
|
MarketListRetrievalDeals is deprecated, returns empty list
|
||||||
|
|
||||||
|
|
||||||
Perms: read
|
Perms: read
|
||||||
@ -1515,48 +1516,7 @@ Inputs: `null`
|
|||||||
Response:
|
Response:
|
||||||
```json
|
```json
|
||||||
[
|
[
|
||||||
{
|
{}
|
||||||
"PayloadCID": {
|
|
||||||
"/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
|
|
||||||
},
|
|
||||||
"ID": 5,
|
|
||||||
"Selector": {
|
|
||||||
"Raw": "Ynl0ZSBhcnJheQ=="
|
|
||||||
},
|
|
||||||
"PieceCID": {
|
|
||||||
"/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
|
|
||||||
},
|
|
||||||
"PricePerByte": "0",
|
|
||||||
"PaymentInterval": 42,
|
|
||||||
"PaymentIntervalIncrease": 42,
|
|
||||||
"UnsealPrice": "0",
|
|
||||||
"StoreID": 42,
|
|
||||||
"ChannelID": {
|
|
||||||
"Initiator": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf",
|
|
||||||
"Responder": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf",
|
|
||||||
"ID": 3
|
|
||||||
},
|
|
||||||
"PieceInfo": {
|
|
||||||
"PieceCID": {
|
|
||||||
"/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
|
|
||||||
},
|
|
||||||
"Deals": [
|
|
||||||
{
|
|
||||||
"DealID": 5432,
|
|
||||||
"SectorID": 9,
|
|
||||||
"Offset": 1032,
|
|
||||||
"Length": 1032
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"Status": 0,
|
|
||||||
"Receiver": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf",
|
|
||||||
"TotalSent": 42,
|
|
||||||
"FundsReceived": "0",
|
|
||||||
"Message": "string value",
|
|
||||||
"CurrentInterval": 42,
|
|
||||||
"LegacyProtocol": true
|
|
||||||
}
|
|
||||||
]
|
]
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -839,7 +839,6 @@ USAGE:
|
|||||||
|
|
||||||
COMMANDS:
|
COMMANDS:
|
||||||
selection Configure acceptance criteria for retrieval deal proposals
|
selection Configure acceptance criteria for retrieval deal proposals
|
||||||
list List all active retrieval deals for this miner
|
|
||||||
set-ask Configure the provider's retrieval ask
|
set-ask Configure the provider's retrieval ask
|
||||||
get-ask Get the provider's current retrieval ask configured by the provider in the ask-store using the set-ask CLI command
|
get-ask Get the provider's current retrieval ask configured by the provider in the ask-store using the set-ask CLI command
|
||||||
help, h Shows a list of commands or help for one command
|
help, h Shows a list of commands or help for one command
|
||||||
@ -908,19 +907,6 @@ OPTIONS:
|
|||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### lotus-miner retrieval-deals list
|
|
||||||
```
|
|
||||||
NAME:
|
|
||||||
lotus-miner retrieval-deals list - List all active retrieval deals for this miner
|
|
||||||
|
|
||||||
USAGE:
|
|
||||||
lotus-miner retrieval-deals list [command options] [arguments...]
|
|
||||||
|
|
||||||
OPTIONS:
|
|
||||||
--help, -h show help (default: false)
|
|
||||||
|
|
||||||
```
|
|
||||||
|
|
||||||
### lotus-miner retrieval-deals set-ask
|
### lotus-miner retrieval-deals set-ask
|
||||||
```
|
```
|
||||||
NAME:
|
NAME:
|
||||||
|
@ -140,7 +140,7 @@ func (t *HelloMessage) UnmarshalCBOR(r io.Reader) (err error) {
|
|||||||
case cbg.MajNegativeInt:
|
case cbg.MajNegativeInt:
|
||||||
extraI = int64(extra)
|
extraI = int64(extra)
|
||||||
if extraI < 0 {
|
if extraI < 0 {
|
||||||
return fmt.Errorf("int64 negative oveflow")
|
return fmt.Errorf("int64 negative overflow")
|
||||||
}
|
}
|
||||||
extraI = -1 - extraI
|
extraI = -1 - extraI
|
||||||
default:
|
default:
|
||||||
@ -250,7 +250,7 @@ func (t *LatencyMessage) UnmarshalCBOR(r io.Reader) (err error) {
|
|||||||
case cbg.MajNegativeInt:
|
case cbg.MajNegativeInt:
|
||||||
extraI = int64(extra)
|
extraI = int64(extra)
|
||||||
if extraI < 0 {
|
if extraI < 0 {
|
||||||
return fmt.Errorf("int64 negative oveflow")
|
return fmt.Errorf("int64 negative overflow")
|
||||||
}
|
}
|
||||||
extraI = -1 - extraI
|
extraI = -1 - extraI
|
||||||
default:
|
default:
|
||||||
@ -275,7 +275,7 @@ func (t *LatencyMessage) UnmarshalCBOR(r io.Reader) (err error) {
|
|||||||
case cbg.MajNegativeInt:
|
case cbg.MajNegativeInt:
|
||||||
extraI = int64(extra)
|
extraI = int64(extra)
|
||||||
if extraI < 0 {
|
if extraI < 0 {
|
||||||
return fmt.Errorf("int64 negative oveflow")
|
return fmt.Errorf("int64 negative overflow")
|
||||||
}
|
}
|
||||||
extraI = -1 - extraI
|
extraI = -1 - extraI
|
||||||
default:
|
default:
|
||||||
|
@ -539,20 +539,8 @@ func (sm *StorageMinerAPI) MarketListDeals(ctx context.Context) ([]*api.MarketDe
|
|||||||
return sm.listDeals(ctx)
|
return sm.listDeals(ctx)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (sm *StorageMinerAPI) MarketListRetrievalDeals(ctx context.Context) ([]retrievalmarket.ProviderDealState, error) {
|
func (sm *StorageMinerAPI) MarketListRetrievalDeals(ctx context.Context) ([]struct{}, error) {
|
||||||
var out []retrievalmarket.ProviderDealState
|
return []struct{}{}, nil
|
||||||
deals := sm.RetrievalProvider.ListDeals()
|
|
||||||
|
|
||||||
for _, deal := range deals {
|
|
||||||
if deal.ChannelID != nil {
|
|
||||||
if deal.ChannelID.Initiator == "" || deal.ChannelID.Responder == "" {
|
|
||||||
deal.ChannelID = nil // don't try to push unparsable peer IDs over jsonrpc
|
|
||||||
}
|
|
||||||
}
|
|
||||||
out = append(out, deal)
|
|
||||||
}
|
|
||||||
|
|
||||||
return out, nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (sm *StorageMinerAPI) MarketGetDealUpdates(ctx context.Context) (<-chan storagemarket.MinerDeal, error) {
|
func (sm *StorageMinerAPI) MarketGetDealUpdates(ctx context.Context) (<-chan storagemarket.MinerDeal, error) {
|
||||||
|
@ -33,22 +33,6 @@ func (t *VoucherInfo) MarshalCBOR(w io.Writer) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
// t.Voucher (paych.SignedVoucher) (struct)
|
|
||||||
if len("Voucher") > cbg.MaxLength {
|
|
||||||
return xerrors.Errorf("Value in field \"Voucher\" was too long")
|
|
||||||
}
|
|
||||||
|
|
||||||
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("Voucher"))); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
if _, err := io.WriteString(w, string("Voucher")); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
if err := t.Voucher.MarshalCBOR(cw); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
// t.Proof ([]uint8) (slice)
|
// t.Proof ([]uint8) (slice)
|
||||||
if len("Proof") > cbg.MaxLength {
|
if len("Proof") > cbg.MaxLength {
|
||||||
return xerrors.Errorf("Value in field \"Proof\" was too long")
|
return xerrors.Errorf("Value in field \"Proof\" was too long")
|
||||||
@ -73,6 +57,22 @@ func (t *VoucherInfo) MarshalCBOR(w io.Writer) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// t.Voucher (paych.SignedVoucher) (struct)
|
||||||
|
if len("Voucher") > cbg.MaxLength {
|
||||||
|
return xerrors.Errorf("Value in field \"Voucher\" was too long")
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("Voucher"))); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if _, err := io.WriteString(w, string("Voucher")); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := t.Voucher.MarshalCBOR(cw); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
// t.Submitted (bool) (bool)
|
// t.Submitted (bool) (bool)
|
||||||
if len("Submitted") > cbg.MaxLength {
|
if len("Submitted") > cbg.MaxLength {
|
||||||
return xerrors.Errorf("Value in field \"Submitted\" was too long")
|
return xerrors.Errorf("Value in field \"Submitted\" was too long")
|
||||||
@ -129,26 +129,6 @@ func (t *VoucherInfo) UnmarshalCBOR(r io.Reader) (err error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
switch name {
|
switch name {
|
||||||
// t.Voucher (paych.SignedVoucher) (struct)
|
|
||||||
case "Voucher":
|
|
||||||
|
|
||||||
{
|
|
||||||
|
|
||||||
b, err := cr.ReadByte()
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
if b != cbg.CborNull[0] {
|
|
||||||
if err := cr.UnreadByte(); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
t.Voucher = new(paych.SignedVoucher)
|
|
||||||
if err := t.Voucher.UnmarshalCBOR(cr); err != nil {
|
|
||||||
return xerrors.Errorf("unmarshaling t.Voucher pointer: %w", err)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
// t.Proof ([]uint8) (slice)
|
// t.Proof ([]uint8) (slice)
|
||||||
case "Proof":
|
case "Proof":
|
||||||
|
|
||||||
@ -171,6 +151,26 @@ func (t *VoucherInfo) UnmarshalCBOR(r io.Reader) (err error) {
|
|||||||
if _, err := io.ReadFull(cr, t.Proof[:]); err != nil {
|
if _, err := io.ReadFull(cr, t.Proof[:]); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
// t.Voucher (paych.SignedVoucher) (struct)
|
||||||
|
case "Voucher":
|
||||||
|
|
||||||
|
{
|
||||||
|
|
||||||
|
b, err := cr.ReadByte()
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if b != cbg.CborNull[0] {
|
||||||
|
if err := cr.UnreadByte(); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
t.Voucher = new(paych.SignedVoucher)
|
||||||
|
if err := t.Voucher.UnmarshalCBOR(cr); err != nil {
|
||||||
|
return xerrors.Errorf("unmarshaling t.Voucher pointer: %w", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
// t.Submitted (bool) (bool)
|
// t.Submitted (bool) (bool)
|
||||||
case "Submitted":
|
case "Submitted":
|
||||||
|
|
||||||
@ -210,26 +210,35 @@ func (t *ChannelInfo) MarshalCBOR(w io.Writer) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
// t.ChannelID (string) (string)
|
// t.Amount (big.Int) (struct)
|
||||||
if len("ChannelID") > cbg.MaxLength {
|
if len("Amount") > cbg.MaxLength {
|
||||||
return xerrors.Errorf("Value in field \"ChannelID\" was too long")
|
return xerrors.Errorf("Value in field \"Amount\" was too long")
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("ChannelID"))); err != nil {
|
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("Amount"))); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if _, err := io.WriteString(w, string("ChannelID")); err != nil {
|
if _, err := io.WriteString(w, string("Amount")); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(t.ChannelID) > cbg.MaxLength {
|
if err := t.Amount.MarshalCBOR(cw); err != nil {
|
||||||
return xerrors.Errorf("Value in field t.ChannelID was too long")
|
|
||||||
}
|
|
||||||
|
|
||||||
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.ChannelID))); err != nil {
|
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if _, err := io.WriteString(w, string(t.ChannelID)); err != nil {
|
|
||||||
|
// t.Target (address.Address) (struct)
|
||||||
|
if len("Target") > cbg.MaxLength {
|
||||||
|
return xerrors.Errorf("Value in field \"Target\" was too long")
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("Target"))); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if _, err := io.WriteString(w, string("Target")); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := t.Target.MarshalCBOR(cw); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -265,35 +274,35 @@ func (t *ChannelInfo) MarshalCBOR(w io.Writer) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
// t.Target (address.Address) (struct)
|
// t.NextLane (uint64) (uint64)
|
||||||
if len("Target") > cbg.MaxLength {
|
if len("NextLane") > cbg.MaxLength {
|
||||||
return xerrors.Errorf("Value in field \"Target\" was too long")
|
return xerrors.Errorf("Value in field \"NextLane\" was too long")
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("Target"))); err != nil {
|
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("NextLane"))); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if _, err := io.WriteString(w, string("Target")); err != nil {
|
if _, err := io.WriteString(w, string("NextLane")); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := t.Target.MarshalCBOR(cw); err != nil {
|
if err := cw.WriteMajorTypeHeader(cbg.MajUnsignedInt, uint64(t.NextLane)); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
// t.Direction (uint64) (uint64)
|
// t.Settling (bool) (bool)
|
||||||
if len("Direction") > cbg.MaxLength {
|
if len("Settling") > cbg.MaxLength {
|
||||||
return xerrors.Errorf("Value in field \"Direction\" was too long")
|
return xerrors.Errorf("Value in field \"Settling\" was too long")
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("Direction"))); err != nil {
|
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("Settling"))); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if _, err := io.WriteString(w, string("Direction")); err != nil {
|
if _, err := io.WriteString(w, string("Settling")); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := cw.WriteMajorTypeHeader(cbg.MajUnsignedInt, uint64(t.Direction)); err != nil {
|
if err := cbg.WriteBool(w, t.Settling); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -322,35 +331,102 @@ func (t *ChannelInfo) MarshalCBOR(w io.Writer) error {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// t.NextLane (uint64) (uint64)
|
// t.ChannelID (string) (string)
|
||||||
if len("NextLane") > cbg.MaxLength {
|
if len("ChannelID") > cbg.MaxLength {
|
||||||
return xerrors.Errorf("Value in field \"NextLane\" was too long")
|
return xerrors.Errorf("Value in field \"ChannelID\" was too long")
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("NextLane"))); err != nil {
|
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("ChannelID"))); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if _, err := io.WriteString(w, string("NextLane")); err != nil {
|
if _, err := io.WriteString(w, string("ChannelID")); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := cw.WriteMajorTypeHeader(cbg.MajUnsignedInt, uint64(t.NextLane)); err != nil {
|
if len(t.ChannelID) > cbg.MaxLength {
|
||||||
|
return xerrors.Errorf("Value in field t.ChannelID was too long")
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.ChannelID))); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if _, err := io.WriteString(w, string(t.ChannelID)); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
// t.Amount (big.Int) (struct)
|
// t.CreateMsg (cid.Cid) (struct)
|
||||||
if len("Amount") > cbg.MaxLength {
|
if len("CreateMsg") > cbg.MaxLength {
|
||||||
return xerrors.Errorf("Value in field \"Amount\" was too long")
|
return xerrors.Errorf("Value in field \"CreateMsg\" was too long")
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("Amount"))); err != nil {
|
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("CreateMsg"))); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if _, err := io.WriteString(w, string("Amount")); err != nil {
|
if _, err := io.WriteString(w, string("CreateMsg")); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := t.Amount.MarshalCBOR(cw); err != nil {
|
if t.CreateMsg == nil {
|
||||||
|
if _, err := cw.Write(cbg.CborNull); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if err := cbg.WriteCid(cw, *t.CreateMsg); err != nil {
|
||||||
|
return xerrors.Errorf("failed to write cid field t.CreateMsg: %w", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// t.Direction (uint64) (uint64)
|
||||||
|
if len("Direction") > cbg.MaxLength {
|
||||||
|
return xerrors.Errorf("Value in field \"Direction\" was too long")
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("Direction"))); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if _, err := io.WriteString(w, string("Direction")); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := cw.WriteMajorTypeHeader(cbg.MajUnsignedInt, uint64(t.Direction)); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
// t.AddFundsMsg (cid.Cid) (struct)
|
||||||
|
if len("AddFundsMsg") > cbg.MaxLength {
|
||||||
|
return xerrors.Errorf("Value in field \"AddFundsMsg\" was too long")
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("AddFundsMsg"))); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if _, err := io.WriteString(w, string("AddFundsMsg")); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
if t.AddFundsMsg == nil {
|
||||||
|
if _, err := cw.Write(cbg.CborNull); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if err := cbg.WriteCid(cw, *t.AddFundsMsg); err != nil {
|
||||||
|
return xerrors.Errorf("failed to write cid field t.AddFundsMsg: %w", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// t.PendingAmount (big.Int) (struct)
|
||||||
|
if len("PendingAmount") > cbg.MaxLength {
|
||||||
|
return xerrors.Errorf("Value in field \"PendingAmount\" was too long")
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("PendingAmount"))); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if _, err := io.WriteString(w, string("PendingAmount")); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := t.PendingAmount.MarshalCBOR(cw); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -385,82 +461,6 @@ func (t *ChannelInfo) MarshalCBOR(w io.Writer) error {
|
|||||||
if err := t.PendingAvailableAmount.MarshalCBOR(cw); err != nil {
|
if err := t.PendingAvailableAmount.MarshalCBOR(cw); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
// t.PendingAmount (big.Int) (struct)
|
|
||||||
if len("PendingAmount") > cbg.MaxLength {
|
|
||||||
return xerrors.Errorf("Value in field \"PendingAmount\" was too long")
|
|
||||||
}
|
|
||||||
|
|
||||||
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("PendingAmount"))); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
if _, err := io.WriteString(w, string("PendingAmount")); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
if err := t.PendingAmount.MarshalCBOR(cw); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
// t.CreateMsg (cid.Cid) (struct)
|
|
||||||
if len("CreateMsg") > cbg.MaxLength {
|
|
||||||
return xerrors.Errorf("Value in field \"CreateMsg\" was too long")
|
|
||||||
}
|
|
||||||
|
|
||||||
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("CreateMsg"))); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
if _, err := io.WriteString(w, string("CreateMsg")); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
if t.CreateMsg == nil {
|
|
||||||
if _, err := cw.Write(cbg.CborNull); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if err := cbg.WriteCid(cw, *t.CreateMsg); err != nil {
|
|
||||||
return xerrors.Errorf("failed to write cid field t.CreateMsg: %w", err)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// t.AddFundsMsg (cid.Cid) (struct)
|
|
||||||
if len("AddFundsMsg") > cbg.MaxLength {
|
|
||||||
return xerrors.Errorf("Value in field \"AddFundsMsg\" was too long")
|
|
||||||
}
|
|
||||||
|
|
||||||
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("AddFundsMsg"))); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
if _, err := io.WriteString(w, string("AddFundsMsg")); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
if t.AddFundsMsg == nil {
|
|
||||||
if _, err := cw.Write(cbg.CborNull); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if err := cbg.WriteCid(cw, *t.AddFundsMsg); err != nil {
|
|
||||||
return xerrors.Errorf("failed to write cid field t.AddFundsMsg: %w", err)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// t.Settling (bool) (bool)
|
|
||||||
if len("Settling") > cbg.MaxLength {
|
|
||||||
return xerrors.Errorf("Value in field \"Settling\" was too long")
|
|
||||||
}
|
|
||||||
|
|
||||||
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("Settling"))); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
if _, err := io.WriteString(w, string("Settling")); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
if err := cbg.WriteBool(w, t.Settling); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -502,16 +502,25 @@ func (t *ChannelInfo) UnmarshalCBOR(r io.Reader) (err error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
switch name {
|
switch name {
|
||||||
// t.ChannelID (string) (string)
|
// t.Amount (big.Int) (struct)
|
||||||
case "ChannelID":
|
case "Amount":
|
||||||
|
|
||||||
{
|
{
|
||||||
sval, err := cbg.ReadString(cr)
|
|
||||||
if err != nil {
|
if err := t.Amount.UnmarshalCBOR(cr); err != nil {
|
||||||
return err
|
return xerrors.Errorf("unmarshaling t.Amount: %w", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
// t.Target (address.Address) (struct)
|
||||||
|
case "Target":
|
||||||
|
|
||||||
|
{
|
||||||
|
|
||||||
|
if err := t.Target.UnmarshalCBOR(cr); err != nil {
|
||||||
|
return xerrors.Errorf("unmarshaling t.Target: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
t.ChannelID = string(sval)
|
|
||||||
}
|
}
|
||||||
// t.Channel (address.Address) (struct)
|
// t.Channel (address.Address) (struct)
|
||||||
case "Channel":
|
case "Channel":
|
||||||
@ -543,18 +552,8 @@ func (t *ChannelInfo) UnmarshalCBOR(r io.Reader) (err error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
// t.Target (address.Address) (struct)
|
// t.NextLane (uint64) (uint64)
|
||||||
case "Target":
|
case "NextLane":
|
||||||
|
|
||||||
{
|
|
||||||
|
|
||||||
if err := t.Target.UnmarshalCBOR(cr); err != nil {
|
|
||||||
return xerrors.Errorf("unmarshaling t.Target: %w", err)
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
// t.Direction (uint64) (uint64)
|
|
||||||
case "Direction":
|
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -565,9 +564,27 @@ func (t *ChannelInfo) UnmarshalCBOR(r io.Reader) (err error) {
|
|||||||
if maj != cbg.MajUnsignedInt {
|
if maj != cbg.MajUnsignedInt {
|
||||||
return fmt.Errorf("wrong type for uint64 field")
|
return fmt.Errorf("wrong type for uint64 field")
|
||||||
}
|
}
|
||||||
t.Direction = uint64(extra)
|
t.NextLane = uint64(extra)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
// t.Settling (bool) (bool)
|
||||||
|
case "Settling":
|
||||||
|
|
||||||
|
maj, extra, err = cr.ReadHeader()
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if maj != cbg.MajOther {
|
||||||
|
return fmt.Errorf("booleans must be major type 7")
|
||||||
|
}
|
||||||
|
switch extra {
|
||||||
|
case 20:
|
||||||
|
t.Settling = false
|
||||||
|
case 21:
|
||||||
|
t.Settling = true
|
||||||
|
default:
|
||||||
|
return fmt.Errorf("booleans are either major type 7, value 20 or 21 (got %d)", extra)
|
||||||
|
}
|
||||||
// t.Vouchers ([]*paychmgr.VoucherInfo) (slice)
|
// t.Vouchers ([]*paychmgr.VoucherInfo) (slice)
|
||||||
case "Vouchers":
|
case "Vouchers":
|
||||||
|
|
||||||
@ -598,60 +615,16 @@ func (t *ChannelInfo) UnmarshalCBOR(r io.Reader) (err error) {
|
|||||||
t.Vouchers[i] = &v
|
t.Vouchers[i] = &v
|
||||||
}
|
}
|
||||||
|
|
||||||
// t.NextLane (uint64) (uint64)
|
// t.ChannelID (string) (string)
|
||||||
case "NextLane":
|
case "ChannelID":
|
||||||
|
|
||||||
{
|
{
|
||||||
|
sval, err := cbg.ReadString(cr)
|
||||||
maj, extra, err = cr.ReadHeader()
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if maj != cbg.MajUnsignedInt {
|
|
||||||
return fmt.Errorf("wrong type for uint64 field")
|
|
||||||
}
|
|
||||||
t.NextLane = uint64(extra)
|
|
||||||
|
|
||||||
}
|
|
||||||
// t.Amount (big.Int) (struct)
|
|
||||||
case "Amount":
|
|
||||||
|
|
||||||
{
|
|
||||||
|
|
||||||
if err := t.Amount.UnmarshalCBOR(cr); err != nil {
|
|
||||||
return xerrors.Errorf("unmarshaling t.Amount: %w", err)
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
// t.AvailableAmount (big.Int) (struct)
|
|
||||||
case "AvailableAmount":
|
|
||||||
|
|
||||||
{
|
|
||||||
|
|
||||||
if err := t.AvailableAmount.UnmarshalCBOR(cr); err != nil {
|
|
||||||
return xerrors.Errorf("unmarshaling t.AvailableAmount: %w", err)
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
// t.PendingAvailableAmount (big.Int) (struct)
|
|
||||||
case "PendingAvailableAmount":
|
|
||||||
|
|
||||||
{
|
|
||||||
|
|
||||||
if err := t.PendingAvailableAmount.UnmarshalCBOR(cr); err != nil {
|
|
||||||
return xerrors.Errorf("unmarshaling t.PendingAvailableAmount: %w", err)
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
// t.PendingAmount (big.Int) (struct)
|
|
||||||
case "PendingAmount":
|
|
||||||
|
|
||||||
{
|
|
||||||
|
|
||||||
if err := t.PendingAmount.UnmarshalCBOR(cr); err != nil {
|
|
||||||
return xerrors.Errorf("unmarshaling t.PendingAmount: %w", err)
|
|
||||||
}
|
|
||||||
|
|
||||||
|
t.ChannelID = string(sval)
|
||||||
}
|
}
|
||||||
// t.CreateMsg (cid.Cid) (struct)
|
// t.CreateMsg (cid.Cid) (struct)
|
||||||
case "CreateMsg":
|
case "CreateMsg":
|
||||||
@ -675,6 +648,21 @@ func (t *ChannelInfo) UnmarshalCBOR(r io.Reader) (err error) {
|
|||||||
t.CreateMsg = &c
|
t.CreateMsg = &c
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
// t.Direction (uint64) (uint64)
|
||||||
|
case "Direction":
|
||||||
|
|
||||||
|
{
|
||||||
|
|
||||||
|
maj, extra, err = cr.ReadHeader()
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if maj != cbg.MajUnsignedInt {
|
||||||
|
return fmt.Errorf("wrong type for uint64 field")
|
||||||
|
}
|
||||||
|
t.Direction = uint64(extra)
|
||||||
|
|
||||||
}
|
}
|
||||||
// t.AddFundsMsg (cid.Cid) (struct)
|
// t.AddFundsMsg (cid.Cid) (struct)
|
||||||
case "AddFundsMsg":
|
case "AddFundsMsg":
|
||||||
@ -699,23 +687,35 @@ func (t *ChannelInfo) UnmarshalCBOR(r io.Reader) (err error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
// t.Settling (bool) (bool)
|
// t.PendingAmount (big.Int) (struct)
|
||||||
case "Settling":
|
case "PendingAmount":
|
||||||
|
|
||||||
maj, extra, err = cr.ReadHeader()
|
{
|
||||||
if err != nil {
|
|
||||||
return err
|
if err := t.PendingAmount.UnmarshalCBOR(cr); err != nil {
|
||||||
|
return xerrors.Errorf("unmarshaling t.PendingAmount: %w", err)
|
||||||
}
|
}
|
||||||
if maj != cbg.MajOther {
|
|
||||||
return fmt.Errorf("booleans must be major type 7")
|
|
||||||
}
|
}
|
||||||
switch extra {
|
// t.AvailableAmount (big.Int) (struct)
|
||||||
case 20:
|
case "AvailableAmount":
|
||||||
t.Settling = false
|
|
||||||
case 21:
|
{
|
||||||
t.Settling = true
|
|
||||||
default:
|
if err := t.AvailableAmount.UnmarshalCBOR(cr); err != nil {
|
||||||
return fmt.Errorf("booleans are either major type 7, value 20 or 21 (got %d)", extra)
|
return xerrors.Errorf("unmarshaling t.AvailableAmount: %w", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
// t.PendingAvailableAmount (big.Int) (struct)
|
||||||
|
case "PendingAvailableAmount":
|
||||||
|
|
||||||
|
{
|
||||||
|
|
||||||
|
if err := t.PendingAvailableAmount.UnmarshalCBOR(cr); err != nil {
|
||||||
|
return xerrors.Errorf("unmarshaling t.PendingAvailableAmount: %w", err)
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
default:
|
default:
|
||||||
@ -738,26 +738,26 @@ func (t *MsgInfo) MarshalCBOR(w io.Writer) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
// t.ChannelID (string) (string)
|
// t.Err (string) (string)
|
||||||
if len("ChannelID") > cbg.MaxLength {
|
if len("Err") > cbg.MaxLength {
|
||||||
return xerrors.Errorf("Value in field \"ChannelID\" was too long")
|
return xerrors.Errorf("Value in field \"Err\" was too long")
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("ChannelID"))); err != nil {
|
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("Err"))); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if _, err := io.WriteString(w, string("ChannelID")); err != nil {
|
if _, err := io.WriteString(w, string("Err")); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(t.ChannelID) > cbg.MaxLength {
|
if len(t.Err) > cbg.MaxLength {
|
||||||
return xerrors.Errorf("Value in field t.ChannelID was too long")
|
return xerrors.Errorf("Value in field t.Err was too long")
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.ChannelID))); err != nil {
|
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Err))); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if _, err := io.WriteString(w, string(t.ChannelID)); err != nil {
|
if _, err := io.WriteString(w, string(t.Err)); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -793,26 +793,26 @@ func (t *MsgInfo) MarshalCBOR(w io.Writer) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
// t.Err (string) (string)
|
// t.ChannelID (string) (string)
|
||||||
if len("Err") > cbg.MaxLength {
|
if len("ChannelID") > cbg.MaxLength {
|
||||||
return xerrors.Errorf("Value in field \"Err\" was too long")
|
return xerrors.Errorf("Value in field \"ChannelID\" was too long")
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("Err"))); err != nil {
|
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("ChannelID"))); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if _, err := io.WriteString(w, string("Err")); err != nil {
|
if _, err := io.WriteString(w, string("ChannelID")); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(t.Err) > cbg.MaxLength {
|
if len(t.ChannelID) > cbg.MaxLength {
|
||||||
return xerrors.Errorf("Value in field t.Err was too long")
|
return xerrors.Errorf("Value in field t.ChannelID was too long")
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Err))); err != nil {
|
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.ChannelID))); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if _, err := io.WriteString(w, string(t.Err)); err != nil {
|
if _, err := io.WriteString(w, string(t.ChannelID)); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
@ -856,8 +856,8 @@ func (t *MsgInfo) UnmarshalCBOR(r io.Reader) (err error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
switch name {
|
switch name {
|
||||||
// t.ChannelID (string) (string)
|
// t.Err (string) (string)
|
||||||
case "ChannelID":
|
case "Err":
|
||||||
|
|
||||||
{
|
{
|
||||||
sval, err := cbg.ReadString(cr)
|
sval, err := cbg.ReadString(cr)
|
||||||
@ -865,7 +865,7 @@ func (t *MsgInfo) UnmarshalCBOR(r io.Reader) (err error) {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
t.ChannelID = string(sval)
|
t.Err = string(sval)
|
||||||
}
|
}
|
||||||
// t.MsgCid (cid.Cid) (struct)
|
// t.MsgCid (cid.Cid) (struct)
|
||||||
case "MsgCid":
|
case "MsgCid":
|
||||||
@ -898,8 +898,8 @@ func (t *MsgInfo) UnmarshalCBOR(r io.Reader) (err error) {
|
|||||||
default:
|
default:
|
||||||
return fmt.Errorf("booleans are either major type 7, value 20 or 21 (got %d)", extra)
|
return fmt.Errorf("booleans are either major type 7, value 20 or 21 (got %d)", extra)
|
||||||
}
|
}
|
||||||
// t.Err (string) (string)
|
// t.ChannelID (string) (string)
|
||||||
case "Err":
|
case "ChannelID":
|
||||||
|
|
||||||
{
|
{
|
||||||
sval, err := cbg.ReadString(cr)
|
sval, err := cbg.ReadString(cr)
|
||||||
@ -907,7 +907,7 @@ func (t *MsgInfo) UnmarshalCBOR(r io.Reader) (err error) {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
t.Err = string(sval)
|
t.ChannelID = string(sval)
|
||||||
}
|
}
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -48,29 +48,6 @@ func (t *Call) MarshalCBOR(w io.Writer) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
// t.RetType (sealer.ReturnType) (string)
|
|
||||||
if len("RetType") > cbg.MaxLength {
|
|
||||||
return xerrors.Errorf("Value in field \"RetType\" was too long")
|
|
||||||
}
|
|
||||||
|
|
||||||
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("RetType"))); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
if _, err := io.WriteString(w, string("RetType")); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
if len(t.RetType) > cbg.MaxLength {
|
|
||||||
return xerrors.Errorf("Value in field t.RetType was too long")
|
|
||||||
}
|
|
||||||
|
|
||||||
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.RetType))); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
if _, err := io.WriteString(w, string(t.RetType)); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
// t.State (sealer.CallState) (uint64)
|
// t.State (sealer.CallState) (uint64)
|
||||||
if len("State") > cbg.MaxLength {
|
if len("State") > cbg.MaxLength {
|
||||||
return xerrors.Errorf("Value in field \"State\" was too long")
|
return xerrors.Errorf("Value in field \"State\" was too long")
|
||||||
@ -102,6 +79,29 @@ func (t *Call) MarshalCBOR(w io.Writer) error {
|
|||||||
if err := t.Result.MarshalCBOR(cw); err != nil {
|
if err := t.Result.MarshalCBOR(cw); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// t.RetType (sealer.ReturnType) (string)
|
||||||
|
if len("RetType") > cbg.MaxLength {
|
||||||
|
return xerrors.Errorf("Value in field \"RetType\" was too long")
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("RetType"))); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if _, err := io.WriteString(w, string("RetType")); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(t.RetType) > cbg.MaxLength {
|
||||||
|
return xerrors.Errorf("Value in field t.RetType was too long")
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.RetType))); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if _, err := io.WriteString(w, string(t.RetType)); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -153,17 +153,6 @@ func (t *Call) UnmarshalCBOR(r io.Reader) (err error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
// t.RetType (sealer.ReturnType) (string)
|
|
||||||
case "RetType":
|
|
||||||
|
|
||||||
{
|
|
||||||
sval, err := cbg.ReadString(cr)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
t.RetType = ReturnType(sval)
|
|
||||||
}
|
|
||||||
// t.State (sealer.CallState) (uint64)
|
// t.State (sealer.CallState) (uint64)
|
||||||
case "State":
|
case "State":
|
||||||
|
|
||||||
@ -199,6 +188,17 @@ func (t *Call) UnmarshalCBOR(r io.Reader) (err error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
// t.RetType (sealer.ReturnType) (string)
|
||||||
|
case "RetType":
|
||||||
|
|
||||||
|
{
|
||||||
|
sval, err := cbg.ReadString(cr)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
t.RetType = ReturnType(sval)
|
||||||
|
}
|
||||||
|
|
||||||
default:
|
default:
|
||||||
// Field doesn't exist on this type, so ignore it
|
// Field doesn't exist on this type, so ignore it
|
||||||
@ -259,21 +259,27 @@ func (t *WorkState) MarshalCBOR(w io.Writer) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
// t.WorkerCall (storiface.CallID) (struct)
|
// t.StartTime (int64) (int64)
|
||||||
if len("WorkerCall") > cbg.MaxLength {
|
if len("StartTime") > cbg.MaxLength {
|
||||||
return xerrors.Errorf("Value in field \"WorkerCall\" was too long")
|
return xerrors.Errorf("Value in field \"StartTime\" was too long")
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("WorkerCall"))); err != nil {
|
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("StartTime"))); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if _, err := io.WriteString(w, string("WorkerCall")); err != nil {
|
if _, err := io.WriteString(w, string("StartTime")); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := t.WorkerCall.MarshalCBOR(cw); err != nil {
|
if t.StartTime >= 0 {
|
||||||
|
if err := cw.WriteMajorTypeHeader(cbg.MajUnsignedInt, uint64(t.StartTime)); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
if err := cw.WriteMajorTypeHeader(cbg.MajNegativeInt, uint64(-t.StartTime-1)); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// t.WorkError (string) (string)
|
// t.WorkError (string) (string)
|
||||||
if len("WorkError") > cbg.MaxLength {
|
if len("WorkError") > cbg.MaxLength {
|
||||||
@ -298,6 +304,22 @@ func (t *WorkState) MarshalCBOR(w io.Writer) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// t.WorkerCall (storiface.CallID) (struct)
|
||||||
|
if len("WorkerCall") > cbg.MaxLength {
|
||||||
|
return xerrors.Errorf("Value in field \"WorkerCall\" was too long")
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("WorkerCall"))); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if _, err := io.WriteString(w, string("WorkerCall")); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := t.WorkerCall.MarshalCBOR(cw); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
// t.WorkerHostname (string) (string)
|
// t.WorkerHostname (string) (string)
|
||||||
if len("WorkerHostname") > cbg.MaxLength {
|
if len("WorkerHostname") > cbg.MaxLength {
|
||||||
return xerrors.Errorf("Value in field \"WorkerHostname\" was too long")
|
return xerrors.Errorf("Value in field \"WorkerHostname\" was too long")
|
||||||
@ -320,28 +342,6 @@ func (t *WorkState) MarshalCBOR(w io.Writer) error {
|
|||||||
if _, err := io.WriteString(w, string(t.WorkerHostname)); err != nil {
|
if _, err := io.WriteString(w, string(t.WorkerHostname)); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
// t.StartTime (int64) (int64)
|
|
||||||
if len("StartTime") > cbg.MaxLength {
|
|
||||||
return xerrors.Errorf("Value in field \"StartTime\" was too long")
|
|
||||||
}
|
|
||||||
|
|
||||||
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("StartTime"))); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
if _, err := io.WriteString(w, string("StartTime")); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
if t.StartTime >= 0 {
|
|
||||||
if err := cw.WriteMajorTypeHeader(cbg.MajUnsignedInt, uint64(t.StartTime)); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if err := cw.WriteMajorTypeHeader(cbg.MajNegativeInt, uint64(-t.StartTime-1)); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -404,38 +404,6 @@ func (t *WorkState) UnmarshalCBOR(r io.Reader) (err error) {
|
|||||||
|
|
||||||
t.Status = WorkStatus(sval)
|
t.Status = WorkStatus(sval)
|
||||||
}
|
}
|
||||||
// t.WorkerCall (storiface.CallID) (struct)
|
|
||||||
case "WorkerCall":
|
|
||||||
|
|
||||||
{
|
|
||||||
|
|
||||||
if err := t.WorkerCall.UnmarshalCBOR(cr); err != nil {
|
|
||||||
return xerrors.Errorf("unmarshaling t.WorkerCall: %w", err)
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
// t.WorkError (string) (string)
|
|
||||||
case "WorkError":
|
|
||||||
|
|
||||||
{
|
|
||||||
sval, err := cbg.ReadString(cr)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
t.WorkError = string(sval)
|
|
||||||
}
|
|
||||||
// t.WorkerHostname (string) (string)
|
|
||||||
case "WorkerHostname":
|
|
||||||
|
|
||||||
{
|
|
||||||
sval, err := cbg.ReadString(cr)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
t.WorkerHostname = string(sval)
|
|
||||||
}
|
|
||||||
// t.StartTime (int64) (int64)
|
// t.StartTime (int64) (int64)
|
||||||
case "StartTime":
|
case "StartTime":
|
||||||
{
|
{
|
||||||
@ -453,7 +421,7 @@ func (t *WorkState) UnmarshalCBOR(r io.Reader) (err error) {
|
|||||||
case cbg.MajNegativeInt:
|
case cbg.MajNegativeInt:
|
||||||
extraI = int64(extra)
|
extraI = int64(extra)
|
||||||
if extraI < 0 {
|
if extraI < 0 {
|
||||||
return fmt.Errorf("int64 negative oveflow")
|
return fmt.Errorf("int64 negative overflow")
|
||||||
}
|
}
|
||||||
extraI = -1 - extraI
|
extraI = -1 - extraI
|
||||||
default:
|
default:
|
||||||
@ -462,6 +430,38 @@ func (t *WorkState) UnmarshalCBOR(r io.Reader) (err error) {
|
|||||||
|
|
||||||
t.StartTime = int64(extraI)
|
t.StartTime = int64(extraI)
|
||||||
}
|
}
|
||||||
|
// t.WorkError (string) (string)
|
||||||
|
case "WorkError":
|
||||||
|
|
||||||
|
{
|
||||||
|
sval, err := cbg.ReadString(cr)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
t.WorkError = string(sval)
|
||||||
|
}
|
||||||
|
// t.WorkerCall (storiface.CallID) (struct)
|
||||||
|
case "WorkerCall":
|
||||||
|
|
||||||
|
{
|
||||||
|
|
||||||
|
if err := t.WorkerCall.UnmarshalCBOR(cr); err != nil {
|
||||||
|
return xerrors.Errorf("unmarshaling t.WorkerCall: %w", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
// t.WorkerHostname (string) (string)
|
||||||
|
case "WorkerHostname":
|
||||||
|
|
||||||
|
{
|
||||||
|
sval, err := cbg.ReadString(cr)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
t.WorkerHostname = string(sval)
|
||||||
|
}
|
||||||
|
|
||||||
default:
|
default:
|
||||||
// Field doesn't exist on this type, so ignore it
|
// Field doesn't exist on this type, so ignore it
|
||||||
|
@ -30,22 +30,6 @@ func (t *CallID) MarshalCBOR(w io.Writer) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
// t.Sector (abi.SectorID) (struct)
|
|
||||||
if len("Sector") > cbg.MaxLength {
|
|
||||||
return xerrors.Errorf("Value in field \"Sector\" was too long")
|
|
||||||
}
|
|
||||||
|
|
||||||
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("Sector"))); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
if _, err := io.WriteString(w, string("Sector")); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
if err := t.Sector.MarshalCBOR(cw); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
// t.ID (uuid.UUID) (array)
|
// t.ID (uuid.UUID) (array)
|
||||||
if len("ID") > cbg.MaxLength {
|
if len("ID") > cbg.MaxLength {
|
||||||
return xerrors.Errorf("Value in field \"ID\" was too long")
|
return xerrors.Errorf("Value in field \"ID\" was too long")
|
||||||
@ -69,6 +53,22 @@ func (t *CallID) MarshalCBOR(w io.Writer) error {
|
|||||||
if _, err := cw.Write(t.ID[:]); err != nil {
|
if _, err := cw.Write(t.ID[:]); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// t.Sector (abi.SectorID) (struct)
|
||||||
|
if len("Sector") > cbg.MaxLength {
|
||||||
|
return xerrors.Errorf("Value in field \"Sector\" was too long")
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("Sector"))); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if _, err := io.WriteString(w, string("Sector")); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := t.Sector.MarshalCBOR(cw); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -110,16 +110,6 @@ func (t *CallID) UnmarshalCBOR(r io.Reader) (err error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
switch name {
|
switch name {
|
||||||
// t.Sector (abi.SectorID) (struct)
|
|
||||||
case "Sector":
|
|
||||||
|
|
||||||
{
|
|
||||||
|
|
||||||
if err := t.Sector.UnmarshalCBOR(cr); err != nil {
|
|
||||||
return xerrors.Errorf("unmarshaling t.Sector: %w", err)
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
// t.ID (uuid.UUID) (array)
|
// t.ID (uuid.UUID) (array)
|
||||||
case "ID":
|
case "ID":
|
||||||
|
|
||||||
@ -144,6 +134,16 @@ func (t *CallID) UnmarshalCBOR(r io.Reader) (err error) {
|
|||||||
if _, err := io.ReadFull(cr, t.ID[:]); err != nil {
|
if _, err := io.ReadFull(cr, t.ID[:]); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
// t.Sector (abi.SectorID) (struct)
|
||||||
|
case "Sector":
|
||||||
|
|
||||||
|
{
|
||||||
|
|
||||||
|
if err := t.Sector.UnmarshalCBOR(cr); err != nil {
|
||||||
|
return xerrors.Errorf("unmarshaling t.Sector: %w", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
default:
|
default:
|
||||||
// Field doesn't exist on this type, so ignore it
|
// Field doesn't exist on this type, so ignore it
|
||||||
@ -294,22 +294,6 @@ func (t *SectorLocation) MarshalCBOR(w io.Writer) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
// t.Local (bool) (bool)
|
|
||||||
if len("Local") > cbg.MaxLength {
|
|
||||||
return xerrors.Errorf("Value in field \"Local\" was too long")
|
|
||||||
}
|
|
||||||
|
|
||||||
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("Local"))); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
if _, err := io.WriteString(w, string("Local")); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
if err := cbg.WriteBool(w, t.Local); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
// t.URL (string) (string)
|
// t.URL (string) (string)
|
||||||
if len("URL") > cbg.MaxLength {
|
if len("URL") > cbg.MaxLength {
|
||||||
return xerrors.Errorf("Value in field \"URL\" was too long")
|
return xerrors.Errorf("Value in field \"URL\" was too long")
|
||||||
@ -333,6 +317,22 @@ func (t *SectorLocation) MarshalCBOR(w io.Writer) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// t.Local (bool) (bool)
|
||||||
|
if len("Local") > cbg.MaxLength {
|
||||||
|
return xerrors.Errorf("Value in field \"Local\" was too long")
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("Local"))); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if _, err := io.WriteString(w, string("Local")); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := cbg.WriteBool(w, t.Local); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
// t.Headers ([]storiface.SecDataHttpHeader) (slice)
|
// t.Headers ([]storiface.SecDataHttpHeader) (slice)
|
||||||
if len("Headers") > cbg.MaxLength {
|
if len("Headers") > cbg.MaxLength {
|
||||||
return xerrors.Errorf("Value in field \"Headers\" was too long")
|
return xerrors.Errorf("Value in field \"Headers\" was too long")
|
||||||
@ -398,6 +398,17 @@ func (t *SectorLocation) UnmarshalCBOR(r io.Reader) (err error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
switch name {
|
switch name {
|
||||||
|
// t.URL (string) (string)
|
||||||
|
case "URL":
|
||||||
|
|
||||||
|
{
|
||||||
|
sval, err := cbg.ReadString(cr)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
t.URL = string(sval)
|
||||||
|
}
|
||||||
// t.Local (bool) (bool)
|
// t.Local (bool) (bool)
|
||||||
case "Local":
|
case "Local":
|
||||||
|
|
||||||
@ -416,17 +427,6 @@ func (t *SectorLocation) UnmarshalCBOR(r io.Reader) (err error) {
|
|||||||
default:
|
default:
|
||||||
return fmt.Errorf("booleans are either major type 7, value 20 or 21 (got %d)", extra)
|
return fmt.Errorf("booleans are either major type 7, value 20 or 21 (got %d)", extra)
|
||||||
}
|
}
|
||||||
// t.URL (string) (string)
|
|
||||||
case "URL":
|
|
||||||
|
|
||||||
{
|
|
||||||
sval, err := cbg.ReadString(cr)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
t.URL = string(sval)
|
|
||||||
}
|
|
||||||
// t.Headers ([]storiface.SecDataHttpHeader) (slice)
|
// t.Headers ([]storiface.SecDataHttpHeader) (slice)
|
||||||
case "Headers":
|
case "Headers":
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user