Use map encoders for some structs
This commit is contained in:
+325
-312
File diff suppressed because it is too large
Load Diff
+40
-31
@@ -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,13 +60,14 @@ 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 {
|
||||
return err
|
||||
}
|
||||
if extra > 8192 {
|
||||
|
||||
if extra > cbg.MaxLength {
|
||||
return fmt.Errorf("t.Start: array too large (%d)", extra)
|
||||
}
|
||||
|
||||
@@ -85,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 {
|
||||
@@ -95,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 {
|
||||
@@ -117,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
|
||||
}
|
||||
@@ -127,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
|
||||
}
|
||||
@@ -157,13 +158,14 @@ 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 {
|
||||
return err
|
||||
}
|
||||
if extra > 8192 {
|
||||
|
||||
if extra > cbg.MaxLength {
|
||||
return fmt.Errorf("t.Chain: array too large (%d)", extra)
|
||||
}
|
||||
|
||||
@@ -183,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 {
|
||||
@@ -193,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)
|
||||
@@ -215,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
|
||||
}
|
||||
@@ -225,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
|
||||
}
|
||||
@@ -235,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
|
||||
}
|
||||
@@ -250,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
|
||||
}
|
||||
@@ -260,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
|
||||
}
|
||||
@@ -292,13 +294,14 @@ 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 {
|
||||
return err
|
||||
}
|
||||
if extra > 8192 {
|
||||
|
||||
if extra > cbg.MaxLength {
|
||||
return fmt.Errorf("t.Blocks: array too large (%d)", extra)
|
||||
}
|
||||
|
||||
@@ -318,13 +321,14 @@ 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 {
|
||||
return err
|
||||
}
|
||||
if extra > 8192 {
|
||||
|
||||
if extra > cbg.MaxLength {
|
||||
return fmt.Errorf("t.BlsMessages: array too large (%d)", extra)
|
||||
}
|
||||
|
||||
@@ -344,13 +348,14 @@ 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 {
|
||||
return err
|
||||
}
|
||||
if extra > 8192 {
|
||||
|
||||
if extra > cbg.MaxLength {
|
||||
return fmt.Errorf("t.BlsMsgIncludes: array too large (%d)", extra)
|
||||
}
|
||||
|
||||
@@ -370,7 +375,8 @@ func (t *BSTipSet) UnmarshalCBOR(r io.Reader) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if extra > 8192 {
|
||||
|
||||
if extra > cbg.MaxLength {
|
||||
return fmt.Errorf("t.BlsMsgIncludes[i]: array too large (%d)", extra)
|
||||
}
|
||||
|
||||
@@ -397,13 +403,14 @@ 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 {
|
||||
return err
|
||||
}
|
||||
if extra > 8192 {
|
||||
|
||||
if extra > cbg.MaxLength {
|
||||
return fmt.Errorf("t.SecpkMessages: array too large (%d)", extra)
|
||||
}
|
||||
|
||||
@@ -423,13 +430,14 @@ 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 {
|
||||
return err
|
||||
}
|
||||
if extra > 8192 {
|
||||
|
||||
if extra > cbg.MaxLength {
|
||||
return fmt.Errorf("t.SecpkMsgIncludes: array too large (%d)", extra)
|
||||
}
|
||||
|
||||
@@ -449,7 +457,8 @@ func (t *BSTipSet) UnmarshalCBOR(r io.Reader) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if extra > 8192 {
|
||||
|
||||
if extra > cbg.MaxLength {
|
||||
return fmt.Errorf("t.SecpkMsgIncludes[i]: array too large (%d)", extra)
|
||||
}
|
||||
|
||||
|
||||
+70
-70
@@ -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,18 +209,18 @@ 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.StorageDeal (actors.StorageDeal) (struct)
|
||||
// t.StorageDeal (actors.StorageDeal) (struct)
|
||||
if err := t.StorageDeal.MarshalCBOR(w); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// t.t.PublishMessage (cid.Cid) (struct)
|
||||
// t.PublishMessage (cid.Cid) (struct)
|
||||
|
||||
if t.PublishMessage == nil {
|
||||
if _, err := w.Write(cbg.CborNull); err != nil {
|
||||
@@ -250,7 +250,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 {
|
||||
@@ -260,7 +260,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)
|
||||
@@ -270,7 +270,7 @@ func (t *Response) UnmarshalCBOR(r io.Reader) error {
|
||||
|
||||
t.Message = string(sval)
|
||||
}
|
||||
// t.t.Proposal (cid.Cid) (struct)
|
||||
// t.Proposal (cid.Cid) (struct)
|
||||
|
||||
{
|
||||
|
||||
@@ -282,7 +282,7 @@ func (t *Response) UnmarshalCBOR(r io.Reader) error {
|
||||
t.Proposal = c
|
||||
|
||||
}
|
||||
// t.t.StorageDeal (actors.StorageDeal) (struct)
|
||||
// t.StorageDeal (actors.StorageDeal) (struct)
|
||||
|
||||
{
|
||||
|
||||
@@ -303,7 +303,7 @@ func (t *Response) UnmarshalCBOR(r io.Reader) error {
|
||||
}
|
||||
|
||||
}
|
||||
// t.t.PublishMessage (cid.Cid) (struct)
|
||||
// t.PublishMessage (cid.Cid) (struct)
|
||||
|
||||
{
|
||||
|
||||
@@ -339,12 +339,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
|
||||
}
|
||||
@@ -366,7 +366,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)
|
||||
|
||||
{
|
||||
|
||||
@@ -375,7 +375,7 @@ func (t *SignedResponse) UnmarshalCBOR(r io.Reader) error {
|
||||
}
|
||||
|
||||
}
|
||||
// t.t.Signature (types.Signature) (struct)
|
||||
// t.Signature (types.Signature) (struct)
|
||||
|
||||
{
|
||||
|
||||
@@ -408,43 +408,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
|
||||
}
|
||||
@@ -469,7 +469,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)
|
||||
|
||||
{
|
||||
|
||||
@@ -481,7 +481,7 @@ func (t *ClientDealProposal) UnmarshalCBOR(r io.Reader) error {
|
||||
t.Data = c
|
||||
|
||||
}
|
||||
// t.t.PricePerEpoch (types.BigInt) (struct)
|
||||
// t.PricePerEpoch (types.BigInt) (struct)
|
||||
|
||||
{
|
||||
|
||||
@@ -490,7 +490,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 {
|
||||
@@ -500,7 +500,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 {
|
||||
@@ -510,7 +510,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)
|
||||
|
||||
{
|
||||
|
||||
@@ -519,7 +519,7 @@ func (t *ClientDealProposal) UnmarshalCBOR(r io.Reader) error {
|
||||
}
|
||||
|
||||
}
|
||||
// t.t.Client (address.Address) (struct)
|
||||
// t.Client (address.Address) (struct)
|
||||
|
||||
{
|
||||
|
||||
@@ -528,7 +528,7 @@ func (t *ClientDealProposal) UnmarshalCBOR(r io.Reader) error {
|
||||
}
|
||||
|
||||
}
|
||||
// t.t.MinerWorker (address.Address) (struct)
|
||||
// t.MinerWorker (address.Address) (struct)
|
||||
|
||||
{
|
||||
|
||||
@@ -537,7 +537,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)
|
||||
@@ -559,23 +559,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
|
||||
}
|
||||
@@ -583,17 +583,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 (cid.Cid) (struct)
|
||||
// t.PublishMessage (cid.Cid) (struct)
|
||||
|
||||
if t.PublishMessage == nil {
|
||||
if _, err := w.Write(cbg.CborNull); err != nil {
|
||||
@@ -623,7 +623,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)
|
||||
|
||||
{
|
||||
|
||||
@@ -635,7 +635,7 @@ func (t *ClientDeal) UnmarshalCBOR(r io.Reader) error {
|
||||
t.ProposalCid = c
|
||||
|
||||
}
|
||||
// t.t.Proposal (actors.StorageDealProposal) (struct)
|
||||
// t.Proposal (actors.StorageDealProposal) (struct)
|
||||
|
||||
{
|
||||
|
||||
@@ -644,7 +644,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 {
|
||||
@@ -654,7 +654,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)
|
||||
@@ -664,7 +664,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)
|
||||
|
||||
{
|
||||
|
||||
@@ -673,7 +673,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 {
|
||||
@@ -683,7 +683,7 @@ func (t *ClientDeal) UnmarshalCBOR(r io.Reader) error {
|
||||
return fmt.Errorf("wrong type for uint64 field")
|
||||
}
|
||||
t.DealID = uint64(extra)
|
||||
// t.t.PublishMessage (cid.Cid) (struct)
|
||||
// t.PublishMessage (cid.Cid) (struct)
|
||||
|
||||
{
|
||||
|
||||
@@ -719,7 +719,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
|
||||
}
|
||||
@@ -727,34 +727,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
|
||||
}
|
||||
@@ -776,7 +776,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)
|
||||
@@ -786,7 +786,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)
|
||||
|
||||
{
|
||||
|
||||
@@ -795,7 +795,7 @@ func (t *MinerDeal) UnmarshalCBOR(r io.Reader) error {
|
||||
}
|
||||
|
||||
}
|
||||
// t.t.ProposalCid (cid.Cid) (struct)
|
||||
// t.ProposalCid (cid.Cid) (struct)
|
||||
|
||||
{
|
||||
|
||||
@@ -807,7 +807,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 {
|
||||
@@ -817,7 +817,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)
|
||||
|
||||
{
|
||||
|
||||
@@ -829,7 +829,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 {
|
||||
@@ -839,7 +839,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 {
|
||||
@@ -861,13 +861,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
|
||||
}
|
||||
@@ -889,7 +889,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)
|
||||
|
||||
{
|
||||
|
||||
@@ -901,7 +901,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 {
|
||||
|
||||
+170
-163
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user