Merge pull request #811 from filecoin-project/feat/cleanup-sectorstate-structs

Use map representation in cbor for some structs
This commit is contained in:
Łukasz Magiera 2019-12-09 21:29:38 +01:00 committed by GitHub
commit 26ce2e9dc8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
16 changed files with 1168 additions and 670 deletions

View File

@ -96,9 +96,9 @@ type SectorInfo struct {
Deals []uint64
Ticket sectorbuilder.SealTicket
Seed sectorbuilder.SealSeed
Retries uint64
Retries uint64
LastErr string
LastErr string
}
type SealedRef struct {

View File

@ -18,16 +18,29 @@ func (t *PaymentInfo) MarshalCBOR(w io.Writer) error {
_, err := w.Write(cbg.CborNull)
return err
}
if _, err := w.Write([]byte{131}); err != nil {
if _, err := w.Write([]byte{163}); err != nil {
return err
}
// t.Channel (address.Address) (struct)
if _, err := w.Write(cbg.CborEncodeMajorType(cbg.MajTextString, uint64(len("Channel")))); err != nil {
return err
}
if _, err := w.Write([]byte("Channel")); err != nil {
return err
}
// t.t.Channel (address.Address) (struct)
if err := t.Channel.MarshalCBOR(w); err != nil {
return err
}
// t.t.ChannelMessage (cid.Cid) (struct)
// t.ChannelMessage (cid.Cid) (struct)
if _, err := w.Write(cbg.CborEncodeMajorType(cbg.MajTextString, uint64(len("ChannelMessage")))); err != nil {
return err
}
if _, err := w.Write([]byte("ChannelMessage")); err != nil {
return err
}
if t.ChannelMessage == nil {
if _, err := w.Write(cbg.CborNull); err != nil {
@ -39,7 +52,14 @@ func (t *PaymentInfo) MarshalCBOR(w io.Writer) error {
}
}
// t.t.Vouchers ([]*types.SignedVoucher) (slice)
// t.Vouchers ([]*types.SignedVoucher) (slice)
if _, err := w.Write(cbg.CborEncodeMajorType(cbg.MajTextString, uint64(len("Vouchers")))); err != nil {
return err
}
if _, err := w.Write([]byte("Vouchers")); err != nil {
return err
}
if _, err := w.Write(cbg.CborEncodeMajorType(cbg.MajArray, uint64(len(t.Vouchers)))); err != nil {
return err
}
@ -58,15 +78,30 @@ func (t *PaymentInfo) UnmarshalCBOR(r io.Reader) error {
if err != nil {
return err
}
if maj != cbg.MajArray {
return fmt.Errorf("cbor input should be of type array")
if maj != cbg.MajMap {
return fmt.Errorf("cbor input should be of type map")
}
if extra != 3 {
return fmt.Errorf("cbor input had wrong number of fields")
}
// t.t.Channel (address.Address) (struct)
var name string
// t.Channel (address.Address) (struct)
{
sval, err := cbg.ReadString(br)
if err != nil {
return err
}
name = string(sval)
}
if name != "Channel" {
return fmt.Errorf("expected struct map entry %s to be Channel", name)
}
{
@ -75,7 +110,20 @@ func (t *PaymentInfo) UnmarshalCBOR(r io.Reader) error {
}
}
// t.t.ChannelMessage (cid.Cid) (struct)
// t.ChannelMessage (cid.Cid) (struct)
{
sval, err := cbg.ReadString(br)
if err != nil {
return err
}
name = string(sval)
}
if name != "ChannelMessage" {
return fmt.Errorf("expected struct map entry %s to be ChannelMessage", name)
}
{
@ -99,7 +147,20 @@ func (t *PaymentInfo) UnmarshalCBOR(r io.Reader) error {
}
}
// t.t.Vouchers ([]*types.SignedVoucher) (slice)
// t.Vouchers ([]*types.SignedVoucher) (slice)
{
sval, err := cbg.ReadString(br)
if err != nil {
return err
}
name = string(sval)
}
if name != "Vouchers" {
return fmt.Errorf("expected struct map entry %s to be Vouchers", name)
}
maj, extra, err = cbg.CborReadHeader(br)
if err != nil {
@ -134,21 +195,42 @@ func (t *SealedRef) MarshalCBOR(w io.Writer) error {
_, err := w.Write(cbg.CborNull)
return err
}
if _, err := w.Write([]byte{131}); err != nil {
if _, err := w.Write([]byte{163}); err != nil {
return err
}
// t.SectorID (uint64) (uint64)
if _, err := w.Write(cbg.CborEncodeMajorType(cbg.MajTextString, uint64(len("SectorID")))); err != nil {
return err
}
if _, err := w.Write([]byte("SectorID")); err != nil {
return err
}
// t.t.SectorID (uint64) (uint64)
if _, err := w.Write(cbg.CborEncodeMajorType(cbg.MajUnsignedInt, uint64(t.SectorID))); err != nil {
return err
}
// t.t.Offset (uint64) (uint64)
// t.Offset (uint64) (uint64)
if _, err := w.Write(cbg.CborEncodeMajorType(cbg.MajTextString, uint64(len("Offset")))); err != nil {
return err
}
if _, err := w.Write([]byte("Offset")); err != nil {
return err
}
if _, err := w.Write(cbg.CborEncodeMajorType(cbg.MajUnsignedInt, uint64(t.Offset))); err != nil {
return err
}
// t.t.Size (uint64) (uint64)
// t.Size (uint64) (uint64)
if _, err := w.Write(cbg.CborEncodeMajorType(cbg.MajTextString, uint64(len("Size")))); err != nil {
return err
}
if _, err := w.Write([]byte("Size")); err != nil {
return err
}
if _, err := w.Write(cbg.CborEncodeMajorType(cbg.MajUnsignedInt, uint64(t.Size))); err != nil {
return err
}
@ -162,15 +244,30 @@ func (t *SealedRef) UnmarshalCBOR(r io.Reader) error {
if err != nil {
return err
}
if maj != cbg.MajArray {
return fmt.Errorf("cbor input should be of type array")
if maj != cbg.MajMap {
return fmt.Errorf("cbor input should be of type map")
}
if extra != 3 {
return fmt.Errorf("cbor input had wrong number of fields")
}
// t.t.SectorID (uint64) (uint64)
var name string
// t.SectorID (uint64) (uint64)
{
sval, err := cbg.ReadString(br)
if err != nil {
return err
}
name = string(sval)
}
if name != "SectorID" {
return fmt.Errorf("expected struct map entry %s to be SectorID", name)
}
maj, extra, err = cbg.CborReadHeader(br)
if err != nil {
@ -180,7 +277,20 @@ func (t *SealedRef) UnmarshalCBOR(r io.Reader) error {
return fmt.Errorf("wrong type for uint64 field")
}
t.SectorID = uint64(extra)
// t.t.Offset (uint64) (uint64)
// t.Offset (uint64) (uint64)
{
sval, err := cbg.ReadString(br)
if err != nil {
return err
}
name = string(sval)
}
if name != "Offset" {
return fmt.Errorf("expected struct map entry %s to be Offset", name)
}
maj, extra, err = cbg.CborReadHeader(br)
if err != nil {
@ -190,7 +300,20 @@ func (t *SealedRef) UnmarshalCBOR(r io.Reader) error {
return fmt.Errorf("wrong type for uint64 field")
}
t.Offset = uint64(extra)
// t.t.Size (uint64) (uint64)
// t.Size (uint64) (uint64)
{
sval, err := cbg.ReadString(br)
if err != nil {
return err
}
name = string(sval)
}
if name != "Size" {
return fmt.Errorf("expected struct map entry %s to be Size", name)
}
maj, extra, err = cbg.CborReadHeader(br)
if err != nil {
@ -208,11 +331,18 @@ func (t *SealedRefs) MarshalCBOR(w io.Writer) error {
_, err := w.Write(cbg.CborNull)
return err
}
if _, err := w.Write([]byte{129}); err != nil {
if _, err := w.Write([]byte{161}); err != nil {
return err
}
// t.Refs ([]api.SealedRef) (slice)
if _, err := w.Write(cbg.CborEncodeMajorType(cbg.MajTextString, uint64(len("Refs")))); err != nil {
return err
}
if _, err := w.Write([]byte("Refs")); err != nil {
return err
}
// t.t.Refs ([]api.SealedRef) (slice)
if _, err := w.Write(cbg.CborEncodeMajorType(cbg.MajArray, uint64(len(t.Refs)))); err != nil {
return err
}
@ -231,15 +361,30 @@ func (t *SealedRefs) UnmarshalCBOR(r io.Reader) error {
if err != nil {
return err
}
if maj != cbg.MajArray {
return fmt.Errorf("cbor input should be of type array")
if maj != cbg.MajMap {
return fmt.Errorf("cbor input should be of type map")
}
if extra != 1 {
return fmt.Errorf("cbor input had wrong number of fields")
}
// t.t.Refs ([]api.SealedRef) (slice)
var name string
// t.Refs ([]api.SealedRef) (slice)
{
sval, err := cbg.ReadString(br)
if err != nil {
return err
}
name = string(sval)
}
if name != "Refs" {
return fmt.Errorf("expected struct map entry %s to be Refs", name)
}
maj, extra, err = cbg.CborReadHeader(br)
if err != nil {

File diff suppressed because it is too large Load Diff

View File

@ -23,7 +23,7 @@ func (t *BlockSyncRequest) MarshalCBOR(w io.Writer) error {
return err
}
// t.t.Start ([]cid.Cid) (slice)
// t.Start ([]cid.Cid) (slice)
if _, err := w.Write(cbg.CborEncodeMajorType(cbg.MajArray, uint64(len(t.Start)))); err != nil {
return err
}
@ -33,12 +33,12 @@ func (t *BlockSyncRequest) MarshalCBOR(w io.Writer) error {
}
}
// t.t.RequestLength (uint64) (uint64)
// t.RequestLength (uint64) (uint64)
if _, err := w.Write(cbg.CborEncodeMajorType(cbg.MajUnsignedInt, uint64(t.RequestLength))); err != nil {
return err
}
// t.t.Options (uint64) (uint64)
// t.Options (uint64) (uint64)
if _, err := w.Write(cbg.CborEncodeMajorType(cbg.MajUnsignedInt, uint64(t.Options))); err != nil {
return err
}
@ -60,7 +60,7 @@ func (t *BlockSyncRequest) UnmarshalCBOR(r io.Reader) error {
return fmt.Errorf("cbor input had wrong number of fields")
}
// t.t.Start ([]cid.Cid) (slice)
// t.Start ([]cid.Cid) (slice)
maj, extra, err = cbg.CborReadHeader(br)
if err != nil {
@ -86,7 +86,7 @@ func (t *BlockSyncRequest) UnmarshalCBOR(r io.Reader) error {
t.Start[i] = c
}
// t.t.RequestLength (uint64) (uint64)
// t.RequestLength (uint64) (uint64)
maj, extra, err = cbg.CborReadHeader(br)
if err != nil {
@ -96,7 +96,7 @@ func (t *BlockSyncRequest) UnmarshalCBOR(r io.Reader) error {
return fmt.Errorf("wrong type for uint64 field")
}
t.RequestLength = uint64(extra)
// t.t.Options (uint64) (uint64)
// t.Options (uint64) (uint64)
maj, extra, err = cbg.CborReadHeader(br)
if err != nil {
@ -118,7 +118,7 @@ func (t *BlockSyncResponse) MarshalCBOR(w io.Writer) error {
return err
}
// t.t.Chain ([]*blocksync.BSTipSet) (slice)
// t.Chain ([]*blocksync.BSTipSet) (slice)
if _, err := w.Write(cbg.CborEncodeMajorType(cbg.MajArray, uint64(len(t.Chain)))); err != nil {
return err
}
@ -128,12 +128,12 @@ func (t *BlockSyncResponse) MarshalCBOR(w io.Writer) error {
}
}
// t.t.Status (uint64) (uint64)
// t.Status (uint64) (uint64)
if _, err := w.Write(cbg.CborEncodeMajorType(cbg.MajUnsignedInt, uint64(t.Status))); err != nil {
return err
}
// t.t.Message (string) (string)
// t.Message (string) (string)
if _, err := w.Write(cbg.CborEncodeMajorType(cbg.MajTextString, uint64(len(t.Message)))); err != nil {
return err
}
@ -158,7 +158,7 @@ func (t *BlockSyncResponse) UnmarshalCBOR(r io.Reader) error {
return fmt.Errorf("cbor input had wrong number of fields")
}
// t.t.Chain ([]*blocksync.BSTipSet) (slice)
// t.Chain ([]*blocksync.BSTipSet) (slice)
maj, extra, err = cbg.CborReadHeader(br)
if err != nil {
@ -185,7 +185,7 @@ func (t *BlockSyncResponse) UnmarshalCBOR(r io.Reader) error {
t.Chain[i] = &v
}
// t.t.Status (uint64) (uint64)
// t.Status (uint64) (uint64)
maj, extra, err = cbg.CborReadHeader(br)
if err != nil {
@ -195,7 +195,7 @@ func (t *BlockSyncResponse) UnmarshalCBOR(r io.Reader) error {
return fmt.Errorf("wrong type for uint64 field")
}
t.Status = uint64(extra)
// t.t.Message (string) (string)
// t.Message (string) (string)
{
sval, err := cbg.ReadString(br)
@ -217,7 +217,7 @@ func (t *BSTipSet) MarshalCBOR(w io.Writer) error {
return err
}
// t.t.Blocks ([]*types.BlockHeader) (slice)
// t.Blocks ([]*types.BlockHeader) (slice)
if _, err := w.Write(cbg.CborEncodeMajorType(cbg.MajArray, uint64(len(t.Blocks)))); err != nil {
return err
}
@ -227,7 +227,7 @@ func (t *BSTipSet) MarshalCBOR(w io.Writer) error {
}
}
// t.t.BlsMessages ([]*types.Message) (slice)
// t.BlsMessages ([]*types.Message) (slice)
if _, err := w.Write(cbg.CborEncodeMajorType(cbg.MajArray, uint64(len(t.BlsMessages)))); err != nil {
return err
}
@ -237,7 +237,7 @@ func (t *BSTipSet) MarshalCBOR(w io.Writer) error {
}
}
// t.t.BlsMsgIncludes ([][]uint64) (slice)
// t.BlsMsgIncludes ([][]uint64) (slice)
if _, err := w.Write(cbg.CborEncodeMajorType(cbg.MajArray, uint64(len(t.BlsMsgIncludes)))); err != nil {
return err
}
@ -252,7 +252,7 @@ func (t *BSTipSet) MarshalCBOR(w io.Writer) error {
}
}
// t.t.SecpkMessages ([]*types.SignedMessage) (slice)
// t.SecpkMessages ([]*types.SignedMessage) (slice)
if _, err := w.Write(cbg.CborEncodeMajorType(cbg.MajArray, uint64(len(t.SecpkMessages)))); err != nil {
return err
}
@ -262,7 +262,7 @@ func (t *BSTipSet) MarshalCBOR(w io.Writer) error {
}
}
// t.t.SecpkMsgIncludes ([][]uint64) (slice)
// t.SecpkMsgIncludes ([][]uint64) (slice)
if _, err := w.Write(cbg.CborEncodeMajorType(cbg.MajArray, uint64(len(t.SecpkMsgIncludes)))); err != nil {
return err
}
@ -294,7 +294,7 @@ func (t *BSTipSet) UnmarshalCBOR(r io.Reader) error {
return fmt.Errorf("cbor input had wrong number of fields")
}
// t.t.Blocks ([]*types.BlockHeader) (slice)
// t.Blocks ([]*types.BlockHeader) (slice)
maj, extra, err = cbg.CborReadHeader(br)
if err != nil {
@ -321,7 +321,7 @@ func (t *BSTipSet) UnmarshalCBOR(r io.Reader) error {
t.Blocks[i] = &v
}
// t.t.BlsMessages ([]*types.Message) (slice)
// t.BlsMessages ([]*types.Message) (slice)
maj, extra, err = cbg.CborReadHeader(br)
if err != nil {
@ -348,7 +348,7 @@ func (t *BSTipSet) UnmarshalCBOR(r io.Reader) error {
t.BlsMessages[i] = &v
}
// t.t.BlsMsgIncludes ([][]uint64) (slice)
// t.BlsMsgIncludes ([][]uint64) (slice)
maj, extra, err = cbg.CborReadHeader(br)
if err != nil {
@ -403,7 +403,7 @@ func (t *BSTipSet) UnmarshalCBOR(r io.Reader) error {
}
}
// t.t.SecpkMessages ([]*types.SignedMessage) (slice)
// t.SecpkMessages ([]*types.SignedMessage) (slice)
maj, extra, err = cbg.CborReadHeader(br)
if err != nil {
@ -430,7 +430,7 @@ func (t *BSTipSet) UnmarshalCBOR(r io.Reader) error {
t.SecpkMessages[i] = &v
}
// t.t.SecpkMsgIncludes ([][]uint64) (slice)
// t.SecpkMsgIncludes ([][]uint64) (slice)
maj, extra, err = cbg.CborReadHeader(br)
if err != nil {

View File

@ -24,7 +24,7 @@ func (t *AskRequest) MarshalCBOR(w io.Writer) error {
return err
}
// t.t.Miner (address.Address) (struct)
// t.Miner (address.Address) (struct)
if err := t.Miner.MarshalCBOR(w); err != nil {
return err
}
@ -46,7 +46,7 @@ func (t *AskRequest) UnmarshalCBOR(r io.Reader) error {
return fmt.Errorf("cbor input had wrong number of fields")
}
// t.t.Miner (address.Address) (struct)
// t.Miner (address.Address) (struct)
{
@ -67,7 +67,7 @@ func (t *AskResponse) MarshalCBOR(w io.Writer) error {
return err
}
// t.t.Ask (types.SignedStorageAsk) (struct)
// t.Ask (types.SignedStorageAsk) (struct)
if err := t.Ask.MarshalCBOR(w); err != nil {
return err
}
@ -89,7 +89,7 @@ func (t *AskResponse) UnmarshalCBOR(r io.Reader) error {
return fmt.Errorf("cbor input had wrong number of fields")
}
// t.t.Ask (types.SignedStorageAsk) (struct)
// t.Ask (types.SignedStorageAsk) (struct)
{
@ -122,12 +122,12 @@ func (t *Proposal) MarshalCBOR(w io.Writer) error {
return err
}
// t.t.DealProposal (actors.StorageDealProposal) (struct)
// t.DealProposal (actors.StorageDealProposal) (struct)
if err := t.DealProposal.MarshalCBOR(w); err != nil {
return err
}
// t.t.Piece (cid.Cid) (struct)
// t.Piece (cid.Cid) (struct)
if err := cbg.WriteCid(w, t.Piece); err != nil {
return xerrors.Errorf("failed to write cid field t.Piece: %w", err)
@ -151,7 +151,7 @@ func (t *Proposal) UnmarshalCBOR(r io.Reader) error {
return fmt.Errorf("cbor input had wrong number of fields")
}
// t.t.DealProposal (actors.StorageDealProposal) (struct)
// t.DealProposal (actors.StorageDealProposal) (struct)
{
@ -172,7 +172,7 @@ func (t *Proposal) UnmarshalCBOR(r io.Reader) error {
}
}
// t.t.Piece (cid.Cid) (struct)
// t.Piece (cid.Cid) (struct)
{
@ -196,12 +196,12 @@ func (t *Response) MarshalCBOR(w io.Writer) error {
return err
}
// t.t.State (uint64) (uint64)
// t.State (uint64) (uint64)
if _, err := w.Write(cbg.CborEncodeMajorType(cbg.MajUnsignedInt, uint64(t.State))); err != nil {
return err
}
// t.t.Message (string) (string)
// t.Message (string) (string)
if _, err := w.Write(cbg.CborEncodeMajorType(cbg.MajTextString, uint64(len(t.Message)))); err != nil {
return err
}
@ -209,13 +209,13 @@ func (t *Response) MarshalCBOR(w io.Writer) error {
return err
}
// t.t.Proposal (cid.Cid) (struct)
// t.Proposal (cid.Cid) (struct)
if err := cbg.WriteCid(w, t.Proposal); err != nil {
return xerrors.Errorf("failed to write cid field t.Proposal: %w", err)
}
// t.t.StorageDealSubmission (types.SignedMessage) (struct)
// t.StorageDealSubmission (types.SignedMessage) (struct)
if err := t.StorageDealSubmission.MarshalCBOR(w); err != nil {
return err
}
@ -237,7 +237,7 @@ func (t *Response) UnmarshalCBOR(r io.Reader) error {
return fmt.Errorf("cbor input had wrong number of fields")
}
// t.t.State (uint64) (uint64)
// t.State (uint64) (uint64)
maj, extra, err = cbg.CborReadHeader(br)
if err != nil {
@ -247,7 +247,7 @@ func (t *Response) UnmarshalCBOR(r io.Reader) error {
return fmt.Errorf("wrong type for uint64 field")
}
t.State = uint64(extra)
// t.t.Message (string) (string)
// t.Message (string) (string)
{
sval, err := cbg.ReadString(br)
@ -257,7 +257,7 @@ func (t *Response) UnmarshalCBOR(r io.Reader) error {
t.Message = string(sval)
}
// t.t.Proposal (cid.Cid) (struct)
// t.Proposal (cid.Cid) (struct)
{
@ -269,7 +269,7 @@ func (t *Response) UnmarshalCBOR(r io.Reader) error {
t.Proposal = c
}
// t.t.StorageDealSubmission (types.SignedMessage) (struct)
// t.StorageDealSubmission (types.SignedMessage) (struct)
{
@ -302,12 +302,12 @@ func (t *SignedResponse) MarshalCBOR(w io.Writer) error {
return err
}
// t.t.Response (deals.Response) (struct)
// t.Response (deals.Response) (struct)
if err := t.Response.MarshalCBOR(w); err != nil {
return err
}
// t.t.Signature (types.Signature) (struct)
// t.Signature (types.Signature) (struct)
if err := t.Signature.MarshalCBOR(w); err != nil {
return err
}
@ -329,7 +329,7 @@ func (t *SignedResponse) UnmarshalCBOR(r io.Reader) error {
return fmt.Errorf("cbor input had wrong number of fields")
}
// t.t.Response (deals.Response) (struct)
// t.Response (deals.Response) (struct)
{
@ -338,7 +338,7 @@ func (t *SignedResponse) UnmarshalCBOR(r io.Reader) error {
}
}
// t.t.Signature (types.Signature) (struct)
// t.Signature (types.Signature) (struct)
{
@ -371,43 +371,43 @@ func (t *ClientDealProposal) MarshalCBOR(w io.Writer) error {
return err
}
// t.t.Data (cid.Cid) (struct)
// t.Data (cid.Cid) (struct)
if err := cbg.WriteCid(w, t.Data); err != nil {
return xerrors.Errorf("failed to write cid field t.Data: %w", err)
}
// t.t.PricePerEpoch (types.BigInt) (struct)
// t.PricePerEpoch (types.BigInt) (struct)
if err := t.PricePerEpoch.MarshalCBOR(w); err != nil {
return err
}
// t.t.ProposalExpiration (uint64) (uint64)
// t.ProposalExpiration (uint64) (uint64)
if _, err := w.Write(cbg.CborEncodeMajorType(cbg.MajUnsignedInt, uint64(t.ProposalExpiration))); err != nil {
return err
}
// t.t.Duration (uint64) (uint64)
// t.Duration (uint64) (uint64)
if _, err := w.Write(cbg.CborEncodeMajorType(cbg.MajUnsignedInt, uint64(t.Duration))); err != nil {
return err
}
// t.t.ProviderAddress (address.Address) (struct)
// t.ProviderAddress (address.Address) (struct)
if err := t.ProviderAddress.MarshalCBOR(w); err != nil {
return err
}
// t.t.Client (address.Address) (struct)
// t.Client (address.Address) (struct)
if err := t.Client.MarshalCBOR(w); err != nil {
return err
}
// t.t.MinerWorker (address.Address) (struct)
// t.MinerWorker (address.Address) (struct)
if err := t.MinerWorker.MarshalCBOR(w); err != nil {
return err
}
// t.t.MinerID (peer.ID) (string)
// t.MinerID (peer.ID) (string)
if _, err := w.Write(cbg.CborEncodeMajorType(cbg.MajTextString, uint64(len(t.MinerID)))); err != nil {
return err
}
@ -432,7 +432,7 @@ func (t *ClientDealProposal) UnmarshalCBOR(r io.Reader) error {
return fmt.Errorf("cbor input had wrong number of fields")
}
// t.t.Data (cid.Cid) (struct)
// t.Data (cid.Cid) (struct)
{
@ -444,7 +444,7 @@ func (t *ClientDealProposal) UnmarshalCBOR(r io.Reader) error {
t.Data = c
}
// t.t.PricePerEpoch (types.BigInt) (struct)
// t.PricePerEpoch (types.BigInt) (struct)
{
@ -453,7 +453,7 @@ func (t *ClientDealProposal) UnmarshalCBOR(r io.Reader) error {
}
}
// t.t.ProposalExpiration (uint64) (uint64)
// t.ProposalExpiration (uint64) (uint64)
maj, extra, err = cbg.CborReadHeader(br)
if err != nil {
@ -463,7 +463,7 @@ func (t *ClientDealProposal) UnmarshalCBOR(r io.Reader) error {
return fmt.Errorf("wrong type for uint64 field")
}
t.ProposalExpiration = uint64(extra)
// t.t.Duration (uint64) (uint64)
// t.Duration (uint64) (uint64)
maj, extra, err = cbg.CborReadHeader(br)
if err != nil {
@ -473,7 +473,7 @@ func (t *ClientDealProposal) UnmarshalCBOR(r io.Reader) error {
return fmt.Errorf("wrong type for uint64 field")
}
t.Duration = uint64(extra)
// t.t.ProviderAddress (address.Address) (struct)
// t.ProviderAddress (address.Address) (struct)
{
@ -482,7 +482,7 @@ func (t *ClientDealProposal) UnmarshalCBOR(r io.Reader) error {
}
}
// t.t.Client (address.Address) (struct)
// t.Client (address.Address) (struct)
{
@ -491,7 +491,7 @@ func (t *ClientDealProposal) UnmarshalCBOR(r io.Reader) error {
}
}
// t.t.MinerWorker (address.Address) (struct)
// t.MinerWorker (address.Address) (struct)
{
@ -500,7 +500,7 @@ func (t *ClientDealProposal) UnmarshalCBOR(r io.Reader) error {
}
}
// t.t.MinerID (peer.ID) (string)
// t.MinerID (peer.ID) (string)
{
sval, err := cbg.ReadString(br)
@ -522,23 +522,23 @@ func (t *ClientDeal) MarshalCBOR(w io.Writer) error {
return err
}
// t.t.ProposalCid (cid.Cid) (struct)
// t.ProposalCid (cid.Cid) (struct)
if err := cbg.WriteCid(w, t.ProposalCid); err != nil {
return xerrors.Errorf("failed to write cid field t.ProposalCid: %w", err)
}
// t.t.Proposal (actors.StorageDealProposal) (struct)
// t.Proposal (actors.StorageDealProposal) (struct)
if err := t.Proposal.MarshalCBOR(w); err != nil {
return err
}
// t.t.State (uint64) (uint64)
// t.State (uint64) (uint64)
if _, err := w.Write(cbg.CborEncodeMajorType(cbg.MajUnsignedInt, uint64(t.State))); err != nil {
return err
}
// t.t.Miner (peer.ID) (string)
// t.Miner (peer.ID) (string)
if _, err := w.Write(cbg.CborEncodeMajorType(cbg.MajTextString, uint64(len(t.Miner)))); err != nil {
return err
}
@ -546,17 +546,17 @@ func (t *ClientDeal) MarshalCBOR(w io.Writer) error {
return err
}
// t.t.MinerWorker (address.Address) (struct)
// t.MinerWorker (address.Address) (struct)
if err := t.MinerWorker.MarshalCBOR(w); err != nil {
return err
}
// t.t.DealID (uint64) (uint64)
// t.DealID (uint64) (uint64)
if _, err := w.Write(cbg.CborEncodeMajorType(cbg.MajUnsignedInt, uint64(t.DealID))); err != nil {
return err
}
// t.t.PublishMessage (types.SignedMessage) (struct)
// t.PublishMessage (types.SignedMessage) (struct)
if err := t.PublishMessage.MarshalCBOR(w); err != nil {
return err
}
@ -578,7 +578,7 @@ func (t *ClientDeal) UnmarshalCBOR(r io.Reader) error {
return fmt.Errorf("cbor input had wrong number of fields")
}
// t.t.ProposalCid (cid.Cid) (struct)
// t.ProposalCid (cid.Cid) (struct)
{
@ -590,7 +590,7 @@ func (t *ClientDeal) UnmarshalCBOR(r io.Reader) error {
t.ProposalCid = c
}
// t.t.Proposal (actors.StorageDealProposal) (struct)
// t.Proposal (actors.StorageDealProposal) (struct)
{
@ -599,7 +599,7 @@ func (t *ClientDeal) UnmarshalCBOR(r io.Reader) error {
}
}
// t.t.State (uint64) (uint64)
// t.State (uint64) (uint64)
maj, extra, err = cbg.CborReadHeader(br)
if err != nil {
@ -609,7 +609,7 @@ func (t *ClientDeal) UnmarshalCBOR(r io.Reader) error {
return fmt.Errorf("wrong type for uint64 field")
}
t.State = uint64(extra)
// t.t.Miner (peer.ID) (string)
// t.Miner (peer.ID) (string)
{
sval, err := cbg.ReadString(br)
@ -619,7 +619,7 @@ func (t *ClientDeal) UnmarshalCBOR(r io.Reader) error {
t.Miner = peer.ID(sval)
}
// t.t.MinerWorker (address.Address) (struct)
// t.MinerWorker (address.Address) (struct)
{
@ -628,7 +628,7 @@ func (t *ClientDeal) UnmarshalCBOR(r io.Reader) error {
}
}
// t.t.DealID (uint64) (uint64)
// t.DealID (uint64) (uint64)
maj, extra, err = cbg.CborReadHeader(br)
if err != nil {
@ -638,7 +638,7 @@ func (t *ClientDeal) UnmarshalCBOR(r io.Reader) error {
return fmt.Errorf("wrong type for uint64 field")
}
t.DealID = uint64(extra)
// t.t.PublishMessage (types.SignedMessage) (struct)
// t.PublishMessage (types.SignedMessage) (struct)
{
@ -671,7 +671,7 @@ func (t *MinerDeal) MarshalCBOR(w io.Writer) error {
return err
}
// t.t.Client (peer.ID) (string)
// t.Client (peer.ID) (string)
if _, err := w.Write(cbg.CborEncodeMajorType(cbg.MajTextString, uint64(len(t.Client)))); err != nil {
return err
}
@ -679,34 +679,34 @@ func (t *MinerDeal) MarshalCBOR(w io.Writer) error {
return err
}
// t.t.Proposal (actors.StorageDealProposal) (struct)
// t.Proposal (actors.StorageDealProposal) (struct)
if err := t.Proposal.MarshalCBOR(w); err != nil {
return err
}
// t.t.ProposalCid (cid.Cid) (struct)
// t.ProposalCid (cid.Cid) (struct)
if err := cbg.WriteCid(w, t.ProposalCid); err != nil {
return xerrors.Errorf("failed to write cid field t.ProposalCid: %w", err)
}
// t.t.State (uint64) (uint64)
// t.State (uint64) (uint64)
if _, err := w.Write(cbg.CborEncodeMajorType(cbg.MajUnsignedInt, uint64(t.State))); err != nil {
return err
}
// t.t.Ref (cid.Cid) (struct)
// t.Ref (cid.Cid) (struct)
if err := cbg.WriteCid(w, t.Ref); err != nil {
return xerrors.Errorf("failed to write cid field t.Ref: %w", err)
}
// t.t.DealID (uint64) (uint64)
// t.DealID (uint64) (uint64)
if _, err := w.Write(cbg.CborEncodeMajorType(cbg.MajUnsignedInt, uint64(t.DealID))); err != nil {
return err
}
// t.t.SectorID (uint64) (uint64)
// t.SectorID (uint64) (uint64)
if _, err := w.Write(cbg.CborEncodeMajorType(cbg.MajUnsignedInt, uint64(t.SectorID))); err != nil {
return err
}
@ -728,7 +728,7 @@ func (t *MinerDeal) UnmarshalCBOR(r io.Reader) error {
return fmt.Errorf("cbor input had wrong number of fields")
}
// t.t.Client (peer.ID) (string)
// t.Client (peer.ID) (string)
{
sval, err := cbg.ReadString(br)
@ -738,7 +738,7 @@ func (t *MinerDeal) UnmarshalCBOR(r io.Reader) error {
t.Client = peer.ID(sval)
}
// t.t.Proposal (actors.StorageDealProposal) (struct)
// t.Proposal (actors.StorageDealProposal) (struct)
{
@ -747,7 +747,7 @@ func (t *MinerDeal) UnmarshalCBOR(r io.Reader) error {
}
}
// t.t.ProposalCid (cid.Cid) (struct)
// t.ProposalCid (cid.Cid) (struct)
{
@ -759,7 +759,7 @@ func (t *MinerDeal) UnmarshalCBOR(r io.Reader) error {
t.ProposalCid = c
}
// t.t.State (uint64) (uint64)
// t.State (uint64) (uint64)
maj, extra, err = cbg.CborReadHeader(br)
if err != nil {
@ -769,7 +769,7 @@ func (t *MinerDeal) UnmarshalCBOR(r io.Reader) error {
return fmt.Errorf("wrong type for uint64 field")
}
t.State = uint64(extra)
// t.t.Ref (cid.Cid) (struct)
// t.Ref (cid.Cid) (struct)
{
@ -781,7 +781,7 @@ func (t *MinerDeal) UnmarshalCBOR(r io.Reader) error {
t.Ref = c
}
// t.t.DealID (uint64) (uint64)
// t.DealID (uint64) (uint64)
maj, extra, err = cbg.CborReadHeader(br)
if err != nil {
@ -791,7 +791,7 @@ func (t *MinerDeal) UnmarshalCBOR(r io.Reader) error {
return fmt.Errorf("wrong type for uint64 field")
}
t.DealID = uint64(extra)
// t.t.SectorID (uint64) (uint64)
// t.SectorID (uint64) (uint64)
maj, extra, err = cbg.CborReadHeader(br)
if err != nil {
@ -813,13 +813,13 @@ func (t *StorageDataTransferVoucher) MarshalCBOR(w io.Writer) error {
return err
}
// t.t.Proposal (cid.Cid) (struct)
// t.Proposal (cid.Cid) (struct)
if err := cbg.WriteCid(w, t.Proposal); err != nil {
return xerrors.Errorf("failed to write cid field t.Proposal: %w", err)
}
// t.t.DealID (uint64) (uint64)
// t.DealID (uint64) (uint64)
if _, err := w.Write(cbg.CborEncodeMajorType(cbg.MajUnsignedInt, uint64(t.DealID))); err != nil {
return err
}
@ -841,7 +841,7 @@ func (t *StorageDataTransferVoucher) UnmarshalCBOR(r io.Reader) error {
return fmt.Errorf("cbor input had wrong number of fields")
}
// t.t.Proposal (cid.Cid) (struct)
// t.Proposal (cid.Cid) (struct)
{
@ -853,7 +853,7 @@ func (t *StorageDataTransferVoucher) UnmarshalCBOR(r io.Reader) error {
t.Proposal = c
}
// t.t.DealID (uint64) (uint64)
// t.DealID (uint64) (uint64)
maj, extra, err = cbg.CborReadHeader(br)
if err != nil {

View File

@ -23,22 +23,22 @@ func (t *BlockHeader) MarshalCBOR(w io.Writer) error {
return err
}
// t.t.Miner (address.Address) (struct)
// t.Miner (address.Address) (struct)
if err := t.Miner.MarshalCBOR(w); err != nil {
return err
}
// t.t.Ticket (types.Ticket) (struct)
// t.Ticket (types.Ticket) (struct)
if err := t.Ticket.MarshalCBOR(w); err != nil {
return err
}
// t.t.EPostProof (types.EPostProof) (struct)
// t.EPostProof (types.EPostProof) (struct)
if err := t.EPostProof.MarshalCBOR(w); err != nil {
return err
}
// t.t.Parents ([]cid.Cid) (slice)
// t.Parents ([]cid.Cid) (slice)
if _, err := w.Write(cbg.CborEncodeMajorType(cbg.MajArray, uint64(len(t.Parents)))); err != nil {
return err
}
@ -48,45 +48,45 @@ func (t *BlockHeader) MarshalCBOR(w io.Writer) error {
}
}
// t.t.ParentWeight (types.BigInt) (struct)
// t.ParentWeight (types.BigInt) (struct)
if err := t.ParentWeight.MarshalCBOR(w); err != nil {
return err
}
// t.t.Height (uint64) (uint64)
// t.Height (uint64) (uint64)
if _, err := w.Write(cbg.CborEncodeMajorType(cbg.MajUnsignedInt, uint64(t.Height))); err != nil {
return err
}
// t.t.ParentStateRoot (cid.Cid) (struct)
// t.ParentStateRoot (cid.Cid) (struct)
if err := cbg.WriteCid(w, t.ParentStateRoot); err != nil {
return xerrors.Errorf("failed to write cid field t.ParentStateRoot: %w", err)
}
// t.t.ParentMessageReceipts (cid.Cid) (struct)
// t.ParentMessageReceipts (cid.Cid) (struct)
if err := cbg.WriteCid(w, t.ParentMessageReceipts); err != nil {
return xerrors.Errorf("failed to write cid field t.ParentMessageReceipts: %w", err)
}
// t.t.Messages (cid.Cid) (struct)
// t.Messages (cid.Cid) (struct)
if err := cbg.WriteCid(w, t.Messages); err != nil {
return xerrors.Errorf("failed to write cid field t.Messages: %w", err)
}
// t.t.BLSAggregate (types.Signature) (struct)
// t.BLSAggregate (types.Signature) (struct)
if err := t.BLSAggregate.MarshalCBOR(w); err != nil {
return err
}
// t.t.Timestamp (uint64) (uint64)
// t.Timestamp (uint64) (uint64)
if _, err := w.Write(cbg.CborEncodeMajorType(cbg.MajUnsignedInt, uint64(t.Timestamp))); err != nil {
return err
}
// t.t.BlockSig (types.Signature) (struct)
// t.BlockSig (types.Signature) (struct)
if err := t.BlockSig.MarshalCBOR(w); err != nil {
return err
}
@ -108,7 +108,7 @@ func (t *BlockHeader) UnmarshalCBOR(r io.Reader) error {
return fmt.Errorf("cbor input had wrong number of fields")
}
// t.t.Miner (address.Address) (struct)
// t.Miner (address.Address) (struct)
{
@ -117,7 +117,7 @@ func (t *BlockHeader) UnmarshalCBOR(r io.Reader) error {
}
}
// t.t.Ticket (types.Ticket) (struct)
// t.Ticket (types.Ticket) (struct)
{
@ -138,7 +138,7 @@ func (t *BlockHeader) UnmarshalCBOR(r io.Reader) error {
}
}
// t.t.EPostProof (types.EPostProof) (struct)
// t.EPostProof (types.EPostProof) (struct)
{
@ -147,7 +147,7 @@ func (t *BlockHeader) UnmarshalCBOR(r io.Reader) error {
}
}
// t.t.Parents ([]cid.Cid) (slice)
// t.Parents ([]cid.Cid) (slice)
maj, extra, err = cbg.CborReadHeader(br)
if err != nil {
@ -173,7 +173,7 @@ func (t *BlockHeader) UnmarshalCBOR(r io.Reader) error {
t.Parents[i] = c
}
// t.t.ParentWeight (types.BigInt) (struct)
// t.ParentWeight (types.BigInt) (struct)
{
@ -182,7 +182,7 @@ func (t *BlockHeader) UnmarshalCBOR(r io.Reader) error {
}
}
// t.t.Height (uint64) (uint64)
// t.Height (uint64) (uint64)
maj, extra, err = cbg.CborReadHeader(br)
if err != nil {
@ -192,7 +192,7 @@ func (t *BlockHeader) UnmarshalCBOR(r io.Reader) error {
return fmt.Errorf("wrong type for uint64 field")
}
t.Height = uint64(extra)
// t.t.ParentStateRoot (cid.Cid) (struct)
// t.ParentStateRoot (cid.Cid) (struct)
{
@ -204,7 +204,7 @@ func (t *BlockHeader) UnmarshalCBOR(r io.Reader) error {
t.ParentStateRoot = c
}
// t.t.ParentMessageReceipts (cid.Cid) (struct)
// t.ParentMessageReceipts (cid.Cid) (struct)
{
@ -216,7 +216,7 @@ func (t *BlockHeader) UnmarshalCBOR(r io.Reader) error {
t.ParentMessageReceipts = c
}
// t.t.Messages (cid.Cid) (struct)
// t.Messages (cid.Cid) (struct)
{
@ -228,7 +228,7 @@ func (t *BlockHeader) UnmarshalCBOR(r io.Reader) error {
t.Messages = c
}
// t.t.BLSAggregate (types.Signature) (struct)
// t.BLSAggregate (types.Signature) (struct)
{
@ -237,7 +237,7 @@ func (t *BlockHeader) UnmarshalCBOR(r io.Reader) error {
}
}
// t.t.Timestamp (uint64) (uint64)
// t.Timestamp (uint64) (uint64)
maj, extra, err = cbg.CborReadHeader(br)
if err != nil {
@ -247,7 +247,7 @@ func (t *BlockHeader) UnmarshalCBOR(r io.Reader) error {
return fmt.Errorf("wrong type for uint64 field")
}
t.Timestamp = uint64(extra)
// t.t.BlockSig (types.Signature) (struct)
// t.BlockSig (types.Signature) (struct)
{
@ -280,7 +280,7 @@ func (t *Ticket) MarshalCBOR(w io.Writer) error {
return err
}
// t.t.VRFProof ([]uint8) (slice)
// t.VRFProof ([]uint8) (slice)
if _, err := w.Write(cbg.CborEncodeMajorType(cbg.MajByteString, uint64(len(t.VRFProof)))); err != nil {
return err
}
@ -305,7 +305,7 @@ func (t *Ticket) UnmarshalCBOR(r io.Reader) error {
return fmt.Errorf("cbor input had wrong number of fields")
}
// t.t.VRFProof ([]uint8) (slice)
// t.VRFProof ([]uint8) (slice)
maj, extra, err = cbg.CborReadHeader(br)
if err != nil {
@ -334,7 +334,7 @@ func (t *EPostProof) MarshalCBOR(w io.Writer) error {
return err
}
// t.t.Proof ([]uint8) (slice)
// t.Proof ([]uint8) (slice)
if _, err := w.Write(cbg.CborEncodeMajorType(cbg.MajByteString, uint64(len(t.Proof)))); err != nil {
return err
}
@ -342,7 +342,7 @@ func (t *EPostProof) MarshalCBOR(w io.Writer) error {
return err
}
// t.t.PostRand ([]uint8) (slice)
// t.PostRand ([]uint8) (slice)
if _, err := w.Write(cbg.CborEncodeMajorType(cbg.MajByteString, uint64(len(t.PostRand)))); err != nil {
return err
}
@ -350,7 +350,7 @@ func (t *EPostProof) MarshalCBOR(w io.Writer) error {
return err
}
// t.t.Candidates ([]types.EPostTicket) (slice)
// t.Candidates ([]types.EPostTicket) (slice)
if _, err := w.Write(cbg.CborEncodeMajorType(cbg.MajArray, uint64(len(t.Candidates)))); err != nil {
return err
}
@ -377,7 +377,7 @@ func (t *EPostProof) UnmarshalCBOR(r io.Reader) error {
return fmt.Errorf("cbor input had wrong number of fields")
}
// t.t.Proof ([]uint8) (slice)
// t.Proof ([]uint8) (slice)
maj, extra, err = cbg.CborReadHeader(br)
if err != nil {
@ -394,7 +394,7 @@ func (t *EPostProof) UnmarshalCBOR(r io.Reader) error {
if _, err := io.ReadFull(br, t.Proof); err != nil {
return err
}
// t.t.PostRand ([]uint8) (slice)
// t.PostRand ([]uint8) (slice)
maj, extra, err = cbg.CborReadHeader(br)
if err != nil {
@ -411,7 +411,7 @@ func (t *EPostProof) UnmarshalCBOR(r io.Reader) error {
if _, err := io.ReadFull(br, t.PostRand); err != nil {
return err
}
// t.t.Candidates ([]types.EPostTicket) (slice)
// t.Candidates ([]types.EPostTicket) (slice)
maj, extra, err = cbg.CborReadHeader(br)
if err != nil {
@ -450,7 +450,7 @@ func (t *EPostTicket) MarshalCBOR(w io.Writer) error {
return err
}
// t.t.Partial ([]uint8) (slice)
// t.Partial ([]uint8) (slice)
if _, err := w.Write(cbg.CborEncodeMajorType(cbg.MajByteString, uint64(len(t.Partial)))); err != nil {
return err
}
@ -458,12 +458,12 @@ func (t *EPostTicket) MarshalCBOR(w io.Writer) error {
return err
}
// t.t.SectorID (uint64) (uint64)
// t.SectorID (uint64) (uint64)
if _, err := w.Write(cbg.CborEncodeMajorType(cbg.MajUnsignedInt, uint64(t.SectorID))); err != nil {
return err
}
// t.t.ChallengeIndex (uint64) (uint64)
// t.ChallengeIndex (uint64) (uint64)
if _, err := w.Write(cbg.CborEncodeMajorType(cbg.MajUnsignedInt, uint64(t.ChallengeIndex))); err != nil {
return err
}
@ -485,7 +485,7 @@ func (t *EPostTicket) UnmarshalCBOR(r io.Reader) error {
return fmt.Errorf("cbor input had wrong number of fields")
}
// t.t.Partial ([]uint8) (slice)
// t.Partial ([]uint8) (slice)
maj, extra, err = cbg.CborReadHeader(br)
if err != nil {
@ -502,7 +502,7 @@ func (t *EPostTicket) UnmarshalCBOR(r io.Reader) error {
if _, err := io.ReadFull(br, t.Partial); err != nil {
return err
}
// t.t.SectorID (uint64) (uint64)
// t.SectorID (uint64) (uint64)
maj, extra, err = cbg.CborReadHeader(br)
if err != nil {
@ -512,7 +512,7 @@ func (t *EPostTicket) UnmarshalCBOR(r io.Reader) error {
return fmt.Errorf("wrong type for uint64 field")
}
t.SectorID = uint64(extra)
// t.t.ChallengeIndex (uint64) (uint64)
// t.ChallengeIndex (uint64) (uint64)
maj, extra, err = cbg.CborReadHeader(br)
if err != nil {
@ -534,42 +534,42 @@ func (t *Message) MarshalCBOR(w io.Writer) error {
return err
}
// t.t.To (address.Address) (struct)
// t.To (address.Address) (struct)
if err := t.To.MarshalCBOR(w); err != nil {
return err
}
// t.t.From (address.Address) (struct)
// t.From (address.Address) (struct)
if err := t.From.MarshalCBOR(w); err != nil {
return err
}
// t.t.Nonce (uint64) (uint64)
// t.Nonce (uint64) (uint64)
if _, err := w.Write(cbg.CborEncodeMajorType(cbg.MajUnsignedInt, uint64(t.Nonce))); err != nil {
return err
}
// t.t.Value (types.BigInt) (struct)
// t.Value (types.BigInt) (struct)
if err := t.Value.MarshalCBOR(w); err != nil {
return err
}
// t.t.GasPrice (types.BigInt) (struct)
// t.GasPrice (types.BigInt) (struct)
if err := t.GasPrice.MarshalCBOR(w); err != nil {
return err
}
// t.t.GasLimit (types.BigInt) (struct)
// t.GasLimit (types.BigInt) (struct)
if err := t.GasLimit.MarshalCBOR(w); err != nil {
return err
}
// t.t.Method (uint64) (uint64)
// t.Method (uint64) (uint64)
if _, err := w.Write(cbg.CborEncodeMajorType(cbg.MajUnsignedInt, uint64(t.Method))); err != nil {
return err
}
// t.t.Params ([]uint8) (slice)
// t.Params ([]uint8) (slice)
if _, err := w.Write(cbg.CborEncodeMajorType(cbg.MajByteString, uint64(len(t.Params)))); err != nil {
return err
}
@ -594,7 +594,7 @@ func (t *Message) UnmarshalCBOR(r io.Reader) error {
return fmt.Errorf("cbor input had wrong number of fields")
}
// t.t.To (address.Address) (struct)
// t.To (address.Address) (struct)
{
@ -603,7 +603,7 @@ func (t *Message) UnmarshalCBOR(r io.Reader) error {
}
}
// t.t.From (address.Address) (struct)
// t.From (address.Address) (struct)
{
@ -612,7 +612,7 @@ func (t *Message) UnmarshalCBOR(r io.Reader) error {
}
}
// t.t.Nonce (uint64) (uint64)
// t.Nonce (uint64) (uint64)
maj, extra, err = cbg.CborReadHeader(br)
if err != nil {
@ -622,7 +622,7 @@ func (t *Message) UnmarshalCBOR(r io.Reader) error {
return fmt.Errorf("wrong type for uint64 field")
}
t.Nonce = uint64(extra)
// t.t.Value (types.BigInt) (struct)
// t.Value (types.BigInt) (struct)
{
@ -631,7 +631,7 @@ func (t *Message) UnmarshalCBOR(r io.Reader) error {
}
}
// t.t.GasPrice (types.BigInt) (struct)
// t.GasPrice (types.BigInt) (struct)
{
@ -640,7 +640,7 @@ func (t *Message) UnmarshalCBOR(r io.Reader) error {
}
}
// t.t.GasLimit (types.BigInt) (struct)
// t.GasLimit (types.BigInt) (struct)
{
@ -649,7 +649,7 @@ func (t *Message) UnmarshalCBOR(r io.Reader) error {
}
}
// t.t.Method (uint64) (uint64)
// t.Method (uint64) (uint64)
maj, extra, err = cbg.CborReadHeader(br)
if err != nil {
@ -659,7 +659,7 @@ func (t *Message) UnmarshalCBOR(r io.Reader) error {
return fmt.Errorf("wrong type for uint64 field")
}
t.Method = uint64(extra)
// t.t.Params ([]uint8) (slice)
// t.Params ([]uint8) (slice)
maj, extra, err = cbg.CborReadHeader(br)
if err != nil {
@ -688,12 +688,12 @@ func (t *SignedMessage) MarshalCBOR(w io.Writer) error {
return err
}
// t.t.Message (types.Message) (struct)
// t.Message (types.Message) (struct)
if err := t.Message.MarshalCBOR(w); err != nil {
return err
}
// t.t.Signature (types.Signature) (struct)
// t.Signature (types.Signature) (struct)
if err := t.Signature.MarshalCBOR(w); err != nil {
return err
}
@ -715,7 +715,7 @@ func (t *SignedMessage) UnmarshalCBOR(r io.Reader) error {
return fmt.Errorf("cbor input had wrong number of fields")
}
// t.t.Message (types.Message) (struct)
// t.Message (types.Message) (struct)
{
@ -724,7 +724,7 @@ func (t *SignedMessage) UnmarshalCBOR(r io.Reader) error {
}
}
// t.t.Signature (types.Signature) (struct)
// t.Signature (types.Signature) (struct)
{
@ -745,13 +745,13 @@ func (t *MsgMeta) MarshalCBOR(w io.Writer) error {
return err
}
// t.t.BlsMessages (cid.Cid) (struct)
// t.BlsMessages (cid.Cid) (struct)
if err := cbg.WriteCid(w, t.BlsMessages); err != nil {
return xerrors.Errorf("failed to write cid field t.BlsMessages: %w", err)
}
// t.t.SecpkMessages (cid.Cid) (struct)
// t.SecpkMessages (cid.Cid) (struct)
if err := cbg.WriteCid(w, t.SecpkMessages); err != nil {
return xerrors.Errorf("failed to write cid field t.SecpkMessages: %w", err)
@ -775,7 +775,7 @@ func (t *MsgMeta) UnmarshalCBOR(r io.Reader) error {
return fmt.Errorf("cbor input had wrong number of fields")
}
// t.t.BlsMessages (cid.Cid) (struct)
// t.BlsMessages (cid.Cid) (struct)
{
@ -787,7 +787,7 @@ func (t *MsgMeta) UnmarshalCBOR(r io.Reader) error {
t.BlsMessages = c
}
// t.t.SecpkMessages (cid.Cid) (struct)
// t.SecpkMessages (cid.Cid) (struct)
{
@ -811,12 +811,12 @@ func (t *SignedVoucher) MarshalCBOR(w io.Writer) error {
return err
}
// t.t.TimeLock (uint64) (uint64)
// t.TimeLock (uint64) (uint64)
if _, err := w.Write(cbg.CborEncodeMajorType(cbg.MajUnsignedInt, uint64(t.TimeLock))); err != nil {
return err
}
// t.t.SecretPreimage ([]uint8) (slice)
// t.SecretPreimage ([]uint8) (slice)
if _, err := w.Write(cbg.CborEncodeMajorType(cbg.MajByteString, uint64(len(t.SecretPreimage)))); err != nil {
return err
}
@ -824,32 +824,32 @@ func (t *SignedVoucher) MarshalCBOR(w io.Writer) error {
return err
}
// t.t.Extra (types.ModVerifyParams) (struct)
// t.Extra (types.ModVerifyParams) (struct)
if err := t.Extra.MarshalCBOR(w); err != nil {
return err
}
// t.t.Lane (uint64) (uint64)
// t.Lane (uint64) (uint64)
if _, err := w.Write(cbg.CborEncodeMajorType(cbg.MajUnsignedInt, uint64(t.Lane))); err != nil {
return err
}
// t.t.Nonce (uint64) (uint64)
// t.Nonce (uint64) (uint64)
if _, err := w.Write(cbg.CborEncodeMajorType(cbg.MajUnsignedInt, uint64(t.Nonce))); err != nil {
return err
}
// t.t.Amount (types.BigInt) (struct)
// t.Amount (types.BigInt) (struct)
if err := t.Amount.MarshalCBOR(w); err != nil {
return err
}
// t.t.MinCloseHeight (uint64) (uint64)
// t.MinCloseHeight (uint64) (uint64)
if _, err := w.Write(cbg.CborEncodeMajorType(cbg.MajUnsignedInt, uint64(t.MinCloseHeight))); err != nil {
return err
}
// t.t.Merges ([]types.Merge) (slice)
// t.Merges ([]types.Merge) (slice)
if _, err := w.Write(cbg.CborEncodeMajorType(cbg.MajArray, uint64(len(t.Merges)))); err != nil {
return err
}
@ -859,7 +859,7 @@ func (t *SignedVoucher) MarshalCBOR(w io.Writer) error {
}
}
// t.t.Signature (types.Signature) (struct)
// t.Signature (types.Signature) (struct)
if err := t.Signature.MarshalCBOR(w); err != nil {
return err
}
@ -881,7 +881,7 @@ func (t *SignedVoucher) UnmarshalCBOR(r io.Reader) error {
return fmt.Errorf("cbor input had wrong number of fields")
}
// t.t.TimeLock (uint64) (uint64)
// t.TimeLock (uint64) (uint64)
maj, extra, err = cbg.CborReadHeader(br)
if err != nil {
@ -891,7 +891,7 @@ func (t *SignedVoucher) UnmarshalCBOR(r io.Reader) error {
return fmt.Errorf("wrong type for uint64 field")
}
t.TimeLock = uint64(extra)
// t.t.SecretPreimage ([]uint8) (slice)
// t.SecretPreimage ([]uint8) (slice)
maj, extra, err = cbg.CborReadHeader(br)
if err != nil {
@ -908,7 +908,7 @@ func (t *SignedVoucher) UnmarshalCBOR(r io.Reader) error {
if _, err := io.ReadFull(br, t.SecretPreimage); err != nil {
return err
}
// t.t.Extra (types.ModVerifyParams) (struct)
// t.Extra (types.ModVerifyParams) (struct)
{
@ -929,7 +929,7 @@ func (t *SignedVoucher) UnmarshalCBOR(r io.Reader) error {
}
}
// t.t.Lane (uint64) (uint64)
// t.Lane (uint64) (uint64)
maj, extra, err = cbg.CborReadHeader(br)
if err != nil {
@ -939,7 +939,7 @@ func (t *SignedVoucher) UnmarshalCBOR(r io.Reader) error {
return fmt.Errorf("wrong type for uint64 field")
}
t.Lane = uint64(extra)
// t.t.Nonce (uint64) (uint64)
// t.Nonce (uint64) (uint64)
maj, extra, err = cbg.CborReadHeader(br)
if err != nil {
@ -949,7 +949,7 @@ func (t *SignedVoucher) UnmarshalCBOR(r io.Reader) error {
return fmt.Errorf("wrong type for uint64 field")
}
t.Nonce = uint64(extra)
// t.t.Amount (types.BigInt) (struct)
// t.Amount (types.BigInt) (struct)
{
@ -958,7 +958,7 @@ func (t *SignedVoucher) UnmarshalCBOR(r io.Reader) error {
}
}
// t.t.MinCloseHeight (uint64) (uint64)
// t.MinCloseHeight (uint64) (uint64)
maj, extra, err = cbg.CborReadHeader(br)
if err != nil {
@ -968,7 +968,7 @@ func (t *SignedVoucher) UnmarshalCBOR(r io.Reader) error {
return fmt.Errorf("wrong type for uint64 field")
}
t.MinCloseHeight = uint64(extra)
// t.t.Merges ([]types.Merge) (slice)
// t.Merges ([]types.Merge) (slice)
maj, extra, err = cbg.CborReadHeader(br)
if err != nil {
@ -995,7 +995,7 @@ func (t *SignedVoucher) UnmarshalCBOR(r io.Reader) error {
t.Merges[i] = v
}
// t.t.Signature (types.Signature) (struct)
// t.Signature (types.Signature) (struct)
{
@ -1028,17 +1028,17 @@ func (t *ModVerifyParams) MarshalCBOR(w io.Writer) error {
return err
}
// t.t.Actor (address.Address) (struct)
// t.Actor (address.Address) (struct)
if err := t.Actor.MarshalCBOR(w); err != nil {
return err
}
// t.t.Method (uint64) (uint64)
// t.Method (uint64) (uint64)
if _, err := w.Write(cbg.CborEncodeMajorType(cbg.MajUnsignedInt, uint64(t.Method))); err != nil {
return err
}
// t.t.Data ([]uint8) (slice)
// t.Data ([]uint8) (slice)
if _, err := w.Write(cbg.CborEncodeMajorType(cbg.MajByteString, uint64(len(t.Data)))); err != nil {
return err
}
@ -1063,7 +1063,7 @@ func (t *ModVerifyParams) UnmarshalCBOR(r io.Reader) error {
return fmt.Errorf("cbor input had wrong number of fields")
}
// t.t.Actor (address.Address) (struct)
// t.Actor (address.Address) (struct)
{
@ -1072,7 +1072,7 @@ func (t *ModVerifyParams) UnmarshalCBOR(r io.Reader) error {
}
}
// t.t.Method (uint64) (uint64)
// t.Method (uint64) (uint64)
maj, extra, err = cbg.CborReadHeader(br)
if err != nil {
@ -1082,7 +1082,7 @@ func (t *ModVerifyParams) UnmarshalCBOR(r io.Reader) error {
return fmt.Errorf("wrong type for uint64 field")
}
t.Method = uint64(extra)
// t.t.Data ([]uint8) (slice)
// t.Data ([]uint8) (slice)
maj, extra, err = cbg.CborReadHeader(br)
if err != nil {
@ -1111,12 +1111,12 @@ func (t *Merge) MarshalCBOR(w io.Writer) error {
return err
}
// t.t.Lane (uint64) (uint64)
// t.Lane (uint64) (uint64)
if _, err := w.Write(cbg.CborEncodeMajorType(cbg.MajUnsignedInt, uint64(t.Lane))); err != nil {
return err
}
// t.t.Nonce (uint64) (uint64)
// t.Nonce (uint64) (uint64)
if _, err := w.Write(cbg.CborEncodeMajorType(cbg.MajUnsignedInt, uint64(t.Nonce))); err != nil {
return err
}
@ -1138,7 +1138,7 @@ func (t *Merge) UnmarshalCBOR(r io.Reader) error {
return fmt.Errorf("cbor input had wrong number of fields")
}
// t.t.Lane (uint64) (uint64)
// t.Lane (uint64) (uint64)
maj, extra, err = cbg.CborReadHeader(br)
if err != nil {
@ -1148,7 +1148,7 @@ func (t *Merge) UnmarshalCBOR(r io.Reader) error {
return fmt.Errorf("wrong type for uint64 field")
}
t.Lane = uint64(extra)
// t.t.Nonce (uint64) (uint64)
// t.Nonce (uint64) (uint64)
maj, extra, err = cbg.CborReadHeader(br)
if err != nil {
@ -1170,24 +1170,24 @@ func (t *Actor) MarshalCBOR(w io.Writer) error {
return err
}
// t.t.Code (cid.Cid) (struct)
// t.Code (cid.Cid) (struct)
if err := cbg.WriteCid(w, t.Code); err != nil {
return xerrors.Errorf("failed to write cid field t.Code: %w", err)
}
// t.t.Head (cid.Cid) (struct)
// t.Head (cid.Cid) (struct)
if err := cbg.WriteCid(w, t.Head); err != nil {
return xerrors.Errorf("failed to write cid field t.Head: %w", err)
}
// t.t.Nonce (uint64) (uint64)
// t.Nonce (uint64) (uint64)
if _, err := w.Write(cbg.CborEncodeMajorType(cbg.MajUnsignedInt, uint64(t.Nonce))); err != nil {
return err
}
// t.t.Balance (types.BigInt) (struct)
// t.Balance (types.BigInt) (struct)
if err := t.Balance.MarshalCBOR(w); err != nil {
return err
}
@ -1209,7 +1209,7 @@ func (t *Actor) UnmarshalCBOR(r io.Reader) error {
return fmt.Errorf("cbor input had wrong number of fields")
}
// t.t.Code (cid.Cid) (struct)
// t.Code (cid.Cid) (struct)
{
@ -1221,7 +1221,7 @@ func (t *Actor) UnmarshalCBOR(r io.Reader) error {
t.Code = c
}
// t.t.Head (cid.Cid) (struct)
// t.Head (cid.Cid) (struct)
{
@ -1233,7 +1233,7 @@ func (t *Actor) UnmarshalCBOR(r io.Reader) error {
t.Head = c
}
// t.t.Nonce (uint64) (uint64)
// t.Nonce (uint64) (uint64)
maj, extra, err = cbg.CborReadHeader(br)
if err != nil {
@ -1243,7 +1243,7 @@ func (t *Actor) UnmarshalCBOR(r io.Reader) error {
return fmt.Errorf("wrong type for uint64 field")
}
t.Nonce = uint64(extra)
// t.t.Balance (types.BigInt) (struct)
// t.Balance (types.BigInt) (struct)
{
@ -1264,12 +1264,12 @@ func (t *MessageReceipt) MarshalCBOR(w io.Writer) error {
return err
}
// t.t.ExitCode (uint8) (uint8)
// t.ExitCode (uint8) (uint8)
if _, err := w.Write(cbg.CborEncodeMajorType(cbg.MajUnsignedInt, uint64(t.ExitCode))); err != nil {
return err
}
// t.t.Return ([]uint8) (slice)
// t.Return ([]uint8) (slice)
if _, err := w.Write(cbg.CborEncodeMajorType(cbg.MajByteString, uint64(len(t.Return)))); err != nil {
return err
}
@ -1277,7 +1277,7 @@ func (t *MessageReceipt) MarshalCBOR(w io.Writer) error {
return err
}
// t.t.GasUsed (types.BigInt) (struct)
// t.GasUsed (types.BigInt) (struct)
if err := t.GasUsed.MarshalCBOR(w); err != nil {
return err
}
@ -1299,7 +1299,7 @@ func (t *MessageReceipt) UnmarshalCBOR(r io.Reader) error {
return fmt.Errorf("cbor input had wrong number of fields")
}
// t.t.ExitCode (uint8) (uint8)
// t.ExitCode (uint8) (uint8)
maj, extra, err = cbg.CborReadHeader(br)
if err != nil {
@ -1312,7 +1312,7 @@ func (t *MessageReceipt) UnmarshalCBOR(r io.Reader) error {
return fmt.Errorf("integer in input was too large for uint8 field")
}
t.ExitCode = uint8(extra)
// t.t.Return ([]uint8) (slice)
// t.Return ([]uint8) (slice)
maj, extra, err = cbg.CborReadHeader(br)
if err != nil {
@ -1329,7 +1329,7 @@ func (t *MessageReceipt) UnmarshalCBOR(r io.Reader) error {
if _, err := io.ReadFull(br, t.Return); err != nil {
return err
}
// t.t.GasUsed (types.BigInt) (struct)
// t.GasUsed (types.BigInt) (struct)
{
@ -1350,12 +1350,12 @@ func (t *BlockMsg) MarshalCBOR(w io.Writer) error {
return err
}
// t.t.Header (types.BlockHeader) (struct)
// t.Header (types.BlockHeader) (struct)
if err := t.Header.MarshalCBOR(w); err != nil {
return err
}
// t.t.BlsMessages ([]cid.Cid) (slice)
// t.BlsMessages ([]cid.Cid) (slice)
if _, err := w.Write(cbg.CborEncodeMajorType(cbg.MajArray, uint64(len(t.BlsMessages)))); err != nil {
return err
}
@ -1365,7 +1365,7 @@ func (t *BlockMsg) MarshalCBOR(w io.Writer) error {
}
}
// t.t.SecpkMessages ([]cid.Cid) (slice)
// t.SecpkMessages ([]cid.Cid) (slice)
if _, err := w.Write(cbg.CborEncodeMajorType(cbg.MajArray, uint64(len(t.SecpkMessages)))); err != nil {
return err
}
@ -1392,7 +1392,7 @@ func (t *BlockMsg) UnmarshalCBOR(r io.Reader) error {
return fmt.Errorf("cbor input had wrong number of fields")
}
// t.t.Header (types.BlockHeader) (struct)
// t.Header (types.BlockHeader) (struct)
{
@ -1413,7 +1413,7 @@ func (t *BlockMsg) UnmarshalCBOR(r io.Reader) error {
}
}
// t.t.BlsMessages ([]cid.Cid) (slice)
// t.BlsMessages ([]cid.Cid) (slice)
maj, extra, err = cbg.CborReadHeader(br)
if err != nil {
@ -1439,7 +1439,7 @@ func (t *BlockMsg) UnmarshalCBOR(r io.Reader) error {
t.BlsMessages[i] = c
}
// t.t.SecpkMessages ([]cid.Cid) (slice)
// t.SecpkMessages ([]cid.Cid) (slice)
maj, extra, err = cbg.CborReadHeader(br)
if err != nil {
@ -1477,12 +1477,12 @@ func (t *SignedStorageAsk) MarshalCBOR(w io.Writer) error {
return err
}
// t.t.Ask (types.StorageAsk) (struct)
// t.Ask (types.StorageAsk) (struct)
if err := t.Ask.MarshalCBOR(w); err != nil {
return err
}
// t.t.Signature (types.Signature) (struct)
// t.Signature (types.Signature) (struct)
if err := t.Signature.MarshalCBOR(w); err != nil {
return err
}
@ -1504,7 +1504,7 @@ func (t *SignedStorageAsk) UnmarshalCBOR(r io.Reader) error {
return fmt.Errorf("cbor input had wrong number of fields")
}
// t.t.Ask (types.StorageAsk) (struct)
// t.Ask (types.StorageAsk) (struct)
{
@ -1525,7 +1525,7 @@ func (t *SignedStorageAsk) UnmarshalCBOR(r io.Reader) error {
}
}
// t.t.Signature (types.Signature) (struct)
// t.Signature (types.Signature) (struct)
{
@ -1558,32 +1558,32 @@ func (t *StorageAsk) MarshalCBOR(w io.Writer) error {
return err
}
// t.t.Price (types.BigInt) (struct)
// t.Price (types.BigInt) (struct)
if err := t.Price.MarshalCBOR(w); err != nil {
return err
}
// t.t.MinPieceSize (uint64) (uint64)
// t.MinPieceSize (uint64) (uint64)
if _, err := w.Write(cbg.CborEncodeMajorType(cbg.MajUnsignedInt, uint64(t.MinPieceSize))); err != nil {
return err
}
// t.t.Miner (address.Address) (struct)
// t.Miner (address.Address) (struct)
if err := t.Miner.MarshalCBOR(w); err != nil {
return err
}
// t.t.Timestamp (uint64) (uint64)
// t.Timestamp (uint64) (uint64)
if _, err := w.Write(cbg.CborEncodeMajorType(cbg.MajUnsignedInt, uint64(t.Timestamp))); err != nil {
return err
}
// t.t.Expiry (uint64) (uint64)
// t.Expiry (uint64) (uint64)
if _, err := w.Write(cbg.CborEncodeMajorType(cbg.MajUnsignedInt, uint64(t.Expiry))); err != nil {
return err
}
// t.t.SeqNo (uint64) (uint64)
// t.SeqNo (uint64) (uint64)
if _, err := w.Write(cbg.CborEncodeMajorType(cbg.MajUnsignedInt, uint64(t.SeqNo))); err != nil {
return err
}
@ -1605,7 +1605,7 @@ func (t *StorageAsk) UnmarshalCBOR(r io.Reader) error {
return fmt.Errorf("cbor input had wrong number of fields")
}
// t.t.Price (types.BigInt) (struct)
// t.Price (types.BigInt) (struct)
{
@ -1614,7 +1614,7 @@ func (t *StorageAsk) UnmarshalCBOR(r io.Reader) error {
}
}
// t.t.MinPieceSize (uint64) (uint64)
// t.MinPieceSize (uint64) (uint64)
maj, extra, err = cbg.CborReadHeader(br)
if err != nil {
@ -1624,7 +1624,7 @@ func (t *StorageAsk) UnmarshalCBOR(r io.Reader) error {
return fmt.Errorf("wrong type for uint64 field")
}
t.MinPieceSize = uint64(extra)
// t.t.Miner (address.Address) (struct)
// t.Miner (address.Address) (struct)
{
@ -1633,7 +1633,7 @@ func (t *StorageAsk) UnmarshalCBOR(r io.Reader) error {
}
}
// t.t.Timestamp (uint64) (uint64)
// t.Timestamp (uint64) (uint64)
maj, extra, err = cbg.CborReadHeader(br)
if err != nil {
@ -1643,7 +1643,7 @@ func (t *StorageAsk) UnmarshalCBOR(r io.Reader) error {
return fmt.Errorf("wrong type for uint64 field")
}
t.Timestamp = uint64(extra)
// t.t.Expiry (uint64) (uint64)
// t.Expiry (uint64) (uint64)
maj, extra, err = cbg.CborReadHeader(br)
if err != nil {
@ -1653,7 +1653,7 @@ func (t *StorageAsk) UnmarshalCBOR(r io.Reader) error {
return fmt.Errorf("wrong type for uint64 field")
}
t.Expiry = uint64(extra)
// t.t.SeqNo (uint64) (uint64)
// t.SeqNo (uint64) (uint64)
maj, extra, err = cbg.CborReadHeader(br)
if err != nil {
@ -1675,7 +1675,7 @@ func (t *ExpTipSet) MarshalCBOR(w io.Writer) error {
return err
}
// t.t.Cids ([]cid.Cid) (slice)
// t.Cids ([]cid.Cid) (slice)
if _, err := w.Write(cbg.CborEncodeMajorType(cbg.MajArray, uint64(len(t.Cids)))); err != nil {
return err
}
@ -1685,7 +1685,7 @@ func (t *ExpTipSet) MarshalCBOR(w io.Writer) error {
}
}
// t.t.Blocks ([]*types.BlockHeader) (slice)
// t.Blocks ([]*types.BlockHeader) (slice)
if _, err := w.Write(cbg.CborEncodeMajorType(cbg.MajArray, uint64(len(t.Blocks)))); err != nil {
return err
}
@ -1695,7 +1695,7 @@ func (t *ExpTipSet) MarshalCBOR(w io.Writer) error {
}
}
// t.t.Height (uint64) (uint64)
// t.Height (uint64) (uint64)
if _, err := w.Write(cbg.CborEncodeMajorType(cbg.MajUnsignedInt, uint64(t.Height))); err != nil {
return err
}
@ -1717,7 +1717,7 @@ func (t *ExpTipSet) UnmarshalCBOR(r io.Reader) error {
return fmt.Errorf("cbor input had wrong number of fields")
}
// t.t.Cids ([]cid.Cid) (slice)
// t.Cids ([]cid.Cid) (slice)
maj, extra, err = cbg.CborReadHeader(br)
if err != nil {
@ -1743,7 +1743,7 @@ func (t *ExpTipSet) UnmarshalCBOR(r io.Reader) error {
t.Cids[i] = c
}
// t.t.Blocks ([]*types.BlockHeader) (slice)
// t.Blocks ([]*types.BlockHeader) (slice)
maj, extra, err = cbg.CborReadHeader(br)
if err != nil {
@ -1770,7 +1770,7 @@ func (t *ExpTipSet) UnmarshalCBOR(r io.Reader) error {
t.Blocks[i] = &v
}
// t.t.Height (uint64) (uint64)
// t.Height (uint64) (uint64)
maj, extra, err = cbg.CborReadHeader(br)
if err != nil {

View File

@ -49,7 +49,7 @@ func main() {
os.Exit(1)
}
err = gen.WriteTupleEncodersToFile("./api/cbor_gen.go", "api",
err = gen.WriteMapEncodersToFile("./api/cbor_gen.go", "api",
api.PaymentInfo{},
api.SealedRef{},
api.SealedRefs{},
@ -154,7 +154,7 @@ func main() {
os.Exit(1)
}
err = gen.WriteTupleEncodersToFile("./storage/cbor_gen.go", "storage",
err = gen.WriteMapEncodersToFile("./storage/cbor_gen.go", "storage",
storage.SealTicket{},
storage.SealSeed{},
storage.Piece{},

2
go.mod
View File

@ -86,7 +86,7 @@ require (
github.com/smartystreets/goconvey v0.0.0-20190731233626-505e41936337 // indirect
github.com/stretchr/testify v1.4.0
github.com/whyrusleeping/bencher v0.0.0-20190829221104-bb6607aa8bba
github.com/whyrusleeping/cbor-gen v0.0.0-20191208220313-d43e400b4942
github.com/whyrusleeping/cbor-gen v0.0.0-20191209162422-1c55bd7cf8aa
github.com/whyrusleeping/multiaddr-filter v0.0.0-20160516205228-e903e4adabd7
github.com/whyrusleeping/pubsub v0.0.0-20131020042734-02de8aa2db3d
go.opencensus.io v0.22.1

4
go.sum
View File

@ -586,8 +586,8 @@ github.com/whyrusleeping/cbor-gen v0.0.0-20190910031516-c1cbffdb01bb/go.mod h1:x
github.com/whyrusleeping/cbor-gen v0.0.0-20190917003517-d78d67427694/go.mod h1:xdlJQaiqipF0HW+Mzpg7XRM3fWbGvfgFlcppuvlkIvY=
github.com/whyrusleeping/cbor-gen v0.0.0-20191116002219-891f55cd449d h1:NRa/Vs7+b91GdXrp0AqsG7pspWV6CLk5Gk7i46L4tGo=
github.com/whyrusleeping/cbor-gen v0.0.0-20191116002219-891f55cd449d/go.mod h1:xdlJQaiqipF0HW+Mzpg7XRM3fWbGvfgFlcppuvlkIvY=
github.com/whyrusleeping/cbor-gen v0.0.0-20191208220313-d43e400b4942 h1:EIKesTogdQi76lVOmZleTRQtNNIXSy037QVBVMZ8rug=
github.com/whyrusleeping/cbor-gen v0.0.0-20191208220313-d43e400b4942/go.mod h1:xdlJQaiqipF0HW+Mzpg7XRM3fWbGvfgFlcppuvlkIvY=
github.com/whyrusleeping/cbor-gen v0.0.0-20191209162422-1c55bd7cf8aa h1:iuIvC21JR4TcHtdCtkXz2jG8KCAK9ZJQQQxbDkFxkNE=
github.com/whyrusleeping/cbor-gen v0.0.0-20191209162422-1c55bd7cf8aa/go.mod h1:xdlJQaiqipF0HW+Mzpg7XRM3fWbGvfgFlcppuvlkIvY=
github.com/whyrusleeping/chunker v0.0.0-20181014151217-fe64bd25879f h1:jQa4QT2UP9WYv2nzyawpKMOCl+Z/jW7djv2/J50lj9E=
github.com/whyrusleeping/chunker v0.0.0-20181014151217-fe64bd25879f/go.mod h1:p9UJB6dDgdPgMJZs7UjUOdulKyRr9fqkS+6JKAInPy8=
github.com/whyrusleeping/go-keyspace v0.0.0-20160322163242-5b898ac5add1 h1:EKhdznlJHPMoKr0XTrX+IlJs1LH3lyx2nfr1dOlZ79k=

View File

@ -168,7 +168,7 @@ func (sm *StorageMinerAPI) SectorsStatus(ctx context.Context, sid uint64) (api.S
Deals: deals,
Ticket: info.Ticket.SB(),
Seed: info.Seed.SB(),
Retries: info.Nonce,
Retries: info.Nonce,
LastErr: info.LastErr,
}, nil

View File

@ -22,12 +22,12 @@ func (t *VoucherInfo) MarshalCBOR(w io.Writer) error {
return err
}
// t.t.Voucher (types.SignedVoucher) (struct)
// t.Voucher (types.SignedVoucher) (struct)
if err := t.Voucher.MarshalCBOR(w); err != nil {
return err
}
// t.t.Proof ([]uint8) (slice)
// t.Proof ([]uint8) (slice)
if _, err := w.Write(cbg.CborEncodeMajorType(cbg.MajByteString, uint64(len(t.Proof)))); err != nil {
return err
}
@ -52,7 +52,7 @@ func (t *VoucherInfo) UnmarshalCBOR(r io.Reader) error {
return fmt.Errorf("cbor input had wrong number of fields")
}
// t.t.Voucher (types.SignedVoucher) (struct)
// t.Voucher (types.SignedVoucher) (struct)
{
@ -73,7 +73,7 @@ func (t *VoucherInfo) UnmarshalCBOR(r io.Reader) error {
}
}
// t.t.Proof ([]uint8) (slice)
// t.Proof ([]uint8) (slice)
maj, extra, err = cbg.CborReadHeader(br)
if err != nil {
@ -102,27 +102,27 @@ func (t *ChannelInfo) MarshalCBOR(w io.Writer) error {
return err
}
// t.t.Channel (address.Address) (struct)
// t.Channel (address.Address) (struct)
if err := t.Channel.MarshalCBOR(w); err != nil {
return err
}
// t.t.Control (address.Address) (struct)
// t.Control (address.Address) (struct)
if err := t.Control.MarshalCBOR(w); err != nil {
return err
}
// t.t.Target (address.Address) (struct)
// t.Target (address.Address) (struct)
if err := t.Target.MarshalCBOR(w); err != nil {
return err
}
// t.t.Direction (uint64) (uint64)
// t.Direction (uint64) (uint64)
if _, err := w.Write(cbg.CborEncodeMajorType(cbg.MajUnsignedInt, uint64(t.Direction))); err != nil {
return err
}
// t.t.Vouchers ([]*paych.VoucherInfo) (slice)
// t.Vouchers ([]*paych.VoucherInfo) (slice)
if _, err := w.Write(cbg.CborEncodeMajorType(cbg.MajArray, uint64(len(t.Vouchers)))); err != nil {
return err
}
@ -132,7 +132,7 @@ func (t *ChannelInfo) MarshalCBOR(w io.Writer) error {
}
}
// t.t.NextLane (uint64) (uint64)
// t.NextLane (uint64) (uint64)
if _, err := w.Write(cbg.CborEncodeMajorType(cbg.MajUnsignedInt, uint64(t.NextLane))); err != nil {
return err
}
@ -154,7 +154,7 @@ func (t *ChannelInfo) UnmarshalCBOR(r io.Reader) error {
return fmt.Errorf("cbor input had wrong number of fields")
}
// t.t.Channel (address.Address) (struct)
// t.Channel (address.Address) (struct)
{
@ -163,7 +163,7 @@ func (t *ChannelInfo) UnmarshalCBOR(r io.Reader) error {
}
}
// t.t.Control (address.Address) (struct)
// t.Control (address.Address) (struct)
{
@ -172,7 +172,7 @@ func (t *ChannelInfo) UnmarshalCBOR(r io.Reader) error {
}
}
// t.t.Target (address.Address) (struct)
// t.Target (address.Address) (struct)
{
@ -181,7 +181,7 @@ func (t *ChannelInfo) UnmarshalCBOR(r io.Reader) error {
}
}
// t.t.Direction (uint64) (uint64)
// t.Direction (uint64) (uint64)
maj, extra, err = cbg.CborReadHeader(br)
if err != nil {
@ -191,7 +191,7 @@ func (t *ChannelInfo) UnmarshalCBOR(r io.Reader) error {
return fmt.Errorf("wrong type for uint64 field")
}
t.Direction = uint64(extra)
// t.t.Vouchers ([]*paych.VoucherInfo) (slice)
// t.Vouchers ([]*paych.VoucherInfo) (slice)
maj, extra, err = cbg.CborReadHeader(br)
if err != nil {
@ -218,7 +218,7 @@ func (t *ChannelInfo) UnmarshalCBOR(r io.Reader) error {
t.Vouchers[i] = &v
}
// t.t.NextLane (uint64) (uint64)
// t.NextLane (uint64) (uint64)
maj, extra, err = cbg.CborReadHeader(br)
if err != nil {

View File

@ -21,7 +21,7 @@ func (t *RetParams) MarshalCBOR(w io.Writer) error {
return err
}
// t.t.Unixfs0 (retrieval.Unixfs0Offer) (struct)
// t.Unixfs0 (retrieval.Unixfs0Offer) (struct)
if err := t.Unixfs0.MarshalCBOR(w); err != nil {
return err
}
@ -43,7 +43,7 @@ func (t *RetParams) UnmarshalCBOR(r io.Reader) error {
return fmt.Errorf("cbor input had wrong number of fields")
}
// t.t.Unixfs0 (retrieval.Unixfs0Offer) (struct)
// t.Unixfs0 (retrieval.Unixfs0Offer) (struct)
{
@ -76,7 +76,7 @@ func (t *Query) MarshalCBOR(w io.Writer) error {
return err
}
// t.t.Piece (cid.Cid) (struct)
// t.Piece (cid.Cid) (struct)
if err := cbg.WriteCid(w, t.Piece); err != nil {
return xerrors.Errorf("failed to write cid field t.Piece: %w", err)
@ -100,7 +100,7 @@ func (t *Query) UnmarshalCBOR(r io.Reader) error {
return fmt.Errorf("cbor input had wrong number of fields")
}
// t.t.Piece (cid.Cid) (struct)
// t.Piece (cid.Cid) (struct)
{
@ -124,17 +124,17 @@ func (t *QueryResponse) MarshalCBOR(w io.Writer) error {
return err
}
// t.t.Status (retrieval.QueryResponseStatus) (uint64)
// t.Status (retrieval.QueryResponseStatus) (uint64)
if _, err := w.Write(cbg.CborEncodeMajorType(cbg.MajUnsignedInt, uint64(t.Status))); err != nil {
return err
}
// t.t.Size (uint64) (uint64)
// t.Size (uint64) (uint64)
if _, err := w.Write(cbg.CborEncodeMajorType(cbg.MajUnsignedInt, uint64(t.Size))); err != nil {
return err
}
// t.t.MinPrice (types.BigInt) (struct)
// t.MinPrice (types.BigInt) (struct)
if err := t.MinPrice.MarshalCBOR(w); err != nil {
return err
}
@ -156,7 +156,7 @@ func (t *QueryResponse) UnmarshalCBOR(r io.Reader) error {
return fmt.Errorf("cbor input had wrong number of fields")
}
// t.t.Status (retrieval.QueryResponseStatus) (uint64)
// t.Status (retrieval.QueryResponseStatus) (uint64)
maj, extra, err = cbg.CborReadHeader(br)
if err != nil {
@ -166,7 +166,7 @@ func (t *QueryResponse) UnmarshalCBOR(r io.Reader) error {
return fmt.Errorf("wrong type for uint64 field")
}
t.Status = QueryResponseStatus(extra)
// t.t.Size (uint64) (uint64)
// t.Size (uint64) (uint64)
maj, extra, err = cbg.CborReadHeader(br)
if err != nil {
@ -176,7 +176,7 @@ func (t *QueryResponse) UnmarshalCBOR(r io.Reader) error {
return fmt.Errorf("wrong type for uint64 field")
}
t.Size = uint64(extra)
// t.t.MinPrice (types.BigInt) (struct)
// t.MinPrice (types.BigInt) (struct)
{
@ -197,12 +197,12 @@ func (t *Unixfs0Offer) MarshalCBOR(w io.Writer) error {
return err
}
// t.t.Offset (uint64) (uint64)
// t.Offset (uint64) (uint64)
if _, err := w.Write(cbg.CborEncodeMajorType(cbg.MajUnsignedInt, uint64(t.Offset))); err != nil {
return err
}
// t.t.Size (uint64) (uint64)
// t.Size (uint64) (uint64)
if _, err := w.Write(cbg.CborEncodeMajorType(cbg.MajUnsignedInt, uint64(t.Size))); err != nil {
return err
}
@ -224,7 +224,7 @@ func (t *Unixfs0Offer) UnmarshalCBOR(r io.Reader) error {
return fmt.Errorf("cbor input had wrong number of fields")
}
// t.t.Offset (uint64) (uint64)
// t.Offset (uint64) (uint64)
maj, extra, err = cbg.CborReadHeader(br)
if err != nil {
@ -234,7 +234,7 @@ func (t *Unixfs0Offer) UnmarshalCBOR(r io.Reader) error {
return fmt.Errorf("wrong type for uint64 field")
}
t.Offset = uint64(extra)
// t.t.Size (uint64) (uint64)
// t.Size (uint64) (uint64)
maj, extra, err = cbg.CborReadHeader(br)
if err != nil {
@ -256,18 +256,18 @@ func (t *DealProposal) MarshalCBOR(w io.Writer) error {
return err
}
// t.t.Payment (api.PaymentInfo) (struct)
// t.Payment (api.PaymentInfo) (struct)
if err := t.Payment.MarshalCBOR(w); err != nil {
return err
}
// t.t.Ref (cid.Cid) (struct)
// t.Ref (cid.Cid) (struct)
if err := cbg.WriteCid(w, t.Ref); err != nil {
return xerrors.Errorf("failed to write cid field t.Ref: %w", err)
}
// t.t.Params (retrieval.RetParams) (struct)
// t.Params (retrieval.RetParams) (struct)
if err := t.Params.MarshalCBOR(w); err != nil {
return err
}
@ -289,7 +289,7 @@ func (t *DealProposal) UnmarshalCBOR(r io.Reader) error {
return fmt.Errorf("cbor input had wrong number of fields")
}
// t.t.Payment (api.PaymentInfo) (struct)
// t.Payment (api.PaymentInfo) (struct)
{
@ -298,7 +298,7 @@ func (t *DealProposal) UnmarshalCBOR(r io.Reader) error {
}
}
// t.t.Ref (cid.Cid) (struct)
// t.Ref (cid.Cid) (struct)
{
@ -310,7 +310,7 @@ func (t *DealProposal) UnmarshalCBOR(r io.Reader) error {
t.Ref = c
}
// t.t.Params (retrieval.RetParams) (struct)
// t.Params (retrieval.RetParams) (struct)
{
@ -331,12 +331,12 @@ func (t *DealResponse) MarshalCBOR(w io.Writer) error {
return err
}
// t.t.Status (uint64) (uint64)
// t.Status (uint64) (uint64)
if _, err := w.Write(cbg.CborEncodeMajorType(cbg.MajUnsignedInt, uint64(t.Status))); err != nil {
return err
}
// t.t.Message (string) (string)
// t.Message (string) (string)
if _, err := w.Write(cbg.CborEncodeMajorType(cbg.MajTextString, uint64(len(t.Message)))); err != nil {
return err
}
@ -361,7 +361,7 @@ func (t *DealResponse) UnmarshalCBOR(r io.Reader) error {
return fmt.Errorf("cbor input had wrong number of fields")
}
// t.t.Status (uint64) (uint64)
// t.Status (uint64) (uint64)
maj, extra, err = cbg.CborReadHeader(br)
if err != nil {
@ -371,7 +371,7 @@ func (t *DealResponse) UnmarshalCBOR(r io.Reader) error {
return fmt.Errorf("wrong type for uint64 field")
}
t.Status = uint64(extra)
// t.t.Message (string) (string)
// t.Message (string) (string)
{
sval, err := cbg.ReadString(br)
@ -393,7 +393,7 @@ func (t *Block) MarshalCBOR(w io.Writer) error {
return err
}
// t.t.Prefix ([]uint8) (slice)
// t.Prefix ([]uint8) (slice)
if _, err := w.Write(cbg.CborEncodeMajorType(cbg.MajByteString, uint64(len(t.Prefix)))); err != nil {
return err
}
@ -401,7 +401,7 @@ func (t *Block) MarshalCBOR(w io.Writer) error {
return err
}
// t.t.Data ([]uint8) (slice)
// t.Data ([]uint8) (slice)
if _, err := w.Write(cbg.CborEncodeMajorType(cbg.MajByteString, uint64(len(t.Data)))); err != nil {
return err
}
@ -426,7 +426,7 @@ func (t *Block) UnmarshalCBOR(r io.Reader) error {
return fmt.Errorf("cbor input had wrong number of fields")
}
// t.t.Prefix ([]uint8) (slice)
// t.Prefix ([]uint8) (slice)
maj, extra, err = cbg.CborReadHeader(br)
if err != nil {
@ -443,7 +443,7 @@ func (t *Block) UnmarshalCBOR(r io.Reader) error {
if _, err := io.ReadFull(br, t.Prefix); err != nil {
return err
}
// t.t.Data ([]uint8) (slice)
// t.Data ([]uint8) (slice)
maj, extra, err = cbg.CborReadHeader(br)
if err != nil {

View File

@ -17,16 +17,30 @@ func (t *SealTicket) MarshalCBOR(w io.Writer) error {
_, err := w.Write(cbg.CborNull)
return err
}
if _, err := w.Write([]byte{130}); err != nil {
if _, err := w.Write([]byte{162}); err != nil {
return err
}
// t.BlockHeight (uint64) (uint64)
if _, err := w.Write(cbg.CborEncodeMajorType(cbg.MajTextString, uint64(len("BlockHeight")))); err != nil {
return err
}
if _, err := w.Write([]byte("BlockHeight")); err != nil {
return err
}
// t.t.BlockHeight (uint64) (uint64)
if _, err := w.Write(cbg.CborEncodeMajorType(cbg.MajUnsignedInt, uint64(t.BlockHeight))); err != nil {
return err
}
// t.t.TicketBytes ([]uint8) (slice)
// t.TicketBytes ([]uint8) (slice)
if _, err := w.Write(cbg.CborEncodeMajorType(cbg.MajTextString, uint64(len("TicketBytes")))); err != nil {
return err
}
if _, err := w.Write([]byte("TicketBytes")); err != nil {
return err
}
if _, err := w.Write(cbg.CborEncodeMajorType(cbg.MajByteString, uint64(len(t.TicketBytes)))); err != nil {
return err
}
@ -43,15 +57,30 @@ func (t *SealTicket) UnmarshalCBOR(r io.Reader) error {
if err != nil {
return err
}
if maj != cbg.MajArray {
return fmt.Errorf("cbor input should be of type array")
if maj != cbg.MajMap {
return fmt.Errorf("cbor input should be of type map")
}
if extra != 2 {
return fmt.Errorf("cbor input had wrong number of fields")
}
// t.t.BlockHeight (uint64) (uint64)
var name string
// t.BlockHeight (uint64) (uint64)
{
sval, err := cbg.ReadString(br)
if err != nil {
return err
}
name = string(sval)
}
if name != "BlockHeight" {
return fmt.Errorf("expected struct map entry %s to be BlockHeight", name)
}
maj, extra, err = cbg.CborReadHeader(br)
if err != nil {
@ -61,7 +90,20 @@ func (t *SealTicket) UnmarshalCBOR(r io.Reader) error {
return fmt.Errorf("wrong type for uint64 field")
}
t.BlockHeight = uint64(extra)
// t.t.TicketBytes ([]uint8) (slice)
// t.TicketBytes ([]uint8) (slice)
{
sval, err := cbg.ReadString(br)
if err != nil {
return err
}
name = string(sval)
}
if name != "TicketBytes" {
return fmt.Errorf("expected struct map entry %s to be TicketBytes", name)
}
maj, extra, err = cbg.CborReadHeader(br)
if err != nil {
@ -86,16 +128,30 @@ func (t *SealSeed) MarshalCBOR(w io.Writer) error {
_, err := w.Write(cbg.CborNull)
return err
}
if _, err := w.Write([]byte{130}); err != nil {
if _, err := w.Write([]byte{162}); err != nil {
return err
}
// t.BlockHeight (uint64) (uint64)
if _, err := w.Write(cbg.CborEncodeMajorType(cbg.MajTextString, uint64(len("BlockHeight")))); err != nil {
return err
}
if _, err := w.Write([]byte("BlockHeight")); err != nil {
return err
}
// t.t.BlockHeight (uint64) (uint64)
if _, err := w.Write(cbg.CborEncodeMajorType(cbg.MajUnsignedInt, uint64(t.BlockHeight))); err != nil {
return err
}
// t.t.TicketBytes ([]uint8) (slice)
// t.TicketBytes ([]uint8) (slice)
if _, err := w.Write(cbg.CborEncodeMajorType(cbg.MajTextString, uint64(len("TicketBytes")))); err != nil {
return err
}
if _, err := w.Write([]byte("TicketBytes")); err != nil {
return err
}
if _, err := w.Write(cbg.CborEncodeMajorType(cbg.MajByteString, uint64(len(t.TicketBytes)))); err != nil {
return err
}
@ -112,15 +168,30 @@ func (t *SealSeed) UnmarshalCBOR(r io.Reader) error {
if err != nil {
return err
}
if maj != cbg.MajArray {
return fmt.Errorf("cbor input should be of type array")
if maj != cbg.MajMap {
return fmt.Errorf("cbor input should be of type map")
}
if extra != 2 {
return fmt.Errorf("cbor input had wrong number of fields")
}
// t.t.BlockHeight (uint64) (uint64)
var name string
// t.BlockHeight (uint64) (uint64)
{
sval, err := cbg.ReadString(br)
if err != nil {
return err
}
name = string(sval)
}
if name != "BlockHeight" {
return fmt.Errorf("expected struct map entry %s to be BlockHeight", name)
}
maj, extra, err = cbg.CborReadHeader(br)
if err != nil {
@ -130,7 +201,20 @@ func (t *SealSeed) UnmarshalCBOR(r io.Reader) error {
return fmt.Errorf("wrong type for uint64 field")
}
t.BlockHeight = uint64(extra)
// t.t.TicketBytes ([]uint8) (slice)
// t.TicketBytes ([]uint8) (slice)
{
sval, err := cbg.ReadString(br)
if err != nil {
return err
}
name = string(sval)
}
if name != "TicketBytes" {
return fmt.Errorf("expected struct map entry %s to be TicketBytes", name)
}
maj, extra, err = cbg.CborReadHeader(br)
if err != nil {
@ -155,21 +239,42 @@ func (t *Piece) MarshalCBOR(w io.Writer) error {
_, err := w.Write(cbg.CborNull)
return err
}
if _, err := w.Write([]byte{131}); err != nil {
if _, err := w.Write([]byte{163}); err != nil {
return err
}
// t.DealID (uint64) (uint64)
if _, err := w.Write(cbg.CborEncodeMajorType(cbg.MajTextString, uint64(len("DealID")))); err != nil {
return err
}
if _, err := w.Write([]byte("DealID")); err != nil {
return err
}
// t.t.DealID (uint64) (uint64)
if _, err := w.Write(cbg.CborEncodeMajorType(cbg.MajUnsignedInt, uint64(t.DealID))); err != nil {
return err
}
// t.t.Size (uint64) (uint64)
// t.Size (uint64) (uint64)
if _, err := w.Write(cbg.CborEncodeMajorType(cbg.MajTextString, uint64(len("Size")))); err != nil {
return err
}
if _, err := w.Write([]byte("Size")); err != nil {
return err
}
if _, err := w.Write(cbg.CborEncodeMajorType(cbg.MajUnsignedInt, uint64(t.Size))); err != nil {
return err
}
// t.t.CommP ([]uint8) (slice)
// t.CommP ([]uint8) (slice)
if _, err := w.Write(cbg.CborEncodeMajorType(cbg.MajTextString, uint64(len("CommP")))); err != nil {
return err
}
if _, err := w.Write([]byte("CommP")); err != nil {
return err
}
if _, err := w.Write(cbg.CborEncodeMajorType(cbg.MajByteString, uint64(len(t.CommP)))); err != nil {
return err
}
@ -186,15 +291,30 @@ func (t *Piece) UnmarshalCBOR(r io.Reader) error {
if err != nil {
return err
}
if maj != cbg.MajArray {
return fmt.Errorf("cbor input should be of type array")
if maj != cbg.MajMap {
return fmt.Errorf("cbor input should be of type map")
}
if extra != 3 {
return fmt.Errorf("cbor input had wrong number of fields")
}
// t.t.DealID (uint64) (uint64)
var name string
// t.DealID (uint64) (uint64)
{
sval, err := cbg.ReadString(br)
if err != nil {
return err
}
name = string(sval)
}
if name != "DealID" {
return fmt.Errorf("expected struct map entry %s to be DealID", name)
}
maj, extra, err = cbg.CborReadHeader(br)
if err != nil {
@ -204,7 +324,20 @@ func (t *Piece) UnmarshalCBOR(r io.Reader) error {
return fmt.Errorf("wrong type for uint64 field")
}
t.DealID = uint64(extra)
// t.t.Size (uint64) (uint64)
// t.Size (uint64) (uint64)
{
sval, err := cbg.ReadString(br)
if err != nil {
return err
}
name = string(sval)
}
if name != "Size" {
return fmt.Errorf("expected struct map entry %s to be Size", name)
}
maj, extra, err = cbg.CborReadHeader(br)
if err != nil {
@ -214,7 +347,20 @@ func (t *Piece) UnmarshalCBOR(r io.Reader) error {
return fmt.Errorf("wrong type for uint64 field")
}
t.Size = uint64(extra)
// t.t.CommP ([]uint8) (slice)
// t.CommP ([]uint8) (slice)
{
sval, err := cbg.ReadString(br)
if err != nil {
return err
}
name = string(sval)
}
if name != "CommP" {
return fmt.Errorf("expected struct map entry %s to be CommP", name)
}
maj, extra, err = cbg.CborReadHeader(br)
if err != nil {
@ -239,26 +385,54 @@ func (t *SectorInfo) MarshalCBOR(w io.Writer) error {
_, err := w.Write(cbg.CborNull)
return err
}
if _, err := w.Write([]byte{142}); err != nil {
if _, err := w.Write([]byte{173}); err != nil {
return err
}
// t.State (uint64) (uint64)
if _, err := w.Write(cbg.CborEncodeMajorType(cbg.MajTextString, uint64(len("State")))); err != nil {
return err
}
if _, err := w.Write([]byte("State")); err != nil {
return err
}
// t.t.State (uint64) (uint64)
if _, err := w.Write(cbg.CborEncodeMajorType(cbg.MajUnsignedInt, uint64(t.State))); err != nil {
return err
}
// t.t.SectorID (uint64) (uint64)
// t.SectorID (uint64) (uint64)
if _, err := w.Write(cbg.CborEncodeMajorType(cbg.MajTextString, uint64(len("SectorID")))); err != nil {
return err
}
if _, err := w.Write([]byte("SectorID")); err != nil {
return err
}
if _, err := w.Write(cbg.CborEncodeMajorType(cbg.MajUnsignedInt, uint64(t.SectorID))); err != nil {
return err
}
// t.t.Nonce (uint64) (uint64)
// t.Nonce (uint64) (uint64)
if _, err := w.Write(cbg.CborEncodeMajorType(cbg.MajTextString, uint64(len("Nonce")))); err != nil {
return err
}
if _, err := w.Write([]byte("Nonce")); err != nil {
return err
}
if _, err := w.Write(cbg.CborEncodeMajorType(cbg.MajUnsignedInt, uint64(t.Nonce))); err != nil {
return err
}
// t.t.Pieces ([]storage.Piece) (slice)
// t.Pieces ([]storage.Piece) (slice)
if _, err := w.Write(cbg.CborEncodeMajorType(cbg.MajTextString, uint64(len("Pieces")))); err != nil {
return err
}
if _, err := w.Write([]byte("Pieces")); err != nil {
return err
}
if _, err := w.Write(cbg.CborEncodeMajorType(cbg.MajArray, uint64(len(t.Pieces)))); err != nil {
return err
}
@ -268,15 +442,14 @@ func (t *SectorInfo) MarshalCBOR(w io.Writer) error {
}
}
// t.t.Pad0 ([]uint8) (slice)
if _, err := w.Write(cbg.CborEncodeMajorType(cbg.MajByteString, uint64(len(t.Pad0)))); err != nil {
// t.CommD ([]uint8) (slice)
if _, err := w.Write(cbg.CborEncodeMajorType(cbg.MajTextString, uint64(len("CommD")))); err != nil {
return err
}
if _, err := w.Write(t.Pad0); err != nil {
if _, err := w.Write([]byte("CommD")); err != nil {
return err
}
// t.t.CommD ([]uint8) (slice)
if _, err := w.Write(cbg.CborEncodeMajorType(cbg.MajByteString, uint64(len(t.CommD)))); err != nil {
return err
}
@ -284,7 +457,14 @@ func (t *SectorInfo) MarshalCBOR(w io.Writer) error {
return err
}
// t.t.CommR ([]uint8) (slice)
// t.CommR ([]uint8) (slice)
if _, err := w.Write(cbg.CborEncodeMajorType(cbg.MajTextString, uint64(len("CommR")))); err != nil {
return err
}
if _, err := w.Write([]byte("CommR")); err != nil {
return err
}
if _, err := w.Write(cbg.CborEncodeMajorType(cbg.MajByteString, uint64(len(t.CommR)))); err != nil {
return err
}
@ -292,15 +472,14 @@ func (t *SectorInfo) MarshalCBOR(w io.Writer) error {
return err
}
// t.t.Pad1 ([]uint8) (slice)
if _, err := w.Write(cbg.CborEncodeMajorType(cbg.MajByteString, uint64(len(t.Pad1)))); err != nil {
// t.Proof ([]uint8) (slice)
if _, err := w.Write(cbg.CborEncodeMajorType(cbg.MajTextString, uint64(len("Proof")))); err != nil {
return err
}
if _, err := w.Write(t.Pad1); err != nil {
if _, err := w.Write([]byte("Proof")); err != nil {
return err
}
// t.t.Proof ([]uint8) (slice)
if _, err := w.Write(cbg.CborEncodeMajorType(cbg.MajByteString, uint64(len(t.Proof)))); err != nil {
return err
}
@ -308,12 +487,25 @@ func (t *SectorInfo) MarshalCBOR(w io.Writer) error {
return err
}
// t.t.Ticket (storage.SealTicket) (struct)
// t.Ticket (storage.SealTicket) (struct)
if _, err := w.Write(cbg.CborEncodeMajorType(cbg.MajTextString, uint64(len("Ticket")))); err != nil {
return err
}
if _, err := w.Write([]byte("Ticket")); err != nil {
return err
}
if err := t.Ticket.MarshalCBOR(w); err != nil {
return err
}
// t.t.PreCommitMessage (cid.Cid) (struct)
// t.PreCommitMessage (cid.Cid) (struct)
if _, err := w.Write(cbg.CborEncodeMajorType(cbg.MajTextString, uint64(len("PreCommitMessage")))); err != nil {
return err
}
if _, err := w.Write([]byte("PreCommitMessage")); err != nil {
return err
}
if t.PreCommitMessage == nil {
if _, err := w.Write(cbg.CborNull); err != nil {
@ -325,12 +517,25 @@ func (t *SectorInfo) MarshalCBOR(w io.Writer) error {
}
}
// t.t.Seed (storage.SealSeed) (struct)
// t.Seed (storage.SealSeed) (struct)
if _, err := w.Write(cbg.CborEncodeMajorType(cbg.MajTextString, uint64(len("Seed")))); err != nil {
return err
}
if _, err := w.Write([]byte("Seed")); err != nil {
return err
}
if err := t.Seed.MarshalCBOR(w); err != nil {
return err
}
// t.t.CommitMessage (cid.Cid) (struct)
// t.CommitMessage (cid.Cid) (struct)
if _, err := w.Write(cbg.CborEncodeMajorType(cbg.MajTextString, uint64(len("CommitMessage")))); err != nil {
return err
}
if _, err := w.Write([]byte("CommitMessage")); err != nil {
return err
}
if t.CommitMessage == nil {
if _, err := w.Write(cbg.CborNull); err != nil {
@ -342,7 +547,13 @@ func (t *SectorInfo) MarshalCBOR(w io.Writer) error {
}
}
// t.t.FaultReportMsg (cid.Cid) (struct)
// t.FaultReportMsg (cid.Cid) (struct)
if _, err := w.Write(cbg.CborEncodeMajorType(cbg.MajTextString, uint64(len("FaultReportMsg")))); err != nil {
return err
}
if _, err := w.Write([]byte("FaultReportMsg")); err != nil {
return err
}
if t.FaultReportMsg == nil {
if _, err := w.Write(cbg.CborNull); err != nil {
@ -354,7 +565,14 @@ func (t *SectorInfo) MarshalCBOR(w io.Writer) error {
}
}
// t.t.LastErr (string) (string)
// t.LastErr (string) (string)
if _, err := w.Write(cbg.CborEncodeMajorType(cbg.MajTextString, uint64(len("LastErr")))); err != nil {
return err
}
if _, err := w.Write([]byte("LastErr")); err != nil {
return err
}
if _, err := w.Write(cbg.CborEncodeMajorType(cbg.MajTextString, uint64(len(t.LastErr)))); err != nil {
return err
}
@ -371,15 +589,30 @@ func (t *SectorInfo) UnmarshalCBOR(r io.Reader) error {
if err != nil {
return err
}
if maj != cbg.MajArray {
return fmt.Errorf("cbor input should be of type array")
if maj != cbg.MajMap {
return fmt.Errorf("cbor input should be of type map")
}
if extra != 14 {
if extra != 13 {
return fmt.Errorf("cbor input had wrong number of fields")
}
// t.t.State (uint64) (uint64)
var name string
// t.State (uint64) (uint64)
{
sval, err := cbg.ReadString(br)
if err != nil {
return err
}
name = string(sval)
}
if name != "State" {
return fmt.Errorf("expected struct map entry %s to be State", name)
}
maj, extra, err = cbg.CborReadHeader(br)
if err != nil {
@ -389,7 +622,20 @@ func (t *SectorInfo) UnmarshalCBOR(r io.Reader) error {
return fmt.Errorf("wrong type for uint64 field")
}
t.State = uint64(extra)
// t.t.SectorID (uint64) (uint64)
// t.SectorID (uint64) (uint64)
{
sval, err := cbg.ReadString(br)
if err != nil {
return err
}
name = string(sval)
}
if name != "SectorID" {
return fmt.Errorf("expected struct map entry %s to be SectorID", name)
}
maj, extra, err = cbg.CborReadHeader(br)
if err != nil {
@ -399,7 +645,20 @@ func (t *SectorInfo) UnmarshalCBOR(r io.Reader) error {
return fmt.Errorf("wrong type for uint64 field")
}
t.SectorID = uint64(extra)
// t.t.Nonce (uint64) (uint64)
// t.Nonce (uint64) (uint64)
{
sval, err := cbg.ReadString(br)
if err != nil {
return err
}
name = string(sval)
}
if name != "Nonce" {
return fmt.Errorf("expected struct map entry %s to be Nonce", name)
}
maj, extra, err = cbg.CborReadHeader(br)
if err != nil {
@ -409,7 +668,20 @@ func (t *SectorInfo) UnmarshalCBOR(r io.Reader) error {
return fmt.Errorf("wrong type for uint64 field")
}
t.Nonce = uint64(extra)
// t.t.Pieces ([]storage.Piece) (slice)
// t.Pieces ([]storage.Piece) (slice)
{
sval, err := cbg.ReadString(br)
if err != nil {
return err
}
name = string(sval)
}
if name != "Pieces" {
return fmt.Errorf("expected struct map entry %s to be Pieces", name)
}
maj, extra, err = cbg.CborReadHeader(br)
if err != nil {
@ -436,24 +708,20 @@ func (t *SectorInfo) UnmarshalCBOR(r io.Reader) error {
t.Pieces[i] = v
}
// t.t.Pad0 ([]uint8) (slice)
// t.CommD ([]uint8) (slice)
maj, extra, err = cbg.CborReadHeader(br)
if err != nil {
return err
{
sval, err := cbg.ReadString(br)
if err != nil {
return err
}
name = string(sval)
}
if extra > cbg.ByteArrayMaxLen {
return fmt.Errorf("t.Pad0: byte array too large (%d)", extra)
if name != "CommD" {
return fmt.Errorf("expected struct map entry %s to be CommD", name)
}
if maj != cbg.MajByteString {
return fmt.Errorf("expected byte array")
}
t.Pad0 = make([]byte, extra)
if _, err := io.ReadFull(br, t.Pad0); err != nil {
return err
}
// t.t.CommD ([]uint8) (slice)
maj, extra, err = cbg.CborReadHeader(br)
if err != nil {
@ -470,7 +738,20 @@ func (t *SectorInfo) UnmarshalCBOR(r io.Reader) error {
if _, err := io.ReadFull(br, t.CommD); err != nil {
return err
}
// t.t.CommR ([]uint8) (slice)
// t.CommR ([]uint8) (slice)
{
sval, err := cbg.ReadString(br)
if err != nil {
return err
}
name = string(sval)
}
if name != "CommR" {
return fmt.Errorf("expected struct map entry %s to be CommR", name)
}
maj, extra, err = cbg.CborReadHeader(br)
if err != nil {
@ -487,24 +768,20 @@ func (t *SectorInfo) UnmarshalCBOR(r io.Reader) error {
if _, err := io.ReadFull(br, t.CommR); err != nil {
return err
}
// t.t.Pad1 ([]uint8) (slice)
// t.Proof ([]uint8) (slice)
maj, extra, err = cbg.CborReadHeader(br)
if err != nil {
return err
{
sval, err := cbg.ReadString(br)
if err != nil {
return err
}
name = string(sval)
}
if extra > cbg.ByteArrayMaxLen {
return fmt.Errorf("t.Pad1: byte array too large (%d)", extra)
if name != "Proof" {
return fmt.Errorf("expected struct map entry %s to be Proof", name)
}
if maj != cbg.MajByteString {
return fmt.Errorf("expected byte array")
}
t.Pad1 = make([]byte, extra)
if _, err := io.ReadFull(br, t.Pad1); err != nil {
return err
}
// t.t.Proof ([]uint8) (slice)
maj, extra, err = cbg.CborReadHeader(br)
if err != nil {
@ -521,7 +798,20 @@ func (t *SectorInfo) UnmarshalCBOR(r io.Reader) error {
if _, err := io.ReadFull(br, t.Proof); err != nil {
return err
}
// t.t.Ticket (storage.SealTicket) (struct)
// t.Ticket (storage.SealTicket) (struct)
{
sval, err := cbg.ReadString(br)
if err != nil {
return err
}
name = string(sval)
}
if name != "Ticket" {
return fmt.Errorf("expected struct map entry %s to be Ticket", name)
}
{
@ -530,7 +820,20 @@ func (t *SectorInfo) UnmarshalCBOR(r io.Reader) error {
}
}
// t.t.PreCommitMessage (cid.Cid) (struct)
// t.PreCommitMessage (cid.Cid) (struct)
{
sval, err := cbg.ReadString(br)
if err != nil {
return err
}
name = string(sval)
}
if name != "PreCommitMessage" {
return fmt.Errorf("expected struct map entry %s to be PreCommitMessage", name)
}
{
@ -554,7 +857,20 @@ func (t *SectorInfo) UnmarshalCBOR(r io.Reader) error {
}
}
// t.t.Seed (storage.SealSeed) (struct)
// t.Seed (storage.SealSeed) (struct)
{
sval, err := cbg.ReadString(br)
if err != nil {
return err
}
name = string(sval)
}
if name != "Seed" {
return fmt.Errorf("expected struct map entry %s to be Seed", name)
}
{
@ -563,7 +879,20 @@ func (t *SectorInfo) UnmarshalCBOR(r io.Reader) error {
}
}
// t.t.CommitMessage (cid.Cid) (struct)
// t.CommitMessage (cid.Cid) (struct)
{
sval, err := cbg.ReadString(br)
if err != nil {
return err
}
name = string(sval)
}
if name != "CommitMessage" {
return fmt.Errorf("expected struct map entry %s to be CommitMessage", name)
}
{
@ -587,7 +916,20 @@ func (t *SectorInfo) UnmarshalCBOR(r io.Reader) error {
}
}
// t.t.FaultReportMsg (cid.Cid) (struct)
// t.FaultReportMsg (cid.Cid) (struct)
{
sval, err := cbg.ReadString(br)
if err != nil {
return err
}
name = string(sval)
}
if name != "FaultReportMsg" {
return fmt.Errorf("expected struct map entry %s to be FaultReportMsg", name)
}
{
@ -611,7 +953,20 @@ func (t *SectorInfo) UnmarshalCBOR(r io.Reader) error {
}
}
// t.t.LastErr (string) (string)
// t.LastErr (string) (string)
{
sval, err := cbg.ReadString(br)
if err != nil {
return err
}
name = string(sval)
}
if name != "LastErr" {
return fmt.Errorf("expected struct map entry %s to be LastErr", name)
}
{
sval, err := cbg.ReadString(br)

View File

@ -105,7 +105,7 @@ func (m *Miner) Run(ctx context.Context) error {
go fps.run(ctx)
if err := m.sectorStateLoop(ctx); err != nil {
log.Error(err)
log.Errorf("%+v", err)
return xerrors.Errorf("failed to startup sector state loop: %w", err)
}

View File

@ -56,10 +56,8 @@ type SectorInfo struct {
Pieces []Piece
// PreCommit
Pad0 []byte // TODO: legacy placeholder, remove
CommD []byte
CommR []byte
Pad1 []byte // TODO: legacy placeholder, remove
Proof []byte
Ticket SealTicket

View File

@ -65,7 +65,7 @@ func (m *Miner) UpdateSectorState(ctx context.Context, sector uint64, snonce uin
func (m *Miner) sectorStateLoop(ctx context.Context) error {
trackedSectors, err := m.ListSectors()
if err != nil {
return err
return xerrors.Errorf("loading sector list: %w", err)
}
go func() {
@ -100,7 +100,7 @@ func (m *Miner) sectorStateLoop(ctx context.Context) error {
ps, err := m.api.StateMinerProvingSet(ctx, m.maddr, curTs)
if err != nil {
return err
return xerrors.Errorf("getting miner proving set: %w", err)
}
for _, ocs := range ps {
if _, ok := trackedByID[ocs.SectorID]; ok {
@ -247,13 +247,13 @@ func (m *Miner) onSectorUpdated(ctx context.Context, update sectorUpdate) {
// Handled failure modes
case api.SealFailed:
log.Warn("sector %d entered unimplemented state 'SealFailed'", update.id)
log.Warnf("sector %d entered unimplemented state 'SealFailed'", update.id)
case api.PreCommitFailed:
log.Warn("sector %d entered unimplemented state 'PreCommitFailed'", update.id)
log.Warnf("sector %d entered unimplemented state 'PreCommitFailed'", update.id)
case api.SealCommitFailed:
log.Warn("sector %d entered unimplemented state 'SealCommitFailed'", update.id)
log.Warnf("sector %d entered unimplemented state 'SealCommitFailed'", update.id)
case api.CommitFailed:
log.Warn("sector %d entered unimplemented state 'CommitFailed'", update.id)
log.Warnf("sector %d entered unimplemented state 'CommitFailed'", update.id)
// Faults
case api.Faulty: