From 45ac7d0529904c547e7c1e2e11d87b09a43ce2dc Mon Sep 17 00:00:00 2001 From: Rod Vagg Date: Tue, 6 Feb 2024 19:11:57 +1100 Subject: [PATCH] v13: make AggregateProofType optional on ProveCommitSectors3Params & ProveReplicaUpdates3Params Ref: https://github.com/filecoin-project/FIPs/pull/934 --- abi/cbor_bytes.go | 2 +- abi/cbor_string.go | 2 +- builtin/v10/account/cbor_gen.go | 4 +- builtin/v10/cron/cbor_gen.go | 2 +- builtin/v10/datacap/cbor_gen.go | 12 +- builtin/v10/eam/cbor_gen.go | 12 +- builtin/v10/evm/cbor_gen.go | 12 +- builtin/v10/init/cbor_gen.go | 10 +- builtin/v10/market/cbor_gen.go | 26 ++-- builtin/v10/market/deal.go | 6 +- builtin/v10/miner/cbor_gen.go | 93 +++++------ builtin/v10/multisig/cbor_gen.go | 19 +-- builtin/v10/paych/cbor_gen.go | 8 +- builtin/v10/power/cbor_gen.go | 18 +-- builtin/v10/reward/cbor_gen.go | 1 + builtin/v10/verifreg/cbor_gen.go | 34 ++-- builtin/v11/account/cbor_gen.go | 4 +- builtin/v11/cron/cbor_gen.go | 2 +- builtin/v11/datacap/cbor_gen.go | 12 +- builtin/v11/eam/cbor_gen.go | 12 +- builtin/v11/evm/cbor_gen.go | 12 +- builtin/v11/init/cbor_gen.go | 10 +- builtin/v11/market/cbor_gen.go | 26 ++-- builtin/v11/market/deal.go | 6 +- builtin/v11/miner/cbor_gen.go | 93 +++++------ builtin/v11/multisig/cbor_gen.go | 19 +-- builtin/v11/paych/cbor_gen.go | 8 +- builtin/v11/power/cbor_gen.go | 18 +-- builtin/v11/reward/cbor_gen.go | 1 + builtin/v11/verifreg/cbor_gen.go | 34 ++-- builtin/v12/account/cbor_gen.go | 4 +- builtin/v12/cron/cbor_gen.go | 2 +- builtin/v12/datacap/cbor_gen.go | 12 +- builtin/v12/eam/cbor_gen.go | 12 +- builtin/v12/evm/cbor_gen.go | 12 +- builtin/v12/init/cbor_gen.go | 10 +- builtin/v12/market/cbor_gen.go | 22 +-- builtin/v12/market/deal.go | 2 +- builtin/v12/miner/cbor_gen.go | 93 +++++------ builtin/v12/multisig/cbor_gen.go | 19 +-- builtin/v12/paych/cbor_gen.go | 8 +- builtin/v12/power/cbor_gen.go | 18 +-- builtin/v12/reward/cbor_gen.go | 1 + builtin/v12/verifreg/cbor_gen.go | 34 ++-- builtin/v13/account/cbor_gen.go | 4 +- builtin/v13/cron/cbor_gen.go | 2 +- builtin/v13/datacap/cbor_gen.go | 12 +- builtin/v13/eam/cbor_gen.go | 12 +- builtin/v13/evm/cbor_gen.go | 12 +- builtin/v13/init/cbor_gen.go | 10 +- builtin/v13/market/cbor_gen.go | 25 +-- builtin/v13/market/deal.go | 2 +- builtin/v13/miner/cbor_gen.go | 232 ++++++++++++++++------------ builtin/v13/miner/miner_types.go | 4 +- builtin/v13/multisig/cbor_gen.go | 19 +-- builtin/v13/paych/cbor_gen.go | 8 +- builtin/v13/power/cbor_gen.go | 18 +-- builtin/v13/reward/cbor_gen.go | 1 + builtin/v13/verifreg/cbor_gen.go | 34 ++-- builtin/v8/cron/cbor_gen.go | 2 +- builtin/v8/init/cbor_gen.go | 6 +- builtin/v8/market/cbor_gen.go | 23 +-- builtin/v8/market/deal.go | 2 +- builtin/v8/miner/cbor_gen.go | 69 +++++---- builtin/v8/multisig/cbor_gen.go | 19 +-- builtin/v8/paych/cbor_gen.go | 8 +- builtin/v8/power/cbor_gen.go | 18 +-- builtin/v8/reward/cbor_gen.go | 1 + builtin/v9/account/cbor_gen.go | 4 +- builtin/v9/cron/cbor_gen.go | 2 +- builtin/v9/datacap/cbor_gen.go | 12 +- builtin/v9/init/cbor_gen.go | 6 +- builtin/v9/init/init_actor_state.go | 2 +- builtin/v9/market/cbor_gen.go | 24 +-- builtin/v9/market/deal.go | 2 +- builtin/v9/miner/cbor_gen.go | 89 ++++++----- builtin/v9/multisig/cbor_gen.go | 19 +-- builtin/v9/paych/cbor_gen.go | 8 +- builtin/v9/power/cbor_gen.go | 18 +-- builtin/v9/reward/cbor_gen.go | 1 + builtin/v9/verifreg/cbor_gen.go | 34 ++-- go.mod | 14 +- go.sum | 30 ++-- manifest/cbor_gen.go | 2 +- manifest/manifest.go | 10 +- proof/cbor_gen.go | 22 +-- 86 files changed, 868 insertions(+), 741 deletions(-) diff --git a/abi/cbor_bytes.go b/abi/cbor_bytes.go index f3acf177..7ffddc7f 100644 --- a/abi/cbor_bytes.go +++ b/abi/cbor_bytes.go @@ -11,7 +11,7 @@ import ( type CborBytes []byte func (t *CborBytes) MarshalCBOR(w io.Writer) error { - if len(*t) > cbg.ByteArrayMaxLen { + if uint64(len(*t)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("byte array was too long") } diff --git a/abi/cbor_string.go b/abi/cbor_string.go index e3d316f7..72c9181a 100644 --- a/abi/cbor_string.go +++ b/abi/cbor_string.go @@ -13,7 +13,7 @@ type CborString string func (t *CborString) MarshalCBOR(w io.Writer) error { scratch := make([]byte, 8) - if len(*t) > cbg.MaxLength { + if uint64(len(*t)) > cbg.MaxLength { return xerrors.Errorf("Value in t was too long") } diff --git a/builtin/v10/account/cbor_gen.go b/builtin/v10/account/cbor_gen.go index 4a49915b..0bd09be2 100644 --- a/builtin/v10/account/cbor_gen.go +++ b/builtin/v10/account/cbor_gen.go @@ -89,7 +89,7 @@ func (t *AuthenticateMessageParams) MarshalCBOR(w io.Writer) error { } // t.Signature ([]uint8) (slice) - if len(t.Signature) > cbg.ByteArrayMaxLen { + if uint64(len(t.Signature)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.Signature was too long") } @@ -102,7 +102,7 @@ func (t *AuthenticateMessageParams) MarshalCBOR(w io.Writer) error { } // t.Message ([]uint8) (slice) - if len(t.Message) > cbg.ByteArrayMaxLen { + if uint64(len(t.Message)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.Message was too long") } diff --git a/builtin/v10/cron/cbor_gen.go b/builtin/v10/cron/cbor_gen.go index 013f8f58..73deb41d 100644 --- a/builtin/v10/cron/cbor_gen.go +++ b/builtin/v10/cron/cbor_gen.go @@ -34,7 +34,7 @@ func (t *State) MarshalCBOR(w io.Writer) error { } // t.Entries ([]cron.Entry) (slice) - if len(t.Entries) > cbg.MaxLength { + if uint64(len(t.Entries)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Entries was too long") } diff --git a/builtin/v10/datacap/cbor_gen.go b/builtin/v10/datacap/cbor_gen.go index 4f61008b..42c936a6 100644 --- a/builtin/v10/datacap/cbor_gen.go +++ b/builtin/v10/datacap/cbor_gen.go @@ -227,7 +227,7 @@ func (t *MintParams) MarshalCBOR(w io.Writer) error { } // t.Operators ([]address.Address) (slice) - if len(t.Operators) > cbg.MaxLength { + if uint64(len(t.Operators)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Operators was too long") } @@ -350,7 +350,7 @@ func (t *MintReturn) MarshalCBOR(w io.Writer) error { } // t.RecipientData ([]uint8) (slice) - if len(t.RecipientData) > cbg.ByteArrayMaxLen { + if uint64(len(t.RecipientData)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.RecipientData was too long") } @@ -526,7 +526,7 @@ func (t *TransferParams) MarshalCBOR(w io.Writer) error { } // t.OperatorData ([]uint8) (slice) - if len(t.OperatorData) > cbg.ByteArrayMaxLen { + if uint64(len(t.OperatorData)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.OperatorData was too long") } @@ -632,7 +632,7 @@ func (t *TransferReturn) MarshalCBOR(w io.Writer) error { } // t.RecipientData ([]uint8) (slice) - if len(t.RecipientData) > cbg.ByteArrayMaxLen { + if uint64(len(t.RecipientData)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.RecipientData was too long") } @@ -743,7 +743,7 @@ func (t *TransferFromParams) MarshalCBOR(w io.Writer) error { } // t.OperatorData ([]uint8) (slice) - if len(t.OperatorData) > cbg.ByteArrayMaxLen { + if uint64(len(t.OperatorData)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.OperatorData was too long") } @@ -863,7 +863,7 @@ func (t *TransferFromReturn) MarshalCBOR(w io.Writer) error { } // t.RecipientData ([]uint8) (slice) - if len(t.RecipientData) > cbg.ByteArrayMaxLen { + if uint64(len(t.RecipientData)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.RecipientData was too long") } diff --git a/builtin/v10/eam/cbor_gen.go b/builtin/v10/eam/cbor_gen.go index 368a14e0..ef731149 100644 --- a/builtin/v10/eam/cbor_gen.go +++ b/builtin/v10/eam/cbor_gen.go @@ -34,7 +34,7 @@ func (t *CreateParams) MarshalCBOR(w io.Writer) error { } // t.Initcode ([]uint8) (slice) - if len(t.Initcode) > cbg.ByteArrayMaxLen { + if uint64(len(t.Initcode)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.Initcode was too long") } @@ -143,7 +143,7 @@ func (t *CreateReturn) MarshalCBOR(w io.Writer) error { } // t.EthAddress ([20]uint8) (array) - if len(t.EthAddress) > cbg.ByteArrayMaxLen { + if uint64(len(t.EthAddress)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.EthAddress was too long") } @@ -252,7 +252,7 @@ func (t *Create2Params) MarshalCBOR(w io.Writer) error { } // t.Initcode ([]uint8) (slice) - if len(t.Initcode) > cbg.ByteArrayMaxLen { + if uint64(len(t.Initcode)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.Initcode was too long") } @@ -265,7 +265,7 @@ func (t *Create2Params) MarshalCBOR(w io.Writer) error { } // t.Salt ([32]uint8) (array) - if len(t.Salt) > cbg.ByteArrayMaxLen { + if uint64(len(t.Salt)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.Salt was too long") } @@ -374,7 +374,7 @@ func (t *Create2Return) MarshalCBOR(w io.Writer) error { } // t.EthAddress ([20]uint8) (array) - if len(t.EthAddress) > cbg.ByteArrayMaxLen { + if uint64(len(t.EthAddress)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.EthAddress was too long") } @@ -494,7 +494,7 @@ func (t *CreateExternalReturn) MarshalCBOR(w io.Writer) error { } // t.EthAddress ([20]uint8) (array) - if len(t.EthAddress) > cbg.ByteArrayMaxLen { + if uint64(len(t.EthAddress)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.EthAddress was too long") } diff --git a/builtin/v10/evm/cbor_gen.go b/builtin/v10/evm/cbor_gen.go index f0b0a7b8..dffac8ac 100644 --- a/builtin/v10/evm/cbor_gen.go +++ b/builtin/v10/evm/cbor_gen.go @@ -123,7 +123,7 @@ func (t *State) MarshalCBOR(w io.Writer) error { } // t.BytecodeHash ([32]uint8) (array) - if len(t.BytecodeHash) > cbg.ByteArrayMaxLen { + if uint64(len(t.BytecodeHash)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.BytecodeHash was too long") } @@ -273,7 +273,7 @@ func (t *ConstructorParams) MarshalCBOR(w io.Writer) error { } // t.Creator ([20]uint8) (array) - if len(t.Creator) > cbg.ByteArrayMaxLen { + if uint64(len(t.Creator)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.Creator was too long") } @@ -286,7 +286,7 @@ func (t *ConstructorParams) MarshalCBOR(w io.Writer) error { } // t.Initcode ([]uint8) (slice) - if len(t.Initcode) > cbg.ByteArrayMaxLen { + if uint64(len(t.Initcode)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.Initcode was too long") } @@ -385,7 +385,7 @@ func (t *GetStorageAtParams) MarshalCBOR(w io.Writer) error { } // t.StorageKey ([32]uint8) (array) - if len(t.StorageKey) > cbg.ByteArrayMaxLen { + if uint64(len(t.StorageKey)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.StorageKey was too long") } @@ -467,7 +467,7 @@ func (t *DelegateCallParams) MarshalCBOR(w io.Writer) error { } // t.Input ([]uint8) (slice) - if len(t.Input) > cbg.ByteArrayMaxLen { + if uint64(len(t.Input)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.Input was too long") } @@ -480,7 +480,7 @@ func (t *DelegateCallParams) MarshalCBOR(w io.Writer) error { } // t.Caller ([20]uint8) (array) - if len(t.Caller) > cbg.ByteArrayMaxLen { + if uint64(len(t.Caller)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.Caller was too long") } diff --git a/builtin/v10/init/cbor_gen.go b/builtin/v10/init/cbor_gen.go index 161f445f..e648e48a 100644 --- a/builtin/v10/init/cbor_gen.go +++ b/builtin/v10/init/cbor_gen.go @@ -46,7 +46,7 @@ func (t *State) MarshalCBOR(w io.Writer) error { } // t.NetworkName (string) (string) - if len(t.NetworkName) > cbg.MaxLength { + if uint64(len(t.NetworkName)) > cbg.MaxLength { return xerrors.Errorf("Value in field t.NetworkName was too long") } @@ -136,7 +136,7 @@ func (t *ConstructorParams) MarshalCBOR(w io.Writer) error { } // t.NetworkName (string) (string) - if len(t.NetworkName) > cbg.MaxLength { + if uint64(len(t.NetworkName)) > cbg.MaxLength { return xerrors.Errorf("Value in field t.NetworkName was too long") } @@ -206,7 +206,7 @@ func (t *ExecParams) MarshalCBOR(w io.Writer) error { } // t.ConstructorParams ([]uint8) (slice) - if len(t.ConstructorParams) > cbg.ByteArrayMaxLen { + if uint64(len(t.ConstructorParams)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.ConstructorParams was too long") } @@ -372,7 +372,7 @@ func (t *Exec4Params) MarshalCBOR(w io.Writer) error { } // t.ConstructorParams ([]uint8) (slice) - if len(t.ConstructorParams) > cbg.ByteArrayMaxLen { + if uint64(len(t.ConstructorParams)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.ConstructorParams was too long") } @@ -385,7 +385,7 @@ func (t *Exec4Params) MarshalCBOR(w io.Writer) error { } // t.SubAddress ([]uint8) (slice) - if len(t.SubAddress) > cbg.ByteArrayMaxLen { + if uint64(len(t.SubAddress)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.SubAddress was too long") } diff --git a/builtin/v10/market/cbor_gen.go b/builtin/v10/market/cbor_gen.go index 88062076..10542ba0 100644 --- a/builtin/v10/market/cbor_gen.go +++ b/builtin/v10/market/cbor_gen.go @@ -543,7 +543,7 @@ func (t *PublishStorageDealsParams) MarshalCBOR(w io.Writer) error { } // t.Deals ([]market.ClientDealProposal) (slice) - if len(t.Deals) > cbg.MaxLength { + if uint64(len(t.Deals)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Deals was too long") } @@ -638,7 +638,7 @@ func (t *PublishStorageDealsReturn) MarshalCBOR(w io.Writer) error { } // t.IDs ([]abi.DealID) (slice) - if len(t.IDs) > cbg.MaxLength { + if uint64(len(t.IDs)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.IDs was too long") } @@ -753,7 +753,7 @@ func (t *ActivateDealsParams) MarshalCBOR(w io.Writer) error { } // t.DealIDs ([]abi.DealID) (slice) - if len(t.DealIDs) > cbg.MaxLength { + if uint64(len(t.DealIDs)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.DealIDs was too long") } @@ -778,6 +778,7 @@ func (t *ActivateDealsParams) MarshalCBOR(w io.Writer) error { return err } } + return nil } @@ -895,7 +896,7 @@ func (t *ActivateDealsResult) MarshalCBOR(w io.Writer) error { } // t.VerifiedInfos ([]market.VerifiedDealInfo) (slice) - if len(t.VerifiedInfos) > cbg.MaxLength { + if uint64(len(t.VerifiedInfos)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.VerifiedInfos was too long") } @@ -999,7 +1000,7 @@ func (t *VerifyDealsForActivationParams) MarshalCBOR(w io.Writer) error { } // t.Sectors ([]market.SectorDeals) (slice) - if len(t.Sectors) > cbg.MaxLength { + if uint64(len(t.Sectors)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Sectors was too long") } @@ -1094,7 +1095,7 @@ func (t *VerifyDealsForActivationReturn) MarshalCBOR(w io.Writer) error { } // t.Sectors ([]market.SectorDealData) (slice) - if len(t.Sectors) > cbg.MaxLength { + if uint64(len(t.Sectors)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Sectors was too long") } @@ -1189,7 +1190,7 @@ func (t *ComputeDataCommitmentParams) MarshalCBOR(w io.Writer) error { } // t.Inputs ([]*market.SectorDataSpec) (slice) - if len(t.Inputs) > cbg.MaxLength { + if uint64(len(t.Inputs)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Inputs was too long") } @@ -1294,7 +1295,7 @@ func (t *ComputeDataCommitmentReturn) MarshalCBOR(w io.Writer) error { } // t.CommDs ([]typegen.CborCid) (slice) - if len(t.CommDs) > cbg.MaxLength { + if uint64(len(t.CommDs)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.CommDs was too long") } @@ -1560,6 +1561,7 @@ func (t *GetDealTermReturn) MarshalCBOR(w io.Writer) error { return err } } + return nil } @@ -1674,6 +1676,7 @@ func (t *GetDealActivationReturn) MarshalCBOR(w io.Writer) error { return err } } + return nil } @@ -1779,7 +1782,7 @@ func (t *OnMinerSectorsTerminateParams) MarshalCBOR(w io.Writer) error { } // t.DealIDs ([]abi.DealID) (slice) - if len(t.DealIDs) > cbg.MaxLength { + if uint64(len(t.DealIDs)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.DealIDs was too long") } @@ -2255,7 +2258,7 @@ func (t *SectorDeals) MarshalCBOR(w io.Writer) error { } // t.DealIDs ([]abi.DealID) (slice) - if len(t.DealIDs) > cbg.MaxLength { + if uint64(len(t.DealIDs)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.DealIDs was too long") } @@ -2553,7 +2556,7 @@ func (t *SectorDataSpec) MarshalCBOR(w io.Writer) error { } // t.DealIDs ([]abi.DealID) (slice) - if len(t.DealIDs) > cbg.MaxLength { + if uint64(len(t.DealIDs)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.DealIDs was too long") } @@ -2578,6 +2581,7 @@ func (t *SectorDataSpec) MarshalCBOR(w io.Writer) error { return err } } + return nil } diff --git a/builtin/v10/market/deal.go b/builtin/v10/market/deal.go index bdd4a4e5..da4544ad 100644 --- a/builtin/v10/market/deal.go +++ b/builtin/v10/market/deal.go @@ -46,7 +46,7 @@ type DealLabel struct { var EmptyDealLabel = DealLabel{} func NewLabelFromString(s string) (DealLabel, error) { - if len(s) > DealMaxLabelSize { + if uint64(len(s)) > DealMaxLabelSize { return EmptyDealLabel, xerrors.Errorf("provided string is too large to be a label (%d), max length (%d)", len(s), DealMaxLabelSize) } if !utf8.ValidString(s) { @@ -59,7 +59,7 @@ func NewLabelFromString(s string) (DealLabel, error) { } func NewLabelFromBytes(b []byte) (DealLabel, error) { - if len(b) > DealMaxLabelSize { + if uint64(len(b)) > DealMaxLabelSize { return EmptyDealLabel, xerrors.Errorf("provided bytes are too large to be a label (%d), max length (%d)", len(b), DealMaxLabelSize) } @@ -112,7 +112,7 @@ func (label *DealLabel) MarshalCBOR(w io.Writer) error { _, err := io.WriteString(w, string("")) return err } - if len(label.bs) > cbg.ByteArrayMaxLen { + if uint64(len(label.bs)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("label is too long to marshal (%d), max allowed (%d)", len(label.bs), cbg.ByteArrayMaxLen) } diff --git a/builtin/v10/miner/cbor_gen.go b/builtin/v10/miner/cbor_gen.go index cb4b2623..65d891b1 100644 --- a/builtin/v10/miner/cbor_gen.go +++ b/builtin/v10/miner/cbor_gen.go @@ -363,7 +363,7 @@ func (t *MinerInfo) MarshalCBOR(w io.Writer) error { } // t.ControlAddresses ([]address.Address) (slice) - if len(t.ControlAddresses) > cbg.MaxLength { + if uint64(len(t.ControlAddresses)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.ControlAddresses was too long") } @@ -383,7 +383,7 @@ func (t *MinerInfo) MarshalCBOR(w io.Writer) error { } // t.PeerId ([]uint8) (slice) - if len(t.PeerId) > cbg.ByteArrayMaxLen { + if uint64(len(t.PeerId)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.PeerId was too long") } @@ -396,7 +396,7 @@ func (t *MinerInfo) MarshalCBOR(w io.Writer) error { } // t.Multiaddrs ([][]uint8) (slice) - if len(t.Multiaddrs) > cbg.MaxLength { + if uint64(len(t.Multiaddrs)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Multiaddrs was too long") } @@ -404,7 +404,7 @@ func (t *MinerInfo) MarshalCBOR(w io.Writer) error { return err } for _, v := range t.Multiaddrs { - if len(v) > cbg.ByteArrayMaxLen { + if uint64(len(v)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field v was too long") } @@ -796,7 +796,7 @@ func (t *Deadlines) MarshalCBOR(w io.Writer) error { } // t.Due ([48]cid.Cid) (array) - if len(t.Due) > cbg.MaxLength { + if uint64(len(t.Due)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Due was too long") } @@ -1533,6 +1533,7 @@ func (t *SectorPreCommitOnChainInfo) MarshalCBOR(w io.Writer) error { return err } } + return nil } @@ -1654,7 +1655,7 @@ func (t *SectorPreCommitInfo) MarshalCBOR(w io.Writer) error { } // t.DealIDs ([]abi.DealID) (slice) - if len(t.DealIDs) > cbg.MaxLength { + if uint64(len(t.DealIDs)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.DealIDs was too long") } @@ -1925,7 +1926,7 @@ func (t *SectorOnChainInfo) MarshalCBOR(w io.Writer) error { } // t.DealIDs ([]abi.DealID) (slice) - if len(t.DealIDs) > cbg.MaxLength { + if uint64(len(t.DealIDs)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.DealIDs was too long") } @@ -2339,6 +2340,7 @@ func (t *WorkerKeyChange) MarshalCBOR(w io.Writer) error { return err } } + return nil } @@ -2417,7 +2419,7 @@ func (t *VestingFunds) MarshalCBOR(w io.Writer) error { } // t.Funds ([]miner.VestingFund) (slice) - if len(t.Funds) > cbg.MaxLength { + if uint64(len(t.Funds)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Funds was too long") } @@ -2609,7 +2611,7 @@ func (t *WindowedPoSt) MarshalCBOR(w io.Writer) error { } // t.Proofs ([]proof.PoStProof) (slice) - if len(t.Proofs) > cbg.MaxLength { + if uint64(len(t.Proofs)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Proofs was too long") } @@ -2802,6 +2804,7 @@ func (t *BeneficiaryTerm) MarshalCBOR(w io.Writer) error { return err } } + return nil } @@ -3049,7 +3052,7 @@ func (t *GetControlAddressesReturn) MarshalCBOR(w io.Writer) error { } // t.ControlAddrs ([]address.Address) (slice) - if len(t.ControlAddrs) > cbg.MaxLength { + if uint64(len(t.ControlAddrs)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.ControlAddrs was too long") } @@ -3167,7 +3170,7 @@ func (t *ChangeWorkerAddressParams) MarshalCBOR(w io.Writer) error { } // t.NewControlAddrs ([]address.Address) (slice) - if len(t.NewControlAddrs) > cbg.MaxLength { + if uint64(len(t.NewControlAddrs)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.NewControlAddrs was too long") } @@ -3271,7 +3274,7 @@ func (t *ChangePeerIDParams) MarshalCBOR(w io.Writer) error { } // t.NewID ([]uint8) (slice) - if len(t.NewID) > cbg.ByteArrayMaxLen { + if uint64(len(t.NewID)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.NewID was too long") } @@ -3355,7 +3358,7 @@ func (t *SubmitWindowedPoStParams) MarshalCBOR(w io.Writer) error { } // t.Partitions ([]miner.PoStPartition) (slice) - if len(t.Partitions) > cbg.MaxLength { + if uint64(len(t.Partitions)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Partitions was too long") } @@ -3370,7 +3373,7 @@ func (t *SubmitWindowedPoStParams) MarshalCBOR(w io.Writer) error { } // t.Proofs ([]proof.PoStProof) (slice) - if len(t.Proofs) > cbg.MaxLength { + if uint64(len(t.Proofs)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Proofs was too long") } @@ -3396,7 +3399,7 @@ func (t *SubmitWindowedPoStParams) MarshalCBOR(w io.Writer) error { } // t.ChainCommitRand (abi.Randomness) (slice) - if len(t.ChainCommitRand) > cbg.ByteArrayMaxLen { + if uint64(len(t.ChainCommitRand)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.ChainCommitRand was too long") } @@ -3623,7 +3626,7 @@ func (t *PreCommitSectorParams) MarshalCBOR(w io.Writer) error { } // t.DealIDs ([]abi.DealID) (slice) - if len(t.DealIDs) > cbg.MaxLength { + if uint64(len(t.DealIDs)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.DealIDs was too long") } @@ -3925,7 +3928,7 @@ func (t *ProveCommitSectorParams) MarshalCBOR(w io.Writer) error { } // t.Proof ([]uint8) (slice) - if len(t.Proof) > cbg.ByteArrayMaxLen { + if uint64(len(t.Proof)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.Proof was too long") } @@ -4017,7 +4020,7 @@ func (t *ExtendSectorExpirationParams) MarshalCBOR(w io.Writer) error { } // t.Extensions ([]miner.ExpirationExtension) (slice) - if len(t.Extensions) > cbg.MaxLength { + if uint64(len(t.Extensions)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Extensions was too long") } @@ -4112,7 +4115,7 @@ func (t *ExtendSectorExpiration2Params) MarshalCBOR(w io.Writer) error { } // t.Extensions ([]miner.ExpirationExtension2) (slice) - if len(t.Extensions) > cbg.MaxLength { + if uint64(len(t.Extensions)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Extensions was too long") } @@ -4207,7 +4210,7 @@ func (t *TerminateSectorsParams) MarshalCBOR(w io.Writer) error { } // t.Terminations ([]miner.TerminationDeclaration) (slice) - if len(t.Terminations) > cbg.MaxLength { + if uint64(len(t.Terminations)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Terminations was too long") } @@ -4366,7 +4369,7 @@ func (t *DeclareFaultsParams) MarshalCBOR(w io.Writer) error { } // t.Faults ([]miner.FaultDeclaration) (slice) - if len(t.Faults) > cbg.MaxLength { + if uint64(len(t.Faults)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Faults was too long") } @@ -4461,7 +4464,7 @@ func (t *DeclareFaultsRecoveredParams) MarshalCBOR(w io.Writer) error { } // t.Recoveries ([]miner.RecoveryDeclaration) (slice) - if len(t.Recoveries) > cbg.MaxLength { + if uint64(len(t.Recoveries)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Recoveries was too long") } @@ -4556,7 +4559,7 @@ func (t *DeferredCronEventParams) MarshalCBOR(w io.Writer) error { } // t.EventPayload ([]uint8) (slice) - if len(t.EventPayload) > cbg.ByteArrayMaxLen { + if uint64(len(t.EventPayload)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.EventPayload was too long") } @@ -4794,7 +4797,7 @@ func (t *ReportConsensusFaultParams) MarshalCBOR(w io.Writer) error { } // t.BlockHeader1 ([]uint8) (slice) - if len(t.BlockHeader1) > cbg.ByteArrayMaxLen { + if uint64(len(t.BlockHeader1)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.BlockHeader1 was too long") } @@ -4807,7 +4810,7 @@ func (t *ReportConsensusFaultParams) MarshalCBOR(w io.Writer) error { } // t.BlockHeader2 ([]uint8) (slice) - if len(t.BlockHeader2) > cbg.ByteArrayMaxLen { + if uint64(len(t.BlockHeader2)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.BlockHeader2 was too long") } @@ -4820,7 +4823,7 @@ func (t *ReportConsensusFaultParams) MarshalCBOR(w io.Writer) error { } // t.BlockHeaderExtra ([]uint8) (slice) - if len(t.BlockHeaderExtra) > cbg.ByteArrayMaxLen { + if uint64(len(t.BlockHeaderExtra)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.BlockHeaderExtra was too long") } @@ -4998,7 +5001,7 @@ func (t *ConfirmSectorProofsParams) MarshalCBOR(w io.Writer) error { } // t.Sectors ([]abi.SectorNumber) (slice) - if len(t.Sectors) > cbg.MaxLength { + if uint64(len(t.Sectors)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Sectors was too long") } @@ -5141,7 +5144,7 @@ func (t *ChangeMultiaddrsParams) MarshalCBOR(w io.Writer) error { } // t.NewMultiaddrs ([][]uint8) (slice) - if len(t.NewMultiaddrs) > cbg.MaxLength { + if uint64(len(t.NewMultiaddrs)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.NewMultiaddrs was too long") } @@ -5149,7 +5152,7 @@ func (t *ChangeMultiaddrsParams) MarshalCBOR(w io.Writer) error { return err } for _, v := range t.NewMultiaddrs { - if len(v) > cbg.ByteArrayMaxLen { + if uint64(len(v)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field v was too long") } @@ -5471,7 +5474,7 @@ func (t *PreCommitSectorBatchParams) MarshalCBOR(w io.Writer) error { } // t.Sectors ([]miner.PreCommitSectorParams) (slice) - if len(t.Sectors) > cbg.MaxLength { + if uint64(len(t.Sectors)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Sectors was too long") } @@ -5571,7 +5574,7 @@ func (t *ProveCommitAggregateParams) MarshalCBOR(w io.Writer) error { } // t.AggregateProof ([]uint8) (slice) - if len(t.AggregateProof) > cbg.ByteArrayMaxLen { + if uint64(len(t.AggregateProof)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.AggregateProof was too long") } @@ -5658,7 +5661,7 @@ func (t *ProveReplicaUpdatesParams) MarshalCBOR(w io.Writer) error { } // t.Updates ([]miner.ReplicaUpdate) (slice) - if len(t.Updates) > cbg.MaxLength { + if uint64(len(t.Updates)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Updates was too long") } @@ -5762,6 +5765,7 @@ func (t *CronEventPayload) MarshalCBOR(w io.Writer) error { return err } } + return nil } @@ -5831,7 +5835,7 @@ func (t *PreCommitSectorBatchParams2) MarshalCBOR(w io.Writer) error { } // t.Sectors ([]miner.SectorPreCommitInfo) (slice) - if len(t.Sectors) > cbg.MaxLength { + if uint64(len(t.Sectors)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Sectors was too long") } @@ -5926,7 +5930,7 @@ func (t *ProveReplicaUpdatesParams2) MarshalCBOR(w io.Writer) error { } // t.Updates ([]miner.ReplicaUpdate2) (slice) - if len(t.Updates) > cbg.MaxLength { + if uint64(len(t.Updates)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Updates was too long") } @@ -6040,6 +6044,7 @@ func (t *ChangeBeneficiaryParams) MarshalCBOR(w io.Writer) error { return err } } + return nil } @@ -6287,7 +6292,7 @@ func (t *GetPeerIDReturn) MarshalCBOR(w io.Writer) error { } // t.PeerId ([]uint8) (slice) - if len(t.PeerId) > cbg.ByteArrayMaxLen { + if uint64(len(t.PeerId)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.PeerId was too long") } @@ -6365,7 +6370,7 @@ func (t *GetMultiAddrsReturn) MarshalCBOR(w io.Writer) error { } // t.MultiAddrs ([]uint8) (slice) - if len(t.MultiAddrs) > cbg.ByteArrayMaxLen { + if uint64(len(t.MultiAddrs)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.MultiAddrs was too long") } @@ -6661,6 +6666,7 @@ func (t *ExpirationExtension) MarshalCBOR(w io.Writer) error { return err } } + return nil } @@ -6963,7 +6969,7 @@ func (t *ReplicaUpdate) MarshalCBOR(w io.Writer) error { } // t.Deals ([]abi.DealID) (slice) - if len(t.Deals) > cbg.MaxLength { + if uint64(len(t.Deals)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Deals was too long") } @@ -6990,7 +6996,7 @@ func (t *ReplicaUpdate) MarshalCBOR(w io.Writer) error { } // t.ReplicaProof ([]uint8) (slice) - if len(t.ReplicaProof) > cbg.ByteArrayMaxLen { + if uint64(len(t.ReplicaProof)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.ReplicaProof was too long") } @@ -7220,7 +7226,7 @@ func (t *ReplicaUpdate2) MarshalCBOR(w io.Writer) error { } // t.Deals ([]abi.DealID) (slice) - if len(t.Deals) > cbg.MaxLength { + if uint64(len(t.Deals)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Deals was too long") } @@ -7247,7 +7253,7 @@ func (t *ReplicaUpdate2) MarshalCBOR(w io.Writer) error { } // t.ReplicaProof ([]uint8) (slice) - if len(t.ReplicaProof) > cbg.ByteArrayMaxLen { + if uint64(len(t.ReplicaProof)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.ReplicaProof was too long") } @@ -7476,7 +7482,7 @@ func (t *ExpirationExtension2) MarshalCBOR(w io.Writer) error { } // t.SectorsWithClaims ([]miner.SectorClaim) (slice) - if len(t.SectorsWithClaims) > cbg.MaxLength { + if uint64(len(t.SectorsWithClaims)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.SectorsWithClaims was too long") } @@ -7500,6 +7506,7 @@ func (t *ExpirationExtension2) MarshalCBOR(w io.Writer) error { return err } } + return nil } @@ -7650,7 +7657,7 @@ func (t *SectorClaim) MarshalCBOR(w io.Writer) error { } // t.MaintainClaims ([]verifreg.ClaimId) (slice) - if len(t.MaintainClaims) > cbg.MaxLength { + if uint64(len(t.MaintainClaims)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.MaintainClaims was too long") } @@ -7666,7 +7673,7 @@ func (t *SectorClaim) MarshalCBOR(w io.Writer) error { } // t.DropClaims ([]verifreg.ClaimId) (slice) - if len(t.DropClaims) > cbg.MaxLength { + if uint64(len(t.DropClaims)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.DropClaims was too long") } diff --git a/builtin/v10/multisig/cbor_gen.go b/builtin/v10/multisig/cbor_gen.go index c5b4f9d9..c28dfdf4 100644 --- a/builtin/v10/multisig/cbor_gen.go +++ b/builtin/v10/multisig/cbor_gen.go @@ -36,7 +36,7 @@ func (t *State) MarshalCBOR(w io.Writer) error { } // t.Signers ([]address.Address) (slice) - if len(t.Signers) > cbg.MaxLength { + if uint64(len(t.Signers)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Signers was too long") } @@ -308,7 +308,7 @@ func (t *Transaction) MarshalCBOR(w io.Writer) error { } // t.Params ([]uint8) (slice) - if len(t.Params) > cbg.ByteArrayMaxLen { + if uint64(len(t.Params)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.Params was too long") } @@ -321,7 +321,7 @@ func (t *Transaction) MarshalCBOR(w io.Writer) error { } // t.Approved ([]address.Address) (slice) - if len(t.Approved) > cbg.MaxLength { + if uint64(len(t.Approved)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Approved was too long") } @@ -491,7 +491,7 @@ func (t *ProposalHashData) MarshalCBOR(w io.Writer) error { } // t.Params ([]uint8) (slice) - if len(t.Params) > cbg.ByteArrayMaxLen { + if uint64(len(t.Params)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.Params was too long") } @@ -610,7 +610,7 @@ func (t *ConstructorParams) MarshalCBOR(w io.Writer) error { } // t.Signers ([]address.Address) (slice) - if len(t.Signers) > cbg.MaxLength { + if uint64(len(t.Signers)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Signers was too long") } @@ -651,6 +651,7 @@ func (t *ConstructorParams) MarshalCBOR(w io.Writer) error { return err } } + return nil } @@ -813,7 +814,7 @@ func (t *ProposeParams) MarshalCBOR(w io.Writer) error { } // t.Params ([]uint8) (slice) - if len(t.Params) > cbg.ByteArrayMaxLen { + if uint64(len(t.Params)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.Params was too long") } @@ -950,7 +951,7 @@ func (t *ProposeReturn) MarshalCBOR(w io.Writer) error { } // t.Ret ([]uint8) (slice) - if len(t.Ret) > cbg.ByteArrayMaxLen { + if uint64(len(t.Ret)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.Ret was too long") } @@ -1262,7 +1263,7 @@ func (t *TxnIDParams) MarshalCBOR(w io.Writer) error { } // t.ProposalHash ([]uint8) (slice) - if len(t.ProposalHash) > cbg.ByteArrayMaxLen { + if uint64(len(t.ProposalHash)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.ProposalHash was too long") } @@ -1381,7 +1382,7 @@ func (t *ApproveReturn) MarshalCBOR(w io.Writer) error { } // t.Ret ([]uint8) (slice) - if len(t.Ret) > cbg.ByteArrayMaxLen { + if uint64(len(t.Ret)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.Ret was too long") } diff --git a/builtin/v10/paych/cbor_gen.go b/builtin/v10/paych/cbor_gen.go index f53c5e62..b4e06f44 100644 --- a/builtin/v10/paych/cbor_gen.go +++ b/builtin/v10/paych/cbor_gen.go @@ -362,7 +362,7 @@ func (t *UpdateChannelStateParams) MarshalCBOR(w io.Writer) error { } // t.Secret ([]uint8) (slice) - if len(t.Secret) > cbg.ByteArrayMaxLen { + if uint64(len(t.Secret)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.Secret was too long") } @@ -476,7 +476,7 @@ func (t *SignedVoucher) MarshalCBOR(w io.Writer) error { } // t.SecretHash ([]uint8) (slice) - if len(t.SecretHash) > cbg.ByteArrayMaxLen { + if uint64(len(t.SecretHash)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.SecretHash was too long") } @@ -522,7 +522,7 @@ func (t *SignedVoucher) MarshalCBOR(w io.Writer) error { } // t.Merges ([]paych.Merge) (slice) - if len(t.Merges) > cbg.MaxLength { + if uint64(len(t.Merges)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Merges was too long") } @@ -814,7 +814,7 @@ func (t *ModVerifyParams) MarshalCBOR(w io.Writer) error { } // t.Data ([]uint8) (slice) - if len(t.Data) > cbg.ByteArrayMaxLen { + if uint64(len(t.Data)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.Data was too long") } diff --git a/builtin/v10/power/cbor_gen.go b/builtin/v10/power/cbor_gen.go index 883b0b4c..827e4263 100644 --- a/builtin/v10/power/cbor_gen.go +++ b/builtin/v10/power/cbor_gen.go @@ -568,7 +568,7 @@ func (t *MinerConstructorParams) MarshalCBOR(w io.Writer) error { } // t.ControlAddrs ([]address.Address) (slice) - if len(t.ControlAddrs) > cbg.MaxLength { + if uint64(len(t.ControlAddrs)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.ControlAddrs was too long") } @@ -594,7 +594,7 @@ func (t *MinerConstructorParams) MarshalCBOR(w io.Writer) error { } // t.PeerId ([]uint8) (slice) - if len(t.PeerId) > cbg.ByteArrayMaxLen { + if uint64(len(t.PeerId)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.PeerId was too long") } @@ -607,7 +607,7 @@ func (t *MinerConstructorParams) MarshalCBOR(w io.Writer) error { } // t.Multiaddrs ([][]uint8) (slice) - if len(t.Multiaddrs) > cbg.MaxLength { + if uint64(len(t.Multiaddrs)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Multiaddrs was too long") } @@ -615,7 +615,7 @@ func (t *MinerConstructorParams) MarshalCBOR(w io.Writer) error { return err } for _, v := range t.Multiaddrs { - if len(v) > cbg.ByteArrayMaxLen { + if uint64(len(v)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field v was too long") } @@ -846,7 +846,7 @@ func (t *CreateMinerParams) MarshalCBOR(w io.Writer) error { } // t.Peer ([]uint8) (slice) - if len(t.Peer) > cbg.ByteArrayMaxLen { + if uint64(len(t.Peer)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.Peer was too long") } @@ -859,7 +859,7 @@ func (t *CreateMinerParams) MarshalCBOR(w io.Writer) error { } // t.Multiaddrs ([][]uint8) (slice) - if len(t.Multiaddrs) > cbg.MaxLength { + if uint64(len(t.Multiaddrs)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Multiaddrs was too long") } @@ -867,7 +867,7 @@ func (t *CreateMinerParams) MarshalCBOR(w io.Writer) error { return err } for _, v := range t.Multiaddrs { - if len(v) > cbg.ByteArrayMaxLen { + if uint64(len(v)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field v was too long") } @@ -1218,7 +1218,7 @@ func (t *EnrollCronEventParams) MarshalCBOR(w io.Writer) error { } // t.Payload ([]uint8) (slice) - if len(t.Payload) > cbg.ByteArrayMaxLen { + if uint64(len(t.Payload)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.Payload was too long") } @@ -1404,7 +1404,7 @@ func (t *CronEvent) MarshalCBOR(w io.Writer) error { } // t.CallbackPayload ([]uint8) (slice) - if len(t.CallbackPayload) > cbg.ByteArrayMaxLen { + if uint64(len(t.CallbackPayload)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.CallbackPayload was too long") } diff --git a/builtin/v10/reward/cbor_gen.go b/builtin/v10/reward/cbor_gen.go index d3365367..ec29a320 100644 --- a/builtin/v10/reward/cbor_gen.go +++ b/builtin/v10/reward/cbor_gen.go @@ -368,6 +368,7 @@ func (t *AwardBlockRewardParams) MarshalCBOR(w io.Writer) error { return err } } + return nil } diff --git a/builtin/v10/verifreg/cbor_gen.go b/builtin/v10/verifreg/cbor_gen.go index 230e422b..e16c254b 100644 --- a/builtin/v10/verifreg/cbor_gen.go +++ b/builtin/v10/verifreg/cbor_gen.go @@ -638,7 +638,7 @@ func (t *RemoveExpiredAllocationsParams) MarshalCBOR(w io.Writer) error { } // t.AllocationIds ([]verifreg.AllocationId) (slice) - if len(t.AllocationIds) > cbg.MaxLength { + if uint64(len(t.AllocationIds)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.AllocationIds was too long") } @@ -753,7 +753,7 @@ func (t *RemoveExpiredAllocationsReturn) MarshalCBOR(w io.Writer) error { } // t.Considered ([]verifreg.AllocationId) (slice) - if len(t.Considered) > cbg.MaxLength { + if uint64(len(t.Considered)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Considered was too long") } @@ -888,7 +888,7 @@ func (t *BatchReturn) MarshalCBOR(w io.Writer) error { } // t.FailCodes ([]verifreg.FailCode) (slice) - if len(t.FailCodes) > cbg.MaxLength { + if uint64(len(t.FailCodes)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.FailCodes was too long") } @@ -997,7 +997,7 @@ func (t *ClaimAllocationsParams) MarshalCBOR(w io.Writer) error { } // t.Sectors ([]verifreg.SectorAllocationClaim) (slice) - if len(t.Sectors) > cbg.MaxLength { + if uint64(len(t.Sectors)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Sectors was too long") } @@ -1190,7 +1190,7 @@ func (t *GetClaimsParams) MarshalCBOR(w io.Writer) error { } // t.ClaimIds ([]verifreg.ClaimId) (slice) - if len(t.ClaimIds) > cbg.MaxLength { + if uint64(len(t.ClaimIds)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.ClaimIds was too long") } @@ -1310,7 +1310,7 @@ func (t *GetClaimsReturn) MarshalCBOR(w io.Writer) error { } // t.Claims ([]verifreg.Claim) (slice) - if len(t.Claims) > cbg.MaxLength { + if uint64(len(t.Claims)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Claims was too long") } @@ -1420,7 +1420,7 @@ func (t *UniversalReceiverParams) MarshalCBOR(w io.Writer) error { } // t.Payload ([]uint8) (slice) - if len(t.Payload) > cbg.ByteArrayMaxLen { + if uint64(len(t.Payload)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.Payload was too long") } @@ -1522,7 +1522,7 @@ func (t *AllocationsResponse) MarshalCBOR(w io.Writer) error { } // t.NewAllocations ([]verifreg.AllocationId) (slice) - if len(t.NewAllocations) > cbg.MaxLength { + if uint64(len(t.NewAllocations)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.NewAllocations was too long") } @@ -1641,7 +1641,7 @@ func (t *ExtendClaimTermsParams) MarshalCBOR(w io.Writer) error { } // t.Terms ([]verifreg.ClaimTerm) (slice) - if len(t.Terms) > cbg.MaxLength { + if uint64(len(t.Terms)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Terms was too long") } @@ -1742,7 +1742,7 @@ func (t *ExtendClaimTermsReturn) MarshalCBOR(w io.Writer) error { } // t.FailCodes ([]verifreg.FailCode) (slice) - if len(t.FailCodes) > cbg.MaxLength { + if uint64(len(t.FailCodes)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.FailCodes was too long") } @@ -1857,7 +1857,7 @@ func (t *RemoveExpiredClaimsParams) MarshalCBOR(w io.Writer) error { } // t.ClaimIds ([]verifreg.ClaimId) (slice) - if len(t.ClaimIds) > cbg.MaxLength { + if uint64(len(t.ClaimIds)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.ClaimIds was too long") } @@ -1972,7 +1972,7 @@ func (t *RemoveExpiredClaimsReturn) MarshalCBOR(w io.Writer) error { } // t.Considered ([]verifreg.AllocationId) (slice) - if len(t.Considered) > cbg.MaxLength { + if uint64(len(t.Considered)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Considered was too long") } @@ -2319,6 +2319,7 @@ func (t *FailCode) MarshalCBOR(w io.Writer) error { return err } } + return nil } @@ -2441,6 +2442,7 @@ func (t *SectorAllocationClaim) MarshalCBOR(w io.Writer) error { return err } } + return nil } @@ -2848,6 +2850,7 @@ func (t *ClaimTerm) MarshalCBOR(w io.Writer) error { return err } } + return nil } @@ -2965,6 +2968,7 @@ func (t *ClaimExtensionRequest) MarshalCBOR(w io.Writer) error { return err } } + return nil } @@ -3112,6 +3116,7 @@ func (t *Allocation) MarshalCBOR(w io.Writer) error { return err } } + return nil } @@ -3334,6 +3339,7 @@ func (t *AllocationRequest) MarshalCBOR(w io.Writer) error { return err } } + return nil } @@ -3493,7 +3499,7 @@ func (t *AllocationRequests) MarshalCBOR(w io.Writer) error { } // t.Allocations ([]verifreg.AllocationRequest) (slice) - if len(t.Allocations) > cbg.MaxLength { + if uint64(len(t.Allocations)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Allocations was too long") } @@ -3508,7 +3514,7 @@ func (t *AllocationRequests) MarshalCBOR(w io.Writer) error { } // t.Extensions ([]verifreg.ClaimExtensionRequest) (slice) - if len(t.Extensions) > cbg.MaxLength { + if uint64(len(t.Extensions)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Extensions was too long") } diff --git a/builtin/v11/account/cbor_gen.go b/builtin/v11/account/cbor_gen.go index 4a49915b..0bd09be2 100644 --- a/builtin/v11/account/cbor_gen.go +++ b/builtin/v11/account/cbor_gen.go @@ -89,7 +89,7 @@ func (t *AuthenticateMessageParams) MarshalCBOR(w io.Writer) error { } // t.Signature ([]uint8) (slice) - if len(t.Signature) > cbg.ByteArrayMaxLen { + if uint64(len(t.Signature)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.Signature was too long") } @@ -102,7 +102,7 @@ func (t *AuthenticateMessageParams) MarshalCBOR(w io.Writer) error { } // t.Message ([]uint8) (slice) - if len(t.Message) > cbg.ByteArrayMaxLen { + if uint64(len(t.Message)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.Message was too long") } diff --git a/builtin/v11/cron/cbor_gen.go b/builtin/v11/cron/cbor_gen.go index 013f8f58..73deb41d 100644 --- a/builtin/v11/cron/cbor_gen.go +++ b/builtin/v11/cron/cbor_gen.go @@ -34,7 +34,7 @@ func (t *State) MarshalCBOR(w io.Writer) error { } // t.Entries ([]cron.Entry) (slice) - if len(t.Entries) > cbg.MaxLength { + if uint64(len(t.Entries)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Entries was too long") } diff --git a/builtin/v11/datacap/cbor_gen.go b/builtin/v11/datacap/cbor_gen.go index 4f61008b..42c936a6 100644 --- a/builtin/v11/datacap/cbor_gen.go +++ b/builtin/v11/datacap/cbor_gen.go @@ -227,7 +227,7 @@ func (t *MintParams) MarshalCBOR(w io.Writer) error { } // t.Operators ([]address.Address) (slice) - if len(t.Operators) > cbg.MaxLength { + if uint64(len(t.Operators)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Operators was too long") } @@ -350,7 +350,7 @@ func (t *MintReturn) MarshalCBOR(w io.Writer) error { } // t.RecipientData ([]uint8) (slice) - if len(t.RecipientData) > cbg.ByteArrayMaxLen { + if uint64(len(t.RecipientData)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.RecipientData was too long") } @@ -526,7 +526,7 @@ func (t *TransferParams) MarshalCBOR(w io.Writer) error { } // t.OperatorData ([]uint8) (slice) - if len(t.OperatorData) > cbg.ByteArrayMaxLen { + if uint64(len(t.OperatorData)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.OperatorData was too long") } @@ -632,7 +632,7 @@ func (t *TransferReturn) MarshalCBOR(w io.Writer) error { } // t.RecipientData ([]uint8) (slice) - if len(t.RecipientData) > cbg.ByteArrayMaxLen { + if uint64(len(t.RecipientData)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.RecipientData was too long") } @@ -743,7 +743,7 @@ func (t *TransferFromParams) MarshalCBOR(w io.Writer) error { } // t.OperatorData ([]uint8) (slice) - if len(t.OperatorData) > cbg.ByteArrayMaxLen { + if uint64(len(t.OperatorData)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.OperatorData was too long") } @@ -863,7 +863,7 @@ func (t *TransferFromReturn) MarshalCBOR(w io.Writer) error { } // t.RecipientData ([]uint8) (slice) - if len(t.RecipientData) > cbg.ByteArrayMaxLen { + if uint64(len(t.RecipientData)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.RecipientData was too long") } diff --git a/builtin/v11/eam/cbor_gen.go b/builtin/v11/eam/cbor_gen.go index 368a14e0..ef731149 100644 --- a/builtin/v11/eam/cbor_gen.go +++ b/builtin/v11/eam/cbor_gen.go @@ -34,7 +34,7 @@ func (t *CreateParams) MarshalCBOR(w io.Writer) error { } // t.Initcode ([]uint8) (slice) - if len(t.Initcode) > cbg.ByteArrayMaxLen { + if uint64(len(t.Initcode)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.Initcode was too long") } @@ -143,7 +143,7 @@ func (t *CreateReturn) MarshalCBOR(w io.Writer) error { } // t.EthAddress ([20]uint8) (array) - if len(t.EthAddress) > cbg.ByteArrayMaxLen { + if uint64(len(t.EthAddress)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.EthAddress was too long") } @@ -252,7 +252,7 @@ func (t *Create2Params) MarshalCBOR(w io.Writer) error { } // t.Initcode ([]uint8) (slice) - if len(t.Initcode) > cbg.ByteArrayMaxLen { + if uint64(len(t.Initcode)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.Initcode was too long") } @@ -265,7 +265,7 @@ func (t *Create2Params) MarshalCBOR(w io.Writer) error { } // t.Salt ([32]uint8) (array) - if len(t.Salt) > cbg.ByteArrayMaxLen { + if uint64(len(t.Salt)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.Salt was too long") } @@ -374,7 +374,7 @@ func (t *Create2Return) MarshalCBOR(w io.Writer) error { } // t.EthAddress ([20]uint8) (array) - if len(t.EthAddress) > cbg.ByteArrayMaxLen { + if uint64(len(t.EthAddress)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.EthAddress was too long") } @@ -494,7 +494,7 @@ func (t *CreateExternalReturn) MarshalCBOR(w io.Writer) error { } // t.EthAddress ([20]uint8) (array) - if len(t.EthAddress) > cbg.ByteArrayMaxLen { + if uint64(len(t.EthAddress)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.EthAddress was too long") } diff --git a/builtin/v11/evm/cbor_gen.go b/builtin/v11/evm/cbor_gen.go index f0b0a7b8..dffac8ac 100644 --- a/builtin/v11/evm/cbor_gen.go +++ b/builtin/v11/evm/cbor_gen.go @@ -123,7 +123,7 @@ func (t *State) MarshalCBOR(w io.Writer) error { } // t.BytecodeHash ([32]uint8) (array) - if len(t.BytecodeHash) > cbg.ByteArrayMaxLen { + if uint64(len(t.BytecodeHash)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.BytecodeHash was too long") } @@ -273,7 +273,7 @@ func (t *ConstructorParams) MarshalCBOR(w io.Writer) error { } // t.Creator ([20]uint8) (array) - if len(t.Creator) > cbg.ByteArrayMaxLen { + if uint64(len(t.Creator)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.Creator was too long") } @@ -286,7 +286,7 @@ func (t *ConstructorParams) MarshalCBOR(w io.Writer) error { } // t.Initcode ([]uint8) (slice) - if len(t.Initcode) > cbg.ByteArrayMaxLen { + if uint64(len(t.Initcode)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.Initcode was too long") } @@ -385,7 +385,7 @@ func (t *GetStorageAtParams) MarshalCBOR(w io.Writer) error { } // t.StorageKey ([32]uint8) (array) - if len(t.StorageKey) > cbg.ByteArrayMaxLen { + if uint64(len(t.StorageKey)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.StorageKey was too long") } @@ -467,7 +467,7 @@ func (t *DelegateCallParams) MarshalCBOR(w io.Writer) error { } // t.Input ([]uint8) (slice) - if len(t.Input) > cbg.ByteArrayMaxLen { + if uint64(len(t.Input)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.Input was too long") } @@ -480,7 +480,7 @@ func (t *DelegateCallParams) MarshalCBOR(w io.Writer) error { } // t.Caller ([20]uint8) (array) - if len(t.Caller) > cbg.ByteArrayMaxLen { + if uint64(len(t.Caller)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.Caller was too long") } diff --git a/builtin/v11/init/cbor_gen.go b/builtin/v11/init/cbor_gen.go index 161f445f..e648e48a 100644 --- a/builtin/v11/init/cbor_gen.go +++ b/builtin/v11/init/cbor_gen.go @@ -46,7 +46,7 @@ func (t *State) MarshalCBOR(w io.Writer) error { } // t.NetworkName (string) (string) - if len(t.NetworkName) > cbg.MaxLength { + if uint64(len(t.NetworkName)) > cbg.MaxLength { return xerrors.Errorf("Value in field t.NetworkName was too long") } @@ -136,7 +136,7 @@ func (t *ConstructorParams) MarshalCBOR(w io.Writer) error { } // t.NetworkName (string) (string) - if len(t.NetworkName) > cbg.MaxLength { + if uint64(len(t.NetworkName)) > cbg.MaxLength { return xerrors.Errorf("Value in field t.NetworkName was too long") } @@ -206,7 +206,7 @@ func (t *ExecParams) MarshalCBOR(w io.Writer) error { } // t.ConstructorParams ([]uint8) (slice) - if len(t.ConstructorParams) > cbg.ByteArrayMaxLen { + if uint64(len(t.ConstructorParams)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.ConstructorParams was too long") } @@ -372,7 +372,7 @@ func (t *Exec4Params) MarshalCBOR(w io.Writer) error { } // t.ConstructorParams ([]uint8) (slice) - if len(t.ConstructorParams) > cbg.ByteArrayMaxLen { + if uint64(len(t.ConstructorParams)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.ConstructorParams was too long") } @@ -385,7 +385,7 @@ func (t *Exec4Params) MarshalCBOR(w io.Writer) error { } // t.SubAddress ([]uint8) (slice) - if len(t.SubAddress) > cbg.ByteArrayMaxLen { + if uint64(len(t.SubAddress)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.SubAddress was too long") } diff --git a/builtin/v11/market/cbor_gen.go b/builtin/v11/market/cbor_gen.go index e06ffc83..28c99082 100644 --- a/builtin/v11/market/cbor_gen.go +++ b/builtin/v11/market/cbor_gen.go @@ -543,7 +543,7 @@ func (t *PublishStorageDealsParams) MarshalCBOR(w io.Writer) error { } // t.Deals ([]market.ClientDealProposal) (slice) - if len(t.Deals) > cbg.MaxLength { + if uint64(len(t.Deals)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Deals was too long") } @@ -638,7 +638,7 @@ func (t *PublishStorageDealsReturn) MarshalCBOR(w io.Writer) error { } // t.IDs ([]abi.DealID) (slice) - if len(t.IDs) > cbg.MaxLength { + if uint64(len(t.IDs)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.IDs was too long") } @@ -753,7 +753,7 @@ func (t *ActivateDealsParams) MarshalCBOR(w io.Writer) error { } // t.DealIDs ([]abi.DealID) (slice) - if len(t.DealIDs) > cbg.MaxLength { + if uint64(len(t.DealIDs)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.DealIDs was too long") } @@ -778,6 +778,7 @@ func (t *ActivateDealsParams) MarshalCBOR(w io.Writer) error { return err } } + return nil } @@ -895,7 +896,7 @@ func (t *ActivateDealsResult) MarshalCBOR(w io.Writer) error { } // t.VerifiedInfos ([]market.VerifiedDealInfo) (slice) - if len(t.VerifiedInfos) > cbg.MaxLength { + if uint64(len(t.VerifiedInfos)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.VerifiedInfos was too long") } @@ -999,7 +1000,7 @@ func (t *VerifyDealsForActivationParams) MarshalCBOR(w io.Writer) error { } // t.Sectors ([]market.SectorDeals) (slice) - if len(t.Sectors) > cbg.MaxLength { + if uint64(len(t.Sectors)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Sectors was too long") } @@ -1094,7 +1095,7 @@ func (t *VerifyDealsForActivationReturn) MarshalCBOR(w io.Writer) error { } // t.Sectors ([]market.SectorDealData) (slice) - if len(t.Sectors) > cbg.MaxLength { + if uint64(len(t.Sectors)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Sectors was too long") } @@ -1189,7 +1190,7 @@ func (t *ComputeDataCommitmentParams) MarshalCBOR(w io.Writer) error { } // t.Inputs ([]*market.SectorDataSpec) (slice) - if len(t.Inputs) > cbg.MaxLength { + if uint64(len(t.Inputs)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Inputs was too long") } @@ -1294,7 +1295,7 @@ func (t *ComputeDataCommitmentReturn) MarshalCBOR(w io.Writer) error { } // t.CommDs ([]typegen.CborCid) (slice) - if len(t.CommDs) > cbg.MaxLength { + if uint64(len(t.CommDs)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.CommDs was too long") } @@ -1560,6 +1561,7 @@ func (t *GetDealTermReturn) MarshalCBOR(w io.Writer) error { return err } } + return nil } @@ -1674,6 +1676,7 @@ func (t *GetDealActivationReturn) MarshalCBOR(w io.Writer) error { return err } } + return nil } @@ -1779,7 +1782,7 @@ func (t *OnMinerSectorsTerminateParams) MarshalCBOR(w io.Writer) error { } // t.DealIDs ([]abi.DealID) (slice) - if len(t.DealIDs) > cbg.MaxLength { + if uint64(len(t.DealIDs)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.DealIDs was too long") } @@ -2255,7 +2258,7 @@ func (t *SectorDeals) MarshalCBOR(w io.Writer) error { } // t.DealIDs ([]abi.DealID) (slice) - if len(t.DealIDs) > cbg.MaxLength { + if uint64(len(t.DealIDs)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.DealIDs was too long") } @@ -2553,7 +2556,7 @@ func (t *SectorDataSpec) MarshalCBOR(w io.Writer) error { } // t.DealIDs ([]abi.DealID) (slice) - if len(t.DealIDs) > cbg.MaxLength { + if uint64(len(t.DealIDs)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.DealIDs was too long") } @@ -2578,6 +2581,7 @@ func (t *SectorDataSpec) MarshalCBOR(w io.Writer) error { return err } } + return nil } diff --git a/builtin/v11/market/deal.go b/builtin/v11/market/deal.go index 382c2219..2114ef9b 100644 --- a/builtin/v11/market/deal.go +++ b/builtin/v11/market/deal.go @@ -46,7 +46,7 @@ type DealLabel struct { var EmptyDealLabel = DealLabel{} func NewLabelFromString(s string) (DealLabel, error) { - if len(s) > DealMaxLabelSize { + if uint64(len(s)) > DealMaxLabelSize { return EmptyDealLabel, xerrors.Errorf("provided string is too large to be a label (%d), max length (%d)", len(s), DealMaxLabelSize) } if !utf8.ValidString(s) { @@ -59,7 +59,7 @@ func NewLabelFromString(s string) (DealLabel, error) { } func NewLabelFromBytes(b []byte) (DealLabel, error) { - if len(b) > DealMaxLabelSize { + if uint64(len(b)) > DealMaxLabelSize { return EmptyDealLabel, xerrors.Errorf("provided bytes are too large to be a label (%d), max length (%d)", len(b), DealMaxLabelSize) } @@ -112,7 +112,7 @@ func (label *DealLabel) MarshalCBOR(w io.Writer) error { _, err := io.WriteString(w, string("")) return err } - if len(label.bs) > cbg.ByteArrayMaxLen { + if uint64(len(label.bs)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("label is too long to marshal (%d), max allowed (%d)", len(label.bs), cbg.ByteArrayMaxLen) } diff --git a/builtin/v11/miner/cbor_gen.go b/builtin/v11/miner/cbor_gen.go index ed2fe006..b550b50a 100644 --- a/builtin/v11/miner/cbor_gen.go +++ b/builtin/v11/miner/cbor_gen.go @@ -363,7 +363,7 @@ func (t *MinerInfo) MarshalCBOR(w io.Writer) error { } // t.ControlAddresses ([]address.Address) (slice) - if len(t.ControlAddresses) > cbg.MaxLength { + if uint64(len(t.ControlAddresses)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.ControlAddresses was too long") } @@ -383,7 +383,7 @@ func (t *MinerInfo) MarshalCBOR(w io.Writer) error { } // t.PeerId ([]uint8) (slice) - if len(t.PeerId) > cbg.ByteArrayMaxLen { + if uint64(len(t.PeerId)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.PeerId was too long") } @@ -396,7 +396,7 @@ func (t *MinerInfo) MarshalCBOR(w io.Writer) error { } // t.Multiaddrs ([][]uint8) (slice) - if len(t.Multiaddrs) > cbg.MaxLength { + if uint64(len(t.Multiaddrs)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Multiaddrs was too long") } @@ -404,7 +404,7 @@ func (t *MinerInfo) MarshalCBOR(w io.Writer) error { return err } for _, v := range t.Multiaddrs { - if len(v) > cbg.ByteArrayMaxLen { + if uint64(len(v)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field v was too long") } @@ -796,7 +796,7 @@ func (t *Deadlines) MarshalCBOR(w io.Writer) error { } // t.Due ([48]cid.Cid) (array) - if len(t.Due) > cbg.MaxLength { + if uint64(len(t.Due)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Due was too long") } @@ -1533,6 +1533,7 @@ func (t *SectorPreCommitOnChainInfo) MarshalCBOR(w io.Writer) error { return err } } + return nil } @@ -1654,7 +1655,7 @@ func (t *SectorPreCommitInfo) MarshalCBOR(w io.Writer) error { } // t.DealIDs ([]abi.DealID) (slice) - if len(t.DealIDs) > cbg.MaxLength { + if uint64(len(t.DealIDs)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.DealIDs was too long") } @@ -1925,7 +1926,7 @@ func (t *SectorOnChainInfo) MarshalCBOR(w io.Writer) error { } // t.DealIDs ([]abi.DealID) (slice) - if len(t.DealIDs) > cbg.MaxLength { + if uint64(len(t.DealIDs)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.DealIDs was too long") } @@ -2339,6 +2340,7 @@ func (t *WorkerKeyChange) MarshalCBOR(w io.Writer) error { return err } } + return nil } @@ -2417,7 +2419,7 @@ func (t *VestingFunds) MarshalCBOR(w io.Writer) error { } // t.Funds ([]miner.VestingFund) (slice) - if len(t.Funds) > cbg.MaxLength { + if uint64(len(t.Funds)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Funds was too long") } @@ -2609,7 +2611,7 @@ func (t *WindowedPoSt) MarshalCBOR(w io.Writer) error { } // t.Proofs ([]proof.PoStProof) (slice) - if len(t.Proofs) > cbg.MaxLength { + if uint64(len(t.Proofs)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Proofs was too long") } @@ -2802,6 +2804,7 @@ func (t *BeneficiaryTerm) MarshalCBOR(w io.Writer) error { return err } } + return nil } @@ -3049,7 +3052,7 @@ func (t *GetControlAddressesReturn) MarshalCBOR(w io.Writer) error { } // t.ControlAddrs ([]address.Address) (slice) - if len(t.ControlAddrs) > cbg.MaxLength { + if uint64(len(t.ControlAddrs)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.ControlAddrs was too long") } @@ -3167,7 +3170,7 @@ func (t *ChangeWorkerAddressParams) MarshalCBOR(w io.Writer) error { } // t.NewControlAddrs ([]address.Address) (slice) - if len(t.NewControlAddrs) > cbg.MaxLength { + if uint64(len(t.NewControlAddrs)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.NewControlAddrs was too long") } @@ -3271,7 +3274,7 @@ func (t *ChangePeerIDParams) MarshalCBOR(w io.Writer) error { } // t.NewID ([]uint8) (slice) - if len(t.NewID) > cbg.ByteArrayMaxLen { + if uint64(len(t.NewID)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.NewID was too long") } @@ -3355,7 +3358,7 @@ func (t *SubmitWindowedPoStParams) MarshalCBOR(w io.Writer) error { } // t.Partitions ([]miner.PoStPartition) (slice) - if len(t.Partitions) > cbg.MaxLength { + if uint64(len(t.Partitions)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Partitions was too long") } @@ -3370,7 +3373,7 @@ func (t *SubmitWindowedPoStParams) MarshalCBOR(w io.Writer) error { } // t.Proofs ([]proof.PoStProof) (slice) - if len(t.Proofs) > cbg.MaxLength { + if uint64(len(t.Proofs)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Proofs was too long") } @@ -3396,7 +3399,7 @@ func (t *SubmitWindowedPoStParams) MarshalCBOR(w io.Writer) error { } // t.ChainCommitRand (abi.Randomness) (slice) - if len(t.ChainCommitRand) > cbg.ByteArrayMaxLen { + if uint64(len(t.ChainCommitRand)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.ChainCommitRand was too long") } @@ -3623,7 +3626,7 @@ func (t *PreCommitSectorParams) MarshalCBOR(w io.Writer) error { } // t.DealIDs ([]abi.DealID) (slice) - if len(t.DealIDs) > cbg.MaxLength { + if uint64(len(t.DealIDs)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.DealIDs was too long") } @@ -3925,7 +3928,7 @@ func (t *ProveCommitSectorParams) MarshalCBOR(w io.Writer) error { } // t.Proof ([]uint8) (slice) - if len(t.Proof) > cbg.ByteArrayMaxLen { + if uint64(len(t.Proof)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.Proof was too long") } @@ -4017,7 +4020,7 @@ func (t *ExtendSectorExpirationParams) MarshalCBOR(w io.Writer) error { } // t.Extensions ([]miner.ExpirationExtension) (slice) - if len(t.Extensions) > cbg.MaxLength { + if uint64(len(t.Extensions)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Extensions was too long") } @@ -4112,7 +4115,7 @@ func (t *ExtendSectorExpiration2Params) MarshalCBOR(w io.Writer) error { } // t.Extensions ([]miner.ExpirationExtension2) (slice) - if len(t.Extensions) > cbg.MaxLength { + if uint64(len(t.Extensions)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Extensions was too long") } @@ -4207,7 +4210,7 @@ func (t *TerminateSectorsParams) MarshalCBOR(w io.Writer) error { } // t.Terminations ([]miner.TerminationDeclaration) (slice) - if len(t.Terminations) > cbg.MaxLength { + if uint64(len(t.Terminations)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Terminations was too long") } @@ -4366,7 +4369,7 @@ func (t *DeclareFaultsParams) MarshalCBOR(w io.Writer) error { } // t.Faults ([]miner.FaultDeclaration) (slice) - if len(t.Faults) > cbg.MaxLength { + if uint64(len(t.Faults)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Faults was too long") } @@ -4461,7 +4464,7 @@ func (t *DeclareFaultsRecoveredParams) MarshalCBOR(w io.Writer) error { } // t.Recoveries ([]miner.RecoveryDeclaration) (slice) - if len(t.Recoveries) > cbg.MaxLength { + if uint64(len(t.Recoveries)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Recoveries was too long") } @@ -4556,7 +4559,7 @@ func (t *DeferredCronEventParams) MarshalCBOR(w io.Writer) error { } // t.EventPayload ([]uint8) (slice) - if len(t.EventPayload) > cbg.ByteArrayMaxLen { + if uint64(len(t.EventPayload)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.EventPayload was too long") } @@ -4794,7 +4797,7 @@ func (t *ReportConsensusFaultParams) MarshalCBOR(w io.Writer) error { } // t.BlockHeader1 ([]uint8) (slice) - if len(t.BlockHeader1) > cbg.ByteArrayMaxLen { + if uint64(len(t.BlockHeader1)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.BlockHeader1 was too long") } @@ -4807,7 +4810,7 @@ func (t *ReportConsensusFaultParams) MarshalCBOR(w io.Writer) error { } // t.BlockHeader2 ([]uint8) (slice) - if len(t.BlockHeader2) > cbg.ByteArrayMaxLen { + if uint64(len(t.BlockHeader2)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.BlockHeader2 was too long") } @@ -4820,7 +4823,7 @@ func (t *ReportConsensusFaultParams) MarshalCBOR(w io.Writer) error { } // t.BlockHeaderExtra ([]uint8) (slice) - if len(t.BlockHeaderExtra) > cbg.ByteArrayMaxLen { + if uint64(len(t.BlockHeaderExtra)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.BlockHeaderExtra was too long") } @@ -4998,7 +5001,7 @@ func (t *ConfirmSectorProofsParams) MarshalCBOR(w io.Writer) error { } // t.Sectors ([]abi.SectorNumber) (slice) - if len(t.Sectors) > cbg.MaxLength { + if uint64(len(t.Sectors)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Sectors was too long") } @@ -5141,7 +5144,7 @@ func (t *ChangeMultiaddrsParams) MarshalCBOR(w io.Writer) error { } // t.NewMultiaddrs ([][]uint8) (slice) - if len(t.NewMultiaddrs) > cbg.MaxLength { + if uint64(len(t.NewMultiaddrs)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.NewMultiaddrs was too long") } @@ -5149,7 +5152,7 @@ func (t *ChangeMultiaddrsParams) MarshalCBOR(w io.Writer) error { return err } for _, v := range t.NewMultiaddrs { - if len(v) > cbg.ByteArrayMaxLen { + if uint64(len(v)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field v was too long") } @@ -5471,7 +5474,7 @@ func (t *PreCommitSectorBatchParams) MarshalCBOR(w io.Writer) error { } // t.Sectors ([]miner.PreCommitSectorParams) (slice) - if len(t.Sectors) > cbg.MaxLength { + if uint64(len(t.Sectors)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Sectors was too long") } @@ -5571,7 +5574,7 @@ func (t *ProveCommitAggregateParams) MarshalCBOR(w io.Writer) error { } // t.AggregateProof ([]uint8) (slice) - if len(t.AggregateProof) > cbg.ByteArrayMaxLen { + if uint64(len(t.AggregateProof)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.AggregateProof was too long") } @@ -5658,7 +5661,7 @@ func (t *ProveReplicaUpdatesParams) MarshalCBOR(w io.Writer) error { } // t.Updates ([]miner.ReplicaUpdate) (slice) - if len(t.Updates) > cbg.MaxLength { + if uint64(len(t.Updates)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Updates was too long") } @@ -5762,6 +5765,7 @@ func (t *CronEventPayload) MarshalCBOR(w io.Writer) error { return err } } + return nil } @@ -5831,7 +5835,7 @@ func (t *PreCommitSectorBatchParams2) MarshalCBOR(w io.Writer) error { } // t.Sectors ([]miner.SectorPreCommitInfo) (slice) - if len(t.Sectors) > cbg.MaxLength { + if uint64(len(t.Sectors)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Sectors was too long") } @@ -5926,7 +5930,7 @@ func (t *ProveReplicaUpdatesParams2) MarshalCBOR(w io.Writer) error { } // t.Updates ([]miner.ReplicaUpdate2) (slice) - if len(t.Updates) > cbg.MaxLength { + if uint64(len(t.Updates)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Updates was too long") } @@ -6040,6 +6044,7 @@ func (t *ChangeBeneficiaryParams) MarshalCBOR(w io.Writer) error { return err } } + return nil } @@ -6287,7 +6292,7 @@ func (t *GetPeerIDReturn) MarshalCBOR(w io.Writer) error { } // t.PeerId ([]uint8) (slice) - if len(t.PeerId) > cbg.ByteArrayMaxLen { + if uint64(len(t.PeerId)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.PeerId was too long") } @@ -6365,7 +6370,7 @@ func (t *GetMultiAddrsReturn) MarshalCBOR(w io.Writer) error { } // t.MultiAddrs ([]uint8) (slice) - if len(t.MultiAddrs) > cbg.ByteArrayMaxLen { + if uint64(len(t.MultiAddrs)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.MultiAddrs was too long") } @@ -6661,6 +6666,7 @@ func (t *ExpirationExtension) MarshalCBOR(w io.Writer) error { return err } } + return nil } @@ -6963,7 +6969,7 @@ func (t *ReplicaUpdate) MarshalCBOR(w io.Writer) error { } // t.Deals ([]abi.DealID) (slice) - if len(t.Deals) > cbg.MaxLength { + if uint64(len(t.Deals)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Deals was too long") } @@ -6990,7 +6996,7 @@ func (t *ReplicaUpdate) MarshalCBOR(w io.Writer) error { } // t.ReplicaProof ([]uint8) (slice) - if len(t.ReplicaProof) > cbg.ByteArrayMaxLen { + if uint64(len(t.ReplicaProof)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.ReplicaProof was too long") } @@ -7220,7 +7226,7 @@ func (t *ReplicaUpdate2) MarshalCBOR(w io.Writer) error { } // t.Deals ([]abi.DealID) (slice) - if len(t.Deals) > cbg.MaxLength { + if uint64(len(t.Deals)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Deals was too long") } @@ -7247,7 +7253,7 @@ func (t *ReplicaUpdate2) MarshalCBOR(w io.Writer) error { } // t.ReplicaProof ([]uint8) (slice) - if len(t.ReplicaProof) > cbg.ByteArrayMaxLen { + if uint64(len(t.ReplicaProof)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.ReplicaProof was too long") } @@ -7476,7 +7482,7 @@ func (t *ExpirationExtension2) MarshalCBOR(w io.Writer) error { } // t.SectorsWithClaims ([]miner.SectorClaim) (slice) - if len(t.SectorsWithClaims) > cbg.MaxLength { + if uint64(len(t.SectorsWithClaims)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.SectorsWithClaims was too long") } @@ -7500,6 +7506,7 @@ func (t *ExpirationExtension2) MarshalCBOR(w io.Writer) error { return err } } + return nil } @@ -7650,7 +7657,7 @@ func (t *SectorClaim) MarshalCBOR(w io.Writer) error { } // t.MaintainClaims ([]verifreg.ClaimId) (slice) - if len(t.MaintainClaims) > cbg.MaxLength { + if uint64(len(t.MaintainClaims)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.MaintainClaims was too long") } @@ -7666,7 +7673,7 @@ func (t *SectorClaim) MarshalCBOR(w io.Writer) error { } // t.DropClaims ([]verifreg.ClaimId) (slice) - if len(t.DropClaims) > cbg.MaxLength { + if uint64(len(t.DropClaims)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.DropClaims was too long") } diff --git a/builtin/v11/multisig/cbor_gen.go b/builtin/v11/multisig/cbor_gen.go index c5b4f9d9..c28dfdf4 100644 --- a/builtin/v11/multisig/cbor_gen.go +++ b/builtin/v11/multisig/cbor_gen.go @@ -36,7 +36,7 @@ func (t *State) MarshalCBOR(w io.Writer) error { } // t.Signers ([]address.Address) (slice) - if len(t.Signers) > cbg.MaxLength { + if uint64(len(t.Signers)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Signers was too long") } @@ -308,7 +308,7 @@ func (t *Transaction) MarshalCBOR(w io.Writer) error { } // t.Params ([]uint8) (slice) - if len(t.Params) > cbg.ByteArrayMaxLen { + if uint64(len(t.Params)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.Params was too long") } @@ -321,7 +321,7 @@ func (t *Transaction) MarshalCBOR(w io.Writer) error { } // t.Approved ([]address.Address) (slice) - if len(t.Approved) > cbg.MaxLength { + if uint64(len(t.Approved)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Approved was too long") } @@ -491,7 +491,7 @@ func (t *ProposalHashData) MarshalCBOR(w io.Writer) error { } // t.Params ([]uint8) (slice) - if len(t.Params) > cbg.ByteArrayMaxLen { + if uint64(len(t.Params)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.Params was too long") } @@ -610,7 +610,7 @@ func (t *ConstructorParams) MarshalCBOR(w io.Writer) error { } // t.Signers ([]address.Address) (slice) - if len(t.Signers) > cbg.MaxLength { + if uint64(len(t.Signers)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Signers was too long") } @@ -651,6 +651,7 @@ func (t *ConstructorParams) MarshalCBOR(w io.Writer) error { return err } } + return nil } @@ -813,7 +814,7 @@ func (t *ProposeParams) MarshalCBOR(w io.Writer) error { } // t.Params ([]uint8) (slice) - if len(t.Params) > cbg.ByteArrayMaxLen { + if uint64(len(t.Params)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.Params was too long") } @@ -950,7 +951,7 @@ func (t *ProposeReturn) MarshalCBOR(w io.Writer) error { } // t.Ret ([]uint8) (slice) - if len(t.Ret) > cbg.ByteArrayMaxLen { + if uint64(len(t.Ret)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.Ret was too long") } @@ -1262,7 +1263,7 @@ func (t *TxnIDParams) MarshalCBOR(w io.Writer) error { } // t.ProposalHash ([]uint8) (slice) - if len(t.ProposalHash) > cbg.ByteArrayMaxLen { + if uint64(len(t.ProposalHash)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.ProposalHash was too long") } @@ -1381,7 +1382,7 @@ func (t *ApproveReturn) MarshalCBOR(w io.Writer) error { } // t.Ret ([]uint8) (slice) - if len(t.Ret) > cbg.ByteArrayMaxLen { + if uint64(len(t.Ret)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.Ret was too long") } diff --git a/builtin/v11/paych/cbor_gen.go b/builtin/v11/paych/cbor_gen.go index f53c5e62..b4e06f44 100644 --- a/builtin/v11/paych/cbor_gen.go +++ b/builtin/v11/paych/cbor_gen.go @@ -362,7 +362,7 @@ func (t *UpdateChannelStateParams) MarshalCBOR(w io.Writer) error { } // t.Secret ([]uint8) (slice) - if len(t.Secret) > cbg.ByteArrayMaxLen { + if uint64(len(t.Secret)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.Secret was too long") } @@ -476,7 +476,7 @@ func (t *SignedVoucher) MarshalCBOR(w io.Writer) error { } // t.SecretHash ([]uint8) (slice) - if len(t.SecretHash) > cbg.ByteArrayMaxLen { + if uint64(len(t.SecretHash)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.SecretHash was too long") } @@ -522,7 +522,7 @@ func (t *SignedVoucher) MarshalCBOR(w io.Writer) error { } // t.Merges ([]paych.Merge) (slice) - if len(t.Merges) > cbg.MaxLength { + if uint64(len(t.Merges)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Merges was too long") } @@ -814,7 +814,7 @@ func (t *ModVerifyParams) MarshalCBOR(w io.Writer) error { } // t.Data ([]uint8) (slice) - if len(t.Data) > cbg.ByteArrayMaxLen { + if uint64(len(t.Data)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.Data was too long") } diff --git a/builtin/v11/power/cbor_gen.go b/builtin/v11/power/cbor_gen.go index 883b0b4c..827e4263 100644 --- a/builtin/v11/power/cbor_gen.go +++ b/builtin/v11/power/cbor_gen.go @@ -568,7 +568,7 @@ func (t *MinerConstructorParams) MarshalCBOR(w io.Writer) error { } // t.ControlAddrs ([]address.Address) (slice) - if len(t.ControlAddrs) > cbg.MaxLength { + if uint64(len(t.ControlAddrs)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.ControlAddrs was too long") } @@ -594,7 +594,7 @@ func (t *MinerConstructorParams) MarshalCBOR(w io.Writer) error { } // t.PeerId ([]uint8) (slice) - if len(t.PeerId) > cbg.ByteArrayMaxLen { + if uint64(len(t.PeerId)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.PeerId was too long") } @@ -607,7 +607,7 @@ func (t *MinerConstructorParams) MarshalCBOR(w io.Writer) error { } // t.Multiaddrs ([][]uint8) (slice) - if len(t.Multiaddrs) > cbg.MaxLength { + if uint64(len(t.Multiaddrs)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Multiaddrs was too long") } @@ -615,7 +615,7 @@ func (t *MinerConstructorParams) MarshalCBOR(w io.Writer) error { return err } for _, v := range t.Multiaddrs { - if len(v) > cbg.ByteArrayMaxLen { + if uint64(len(v)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field v was too long") } @@ -846,7 +846,7 @@ func (t *CreateMinerParams) MarshalCBOR(w io.Writer) error { } // t.Peer ([]uint8) (slice) - if len(t.Peer) > cbg.ByteArrayMaxLen { + if uint64(len(t.Peer)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.Peer was too long") } @@ -859,7 +859,7 @@ func (t *CreateMinerParams) MarshalCBOR(w io.Writer) error { } // t.Multiaddrs ([][]uint8) (slice) - if len(t.Multiaddrs) > cbg.MaxLength { + if uint64(len(t.Multiaddrs)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Multiaddrs was too long") } @@ -867,7 +867,7 @@ func (t *CreateMinerParams) MarshalCBOR(w io.Writer) error { return err } for _, v := range t.Multiaddrs { - if len(v) > cbg.ByteArrayMaxLen { + if uint64(len(v)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field v was too long") } @@ -1218,7 +1218,7 @@ func (t *EnrollCronEventParams) MarshalCBOR(w io.Writer) error { } // t.Payload ([]uint8) (slice) - if len(t.Payload) > cbg.ByteArrayMaxLen { + if uint64(len(t.Payload)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.Payload was too long") } @@ -1404,7 +1404,7 @@ func (t *CronEvent) MarshalCBOR(w io.Writer) error { } // t.CallbackPayload ([]uint8) (slice) - if len(t.CallbackPayload) > cbg.ByteArrayMaxLen { + if uint64(len(t.CallbackPayload)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.CallbackPayload was too long") } diff --git a/builtin/v11/reward/cbor_gen.go b/builtin/v11/reward/cbor_gen.go index d3365367..ec29a320 100644 --- a/builtin/v11/reward/cbor_gen.go +++ b/builtin/v11/reward/cbor_gen.go @@ -368,6 +368,7 @@ func (t *AwardBlockRewardParams) MarshalCBOR(w io.Writer) error { return err } } + return nil } diff --git a/builtin/v11/verifreg/cbor_gen.go b/builtin/v11/verifreg/cbor_gen.go index 230e422b..e16c254b 100644 --- a/builtin/v11/verifreg/cbor_gen.go +++ b/builtin/v11/verifreg/cbor_gen.go @@ -638,7 +638,7 @@ func (t *RemoveExpiredAllocationsParams) MarshalCBOR(w io.Writer) error { } // t.AllocationIds ([]verifreg.AllocationId) (slice) - if len(t.AllocationIds) > cbg.MaxLength { + if uint64(len(t.AllocationIds)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.AllocationIds was too long") } @@ -753,7 +753,7 @@ func (t *RemoveExpiredAllocationsReturn) MarshalCBOR(w io.Writer) error { } // t.Considered ([]verifreg.AllocationId) (slice) - if len(t.Considered) > cbg.MaxLength { + if uint64(len(t.Considered)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Considered was too long") } @@ -888,7 +888,7 @@ func (t *BatchReturn) MarshalCBOR(w io.Writer) error { } // t.FailCodes ([]verifreg.FailCode) (slice) - if len(t.FailCodes) > cbg.MaxLength { + if uint64(len(t.FailCodes)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.FailCodes was too long") } @@ -997,7 +997,7 @@ func (t *ClaimAllocationsParams) MarshalCBOR(w io.Writer) error { } // t.Sectors ([]verifreg.SectorAllocationClaim) (slice) - if len(t.Sectors) > cbg.MaxLength { + if uint64(len(t.Sectors)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Sectors was too long") } @@ -1190,7 +1190,7 @@ func (t *GetClaimsParams) MarshalCBOR(w io.Writer) error { } // t.ClaimIds ([]verifreg.ClaimId) (slice) - if len(t.ClaimIds) > cbg.MaxLength { + if uint64(len(t.ClaimIds)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.ClaimIds was too long") } @@ -1310,7 +1310,7 @@ func (t *GetClaimsReturn) MarshalCBOR(w io.Writer) error { } // t.Claims ([]verifreg.Claim) (slice) - if len(t.Claims) > cbg.MaxLength { + if uint64(len(t.Claims)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Claims was too long") } @@ -1420,7 +1420,7 @@ func (t *UniversalReceiverParams) MarshalCBOR(w io.Writer) error { } // t.Payload ([]uint8) (slice) - if len(t.Payload) > cbg.ByteArrayMaxLen { + if uint64(len(t.Payload)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.Payload was too long") } @@ -1522,7 +1522,7 @@ func (t *AllocationsResponse) MarshalCBOR(w io.Writer) error { } // t.NewAllocations ([]verifreg.AllocationId) (slice) - if len(t.NewAllocations) > cbg.MaxLength { + if uint64(len(t.NewAllocations)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.NewAllocations was too long") } @@ -1641,7 +1641,7 @@ func (t *ExtendClaimTermsParams) MarshalCBOR(w io.Writer) error { } // t.Terms ([]verifreg.ClaimTerm) (slice) - if len(t.Terms) > cbg.MaxLength { + if uint64(len(t.Terms)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Terms was too long") } @@ -1742,7 +1742,7 @@ func (t *ExtendClaimTermsReturn) MarshalCBOR(w io.Writer) error { } // t.FailCodes ([]verifreg.FailCode) (slice) - if len(t.FailCodes) > cbg.MaxLength { + if uint64(len(t.FailCodes)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.FailCodes was too long") } @@ -1857,7 +1857,7 @@ func (t *RemoveExpiredClaimsParams) MarshalCBOR(w io.Writer) error { } // t.ClaimIds ([]verifreg.ClaimId) (slice) - if len(t.ClaimIds) > cbg.MaxLength { + if uint64(len(t.ClaimIds)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.ClaimIds was too long") } @@ -1972,7 +1972,7 @@ func (t *RemoveExpiredClaimsReturn) MarshalCBOR(w io.Writer) error { } // t.Considered ([]verifreg.AllocationId) (slice) - if len(t.Considered) > cbg.MaxLength { + if uint64(len(t.Considered)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Considered was too long") } @@ -2319,6 +2319,7 @@ func (t *FailCode) MarshalCBOR(w io.Writer) error { return err } } + return nil } @@ -2441,6 +2442,7 @@ func (t *SectorAllocationClaim) MarshalCBOR(w io.Writer) error { return err } } + return nil } @@ -2848,6 +2850,7 @@ func (t *ClaimTerm) MarshalCBOR(w io.Writer) error { return err } } + return nil } @@ -2965,6 +2968,7 @@ func (t *ClaimExtensionRequest) MarshalCBOR(w io.Writer) error { return err } } + return nil } @@ -3112,6 +3116,7 @@ func (t *Allocation) MarshalCBOR(w io.Writer) error { return err } } + return nil } @@ -3334,6 +3339,7 @@ func (t *AllocationRequest) MarshalCBOR(w io.Writer) error { return err } } + return nil } @@ -3493,7 +3499,7 @@ func (t *AllocationRequests) MarshalCBOR(w io.Writer) error { } // t.Allocations ([]verifreg.AllocationRequest) (slice) - if len(t.Allocations) > cbg.MaxLength { + if uint64(len(t.Allocations)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Allocations was too long") } @@ -3508,7 +3514,7 @@ func (t *AllocationRequests) MarshalCBOR(w io.Writer) error { } // t.Extensions ([]verifreg.ClaimExtensionRequest) (slice) - if len(t.Extensions) > cbg.MaxLength { + if uint64(len(t.Extensions)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Extensions was too long") } diff --git a/builtin/v12/account/cbor_gen.go b/builtin/v12/account/cbor_gen.go index 4a49915b..0bd09be2 100644 --- a/builtin/v12/account/cbor_gen.go +++ b/builtin/v12/account/cbor_gen.go @@ -89,7 +89,7 @@ func (t *AuthenticateMessageParams) MarshalCBOR(w io.Writer) error { } // t.Signature ([]uint8) (slice) - if len(t.Signature) > cbg.ByteArrayMaxLen { + if uint64(len(t.Signature)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.Signature was too long") } @@ -102,7 +102,7 @@ func (t *AuthenticateMessageParams) MarshalCBOR(w io.Writer) error { } // t.Message ([]uint8) (slice) - if len(t.Message) > cbg.ByteArrayMaxLen { + if uint64(len(t.Message)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.Message was too long") } diff --git a/builtin/v12/cron/cbor_gen.go b/builtin/v12/cron/cbor_gen.go index 013f8f58..73deb41d 100644 --- a/builtin/v12/cron/cbor_gen.go +++ b/builtin/v12/cron/cbor_gen.go @@ -34,7 +34,7 @@ func (t *State) MarshalCBOR(w io.Writer) error { } // t.Entries ([]cron.Entry) (slice) - if len(t.Entries) > cbg.MaxLength { + if uint64(len(t.Entries)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Entries was too long") } diff --git a/builtin/v12/datacap/cbor_gen.go b/builtin/v12/datacap/cbor_gen.go index 4f61008b..42c936a6 100644 --- a/builtin/v12/datacap/cbor_gen.go +++ b/builtin/v12/datacap/cbor_gen.go @@ -227,7 +227,7 @@ func (t *MintParams) MarshalCBOR(w io.Writer) error { } // t.Operators ([]address.Address) (slice) - if len(t.Operators) > cbg.MaxLength { + if uint64(len(t.Operators)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Operators was too long") } @@ -350,7 +350,7 @@ func (t *MintReturn) MarshalCBOR(w io.Writer) error { } // t.RecipientData ([]uint8) (slice) - if len(t.RecipientData) > cbg.ByteArrayMaxLen { + if uint64(len(t.RecipientData)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.RecipientData was too long") } @@ -526,7 +526,7 @@ func (t *TransferParams) MarshalCBOR(w io.Writer) error { } // t.OperatorData ([]uint8) (slice) - if len(t.OperatorData) > cbg.ByteArrayMaxLen { + if uint64(len(t.OperatorData)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.OperatorData was too long") } @@ -632,7 +632,7 @@ func (t *TransferReturn) MarshalCBOR(w io.Writer) error { } // t.RecipientData ([]uint8) (slice) - if len(t.RecipientData) > cbg.ByteArrayMaxLen { + if uint64(len(t.RecipientData)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.RecipientData was too long") } @@ -743,7 +743,7 @@ func (t *TransferFromParams) MarshalCBOR(w io.Writer) error { } // t.OperatorData ([]uint8) (slice) - if len(t.OperatorData) > cbg.ByteArrayMaxLen { + if uint64(len(t.OperatorData)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.OperatorData was too long") } @@ -863,7 +863,7 @@ func (t *TransferFromReturn) MarshalCBOR(w io.Writer) error { } // t.RecipientData ([]uint8) (slice) - if len(t.RecipientData) > cbg.ByteArrayMaxLen { + if uint64(len(t.RecipientData)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.RecipientData was too long") } diff --git a/builtin/v12/eam/cbor_gen.go b/builtin/v12/eam/cbor_gen.go index 368a14e0..ef731149 100644 --- a/builtin/v12/eam/cbor_gen.go +++ b/builtin/v12/eam/cbor_gen.go @@ -34,7 +34,7 @@ func (t *CreateParams) MarshalCBOR(w io.Writer) error { } // t.Initcode ([]uint8) (slice) - if len(t.Initcode) > cbg.ByteArrayMaxLen { + if uint64(len(t.Initcode)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.Initcode was too long") } @@ -143,7 +143,7 @@ func (t *CreateReturn) MarshalCBOR(w io.Writer) error { } // t.EthAddress ([20]uint8) (array) - if len(t.EthAddress) > cbg.ByteArrayMaxLen { + if uint64(len(t.EthAddress)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.EthAddress was too long") } @@ -252,7 +252,7 @@ func (t *Create2Params) MarshalCBOR(w io.Writer) error { } // t.Initcode ([]uint8) (slice) - if len(t.Initcode) > cbg.ByteArrayMaxLen { + if uint64(len(t.Initcode)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.Initcode was too long") } @@ -265,7 +265,7 @@ func (t *Create2Params) MarshalCBOR(w io.Writer) error { } // t.Salt ([32]uint8) (array) - if len(t.Salt) > cbg.ByteArrayMaxLen { + if uint64(len(t.Salt)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.Salt was too long") } @@ -374,7 +374,7 @@ func (t *Create2Return) MarshalCBOR(w io.Writer) error { } // t.EthAddress ([20]uint8) (array) - if len(t.EthAddress) > cbg.ByteArrayMaxLen { + if uint64(len(t.EthAddress)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.EthAddress was too long") } @@ -494,7 +494,7 @@ func (t *CreateExternalReturn) MarshalCBOR(w io.Writer) error { } // t.EthAddress ([20]uint8) (array) - if len(t.EthAddress) > cbg.ByteArrayMaxLen { + if uint64(len(t.EthAddress)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.EthAddress was too long") } diff --git a/builtin/v12/evm/cbor_gen.go b/builtin/v12/evm/cbor_gen.go index f0b0a7b8..dffac8ac 100644 --- a/builtin/v12/evm/cbor_gen.go +++ b/builtin/v12/evm/cbor_gen.go @@ -123,7 +123,7 @@ func (t *State) MarshalCBOR(w io.Writer) error { } // t.BytecodeHash ([32]uint8) (array) - if len(t.BytecodeHash) > cbg.ByteArrayMaxLen { + if uint64(len(t.BytecodeHash)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.BytecodeHash was too long") } @@ -273,7 +273,7 @@ func (t *ConstructorParams) MarshalCBOR(w io.Writer) error { } // t.Creator ([20]uint8) (array) - if len(t.Creator) > cbg.ByteArrayMaxLen { + if uint64(len(t.Creator)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.Creator was too long") } @@ -286,7 +286,7 @@ func (t *ConstructorParams) MarshalCBOR(w io.Writer) error { } // t.Initcode ([]uint8) (slice) - if len(t.Initcode) > cbg.ByteArrayMaxLen { + if uint64(len(t.Initcode)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.Initcode was too long") } @@ -385,7 +385,7 @@ func (t *GetStorageAtParams) MarshalCBOR(w io.Writer) error { } // t.StorageKey ([32]uint8) (array) - if len(t.StorageKey) > cbg.ByteArrayMaxLen { + if uint64(len(t.StorageKey)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.StorageKey was too long") } @@ -467,7 +467,7 @@ func (t *DelegateCallParams) MarshalCBOR(w io.Writer) error { } // t.Input ([]uint8) (slice) - if len(t.Input) > cbg.ByteArrayMaxLen { + if uint64(len(t.Input)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.Input was too long") } @@ -480,7 +480,7 @@ func (t *DelegateCallParams) MarshalCBOR(w io.Writer) error { } // t.Caller ([20]uint8) (array) - if len(t.Caller) > cbg.ByteArrayMaxLen { + if uint64(len(t.Caller)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.Caller was too long") } diff --git a/builtin/v12/init/cbor_gen.go b/builtin/v12/init/cbor_gen.go index 161f445f..e648e48a 100644 --- a/builtin/v12/init/cbor_gen.go +++ b/builtin/v12/init/cbor_gen.go @@ -46,7 +46,7 @@ func (t *State) MarshalCBOR(w io.Writer) error { } // t.NetworkName (string) (string) - if len(t.NetworkName) > cbg.MaxLength { + if uint64(len(t.NetworkName)) > cbg.MaxLength { return xerrors.Errorf("Value in field t.NetworkName was too long") } @@ -136,7 +136,7 @@ func (t *ConstructorParams) MarshalCBOR(w io.Writer) error { } // t.NetworkName (string) (string) - if len(t.NetworkName) > cbg.MaxLength { + if uint64(len(t.NetworkName)) > cbg.MaxLength { return xerrors.Errorf("Value in field t.NetworkName was too long") } @@ -206,7 +206,7 @@ func (t *ExecParams) MarshalCBOR(w io.Writer) error { } // t.ConstructorParams ([]uint8) (slice) - if len(t.ConstructorParams) > cbg.ByteArrayMaxLen { + if uint64(len(t.ConstructorParams)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.ConstructorParams was too long") } @@ -372,7 +372,7 @@ func (t *Exec4Params) MarshalCBOR(w io.Writer) error { } // t.ConstructorParams ([]uint8) (slice) - if len(t.ConstructorParams) > cbg.ByteArrayMaxLen { + if uint64(len(t.ConstructorParams)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.ConstructorParams was too long") } @@ -385,7 +385,7 @@ func (t *Exec4Params) MarshalCBOR(w io.Writer) error { } // t.SubAddress ([]uint8) (slice) - if len(t.SubAddress) > cbg.ByteArrayMaxLen { + if uint64(len(t.SubAddress)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.SubAddress was too long") } diff --git a/builtin/v12/market/cbor_gen.go b/builtin/v12/market/cbor_gen.go index 821a198d..5905a7af 100644 --- a/builtin/v12/market/cbor_gen.go +++ b/builtin/v12/market/cbor_gen.go @@ -543,7 +543,7 @@ func (t *PublishStorageDealsParams) MarshalCBOR(w io.Writer) error { } // t.Deals ([]market.ClientDealProposal) (slice) - if len(t.Deals) > cbg.MaxLength { + if uint64(len(t.Deals)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Deals was too long") } @@ -638,7 +638,7 @@ func (t *PublishStorageDealsReturn) MarshalCBOR(w io.Writer) error { } // t.IDs ([]abi.DealID) (slice) - if len(t.IDs) > cbg.MaxLength { + if uint64(len(t.IDs)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.IDs was too long") } @@ -753,7 +753,7 @@ func (t *ActivateDealsParams) MarshalCBOR(w io.Writer) error { } // t.DealIDs ([]abi.DealID) (slice) - if len(t.DealIDs) > cbg.MaxLength { + if uint64(len(t.DealIDs)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.DealIDs was too long") } @@ -778,6 +778,7 @@ func (t *ActivateDealsParams) MarshalCBOR(w io.Writer) error { return err } } + return nil } @@ -895,7 +896,7 @@ func (t *ActivateDealsResult) MarshalCBOR(w io.Writer) error { } // t.VerifiedInfos ([]market.VerifiedDealInfo) (slice) - if len(t.VerifiedInfos) > cbg.MaxLength { + if uint64(len(t.VerifiedInfos)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.VerifiedInfos was too long") } @@ -999,7 +1000,7 @@ func (t *VerifyDealsForActivationParams) MarshalCBOR(w io.Writer) error { } // t.Sectors ([]market.SectorDeals) (slice) - if len(t.Sectors) > cbg.MaxLength { + if uint64(len(t.Sectors)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Sectors was too long") } @@ -1094,7 +1095,7 @@ func (t *VerifyDealsForActivationReturn) MarshalCBOR(w io.Writer) error { } // t.UnsealedCIDs ([]*cid.Cid) (slice) - if len(t.UnsealedCIDs) > cbg.MaxLength { + if uint64(len(t.UnsealedCIDs)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.UnsealedCIDs was too long") } @@ -1380,6 +1381,7 @@ func (t *GetDealTermReturn) MarshalCBOR(w io.Writer) error { return err } } + return nil } @@ -1494,6 +1496,7 @@ func (t *GetDealActivationReturn) MarshalCBOR(w io.Writer) error { return err } } + return nil } @@ -1599,7 +1602,7 @@ func (t *OnMinerSectorsTerminateParams) MarshalCBOR(w io.Writer) error { } // t.DealIDs ([]abi.DealID) (slice) - if len(t.DealIDs) > cbg.MaxLength { + if uint64(len(t.DealIDs)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.DealIDs was too long") } @@ -2075,7 +2078,7 @@ func (t *SectorDeals) MarshalCBOR(w io.Writer) error { } // t.DealIDs ([]abi.DealID) (slice) - if len(t.DealIDs) > cbg.MaxLength { + if uint64(len(t.DealIDs)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.DealIDs was too long") } @@ -2296,7 +2299,7 @@ func (t *SectorDataSpec) MarshalCBOR(w io.Writer) error { } // t.DealIDs ([]abi.DealID) (slice) - if len(t.DealIDs) > cbg.MaxLength { + if uint64(len(t.DealIDs)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.DealIDs was too long") } @@ -2321,6 +2324,7 @@ func (t *SectorDataSpec) MarshalCBOR(w io.Writer) error { return err } } + return nil } diff --git a/builtin/v12/market/deal.go b/builtin/v12/market/deal.go index 73ee872a..d025802c 100644 --- a/builtin/v12/market/deal.go +++ b/builtin/v12/market/deal.go @@ -111,7 +111,7 @@ func (label *DealLabel) MarshalCBOR(w io.Writer) error { _, err := io.WriteString(w, string("")) return err } - if len(label.bs) > cbg.ByteArrayMaxLen { + if uint64(len(label.bs)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("label is too long to marshal (%d), max allowed (%d)", len(label.bs), cbg.ByteArrayMaxLen) } diff --git a/builtin/v12/miner/cbor_gen.go b/builtin/v12/miner/cbor_gen.go index 1e0c2c8f..e414b56d 100644 --- a/builtin/v12/miner/cbor_gen.go +++ b/builtin/v12/miner/cbor_gen.go @@ -363,7 +363,7 @@ func (t *MinerInfo) MarshalCBOR(w io.Writer) error { } // t.ControlAddresses ([]address.Address) (slice) - if len(t.ControlAddresses) > cbg.MaxLength { + if uint64(len(t.ControlAddresses)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.ControlAddresses was too long") } @@ -383,7 +383,7 @@ func (t *MinerInfo) MarshalCBOR(w io.Writer) error { } // t.PeerId ([]uint8) (slice) - if len(t.PeerId) > cbg.ByteArrayMaxLen { + if uint64(len(t.PeerId)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.PeerId was too long") } @@ -396,7 +396,7 @@ func (t *MinerInfo) MarshalCBOR(w io.Writer) error { } // t.Multiaddrs ([][]uint8) (slice) - if len(t.Multiaddrs) > cbg.MaxLength { + if uint64(len(t.Multiaddrs)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Multiaddrs was too long") } @@ -404,7 +404,7 @@ func (t *MinerInfo) MarshalCBOR(w io.Writer) error { return err } for _, v := range t.Multiaddrs { - if len(v) > cbg.ByteArrayMaxLen { + if uint64(len(v)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field v was too long") } @@ -796,7 +796,7 @@ func (t *Deadlines) MarshalCBOR(w io.Writer) error { } // t.Due ([48]cid.Cid) (array) - if len(t.Due) > cbg.MaxLength { + if uint64(len(t.Due)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Due was too long") } @@ -1533,6 +1533,7 @@ func (t *SectorPreCommitOnChainInfo) MarshalCBOR(w io.Writer) error { return err } } + return nil } @@ -1654,7 +1655,7 @@ func (t *SectorPreCommitInfo) MarshalCBOR(w io.Writer) error { } // t.DealIDs ([]abi.DealID) (slice) - if len(t.DealIDs) > cbg.MaxLength { + if uint64(len(t.DealIDs)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.DealIDs was too long") } @@ -1925,7 +1926,7 @@ func (t *SectorOnChainInfo) MarshalCBOR(w io.Writer) error { } // t.DealIDs ([]abi.DealID) (slice) - if len(t.DealIDs) > cbg.MaxLength { + if uint64(len(t.DealIDs)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.DealIDs was too long") } @@ -2338,6 +2339,7 @@ func (t *WorkerKeyChange) MarshalCBOR(w io.Writer) error { return err } } + return nil } @@ -2416,7 +2418,7 @@ func (t *VestingFunds) MarshalCBOR(w io.Writer) error { } // t.Funds ([]miner.VestingFund) (slice) - if len(t.Funds) > cbg.MaxLength { + if uint64(len(t.Funds)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Funds was too long") } @@ -2608,7 +2610,7 @@ func (t *WindowedPoSt) MarshalCBOR(w io.Writer) error { } // t.Proofs ([]proof.PoStProof) (slice) - if len(t.Proofs) > cbg.MaxLength { + if uint64(len(t.Proofs)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Proofs was too long") } @@ -2801,6 +2803,7 @@ func (t *BeneficiaryTerm) MarshalCBOR(w io.Writer) error { return err } } + return nil } @@ -3048,7 +3051,7 @@ func (t *GetControlAddressesReturn) MarshalCBOR(w io.Writer) error { } // t.ControlAddrs ([]address.Address) (slice) - if len(t.ControlAddrs) > cbg.MaxLength { + if uint64(len(t.ControlAddrs)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.ControlAddrs was too long") } @@ -3166,7 +3169,7 @@ func (t *ChangeWorkerAddressParams) MarshalCBOR(w io.Writer) error { } // t.NewControlAddrs ([]address.Address) (slice) - if len(t.NewControlAddrs) > cbg.MaxLength { + if uint64(len(t.NewControlAddrs)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.NewControlAddrs was too long") } @@ -3270,7 +3273,7 @@ func (t *ChangePeerIDParams) MarshalCBOR(w io.Writer) error { } // t.NewID ([]uint8) (slice) - if len(t.NewID) > cbg.ByteArrayMaxLen { + if uint64(len(t.NewID)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.NewID was too long") } @@ -3354,7 +3357,7 @@ func (t *SubmitWindowedPoStParams) MarshalCBOR(w io.Writer) error { } // t.Partitions ([]miner.PoStPartition) (slice) - if len(t.Partitions) > cbg.MaxLength { + if uint64(len(t.Partitions)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Partitions was too long") } @@ -3369,7 +3372,7 @@ func (t *SubmitWindowedPoStParams) MarshalCBOR(w io.Writer) error { } // t.Proofs ([]proof.PoStProof) (slice) - if len(t.Proofs) > cbg.MaxLength { + if uint64(len(t.Proofs)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Proofs was too long") } @@ -3395,7 +3398,7 @@ func (t *SubmitWindowedPoStParams) MarshalCBOR(w io.Writer) error { } // t.ChainCommitRand (abi.Randomness) (slice) - if len(t.ChainCommitRand) > cbg.ByteArrayMaxLen { + if uint64(len(t.ChainCommitRand)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.ChainCommitRand was too long") } @@ -3622,7 +3625,7 @@ func (t *PreCommitSectorParams) MarshalCBOR(w io.Writer) error { } // t.DealIDs ([]abi.DealID) (slice) - if len(t.DealIDs) > cbg.MaxLength { + if uint64(len(t.DealIDs)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.DealIDs was too long") } @@ -3924,7 +3927,7 @@ func (t *ProveCommitSectorParams) MarshalCBOR(w io.Writer) error { } // t.Proof ([]uint8) (slice) - if len(t.Proof) > cbg.ByteArrayMaxLen { + if uint64(len(t.Proof)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.Proof was too long") } @@ -4016,7 +4019,7 @@ func (t *ExtendSectorExpirationParams) MarshalCBOR(w io.Writer) error { } // t.Extensions ([]miner.ExpirationExtension) (slice) - if len(t.Extensions) > cbg.MaxLength { + if uint64(len(t.Extensions)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Extensions was too long") } @@ -4111,7 +4114,7 @@ func (t *ExtendSectorExpiration2Params) MarshalCBOR(w io.Writer) error { } // t.Extensions ([]miner.ExpirationExtension2) (slice) - if len(t.Extensions) > cbg.MaxLength { + if uint64(len(t.Extensions)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Extensions was too long") } @@ -4206,7 +4209,7 @@ func (t *TerminateSectorsParams) MarshalCBOR(w io.Writer) error { } // t.Terminations ([]miner.TerminationDeclaration) (slice) - if len(t.Terminations) > cbg.MaxLength { + if uint64(len(t.Terminations)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Terminations was too long") } @@ -4365,7 +4368,7 @@ func (t *DeclareFaultsParams) MarshalCBOR(w io.Writer) error { } // t.Faults ([]miner.FaultDeclaration) (slice) - if len(t.Faults) > cbg.MaxLength { + if uint64(len(t.Faults)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Faults was too long") } @@ -4460,7 +4463,7 @@ func (t *DeclareFaultsRecoveredParams) MarshalCBOR(w io.Writer) error { } // t.Recoveries ([]miner.RecoveryDeclaration) (slice) - if len(t.Recoveries) > cbg.MaxLength { + if uint64(len(t.Recoveries)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Recoveries was too long") } @@ -4555,7 +4558,7 @@ func (t *DeferredCronEventParams) MarshalCBOR(w io.Writer) error { } // t.EventPayload ([]uint8) (slice) - if len(t.EventPayload) > cbg.ByteArrayMaxLen { + if uint64(len(t.EventPayload)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.EventPayload was too long") } @@ -4793,7 +4796,7 @@ func (t *ReportConsensusFaultParams) MarshalCBOR(w io.Writer) error { } // t.BlockHeader1 ([]uint8) (slice) - if len(t.BlockHeader1) > cbg.ByteArrayMaxLen { + if uint64(len(t.BlockHeader1)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.BlockHeader1 was too long") } @@ -4806,7 +4809,7 @@ func (t *ReportConsensusFaultParams) MarshalCBOR(w io.Writer) error { } // t.BlockHeader2 ([]uint8) (slice) - if len(t.BlockHeader2) > cbg.ByteArrayMaxLen { + if uint64(len(t.BlockHeader2)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.BlockHeader2 was too long") } @@ -4819,7 +4822,7 @@ func (t *ReportConsensusFaultParams) MarshalCBOR(w io.Writer) error { } // t.BlockHeaderExtra ([]uint8) (slice) - if len(t.BlockHeaderExtra) > cbg.ByteArrayMaxLen { + if uint64(len(t.BlockHeaderExtra)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.BlockHeaderExtra was too long") } @@ -4997,7 +5000,7 @@ func (t *ConfirmSectorProofsParams) MarshalCBOR(w io.Writer) error { } // t.Sectors ([]abi.SectorNumber) (slice) - if len(t.Sectors) > cbg.MaxLength { + if uint64(len(t.Sectors)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Sectors was too long") } @@ -5140,7 +5143,7 @@ func (t *ChangeMultiaddrsParams) MarshalCBOR(w io.Writer) error { } // t.NewMultiaddrs ([][]uint8) (slice) - if len(t.NewMultiaddrs) > cbg.MaxLength { + if uint64(len(t.NewMultiaddrs)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.NewMultiaddrs was too long") } @@ -5148,7 +5151,7 @@ func (t *ChangeMultiaddrsParams) MarshalCBOR(w io.Writer) error { return err } for _, v := range t.NewMultiaddrs { - if len(v) > cbg.ByteArrayMaxLen { + if uint64(len(v)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field v was too long") } @@ -5470,7 +5473,7 @@ func (t *PreCommitSectorBatchParams) MarshalCBOR(w io.Writer) error { } // t.Sectors ([]miner.PreCommitSectorParams) (slice) - if len(t.Sectors) > cbg.MaxLength { + if uint64(len(t.Sectors)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Sectors was too long") } @@ -5570,7 +5573,7 @@ func (t *ProveCommitAggregateParams) MarshalCBOR(w io.Writer) error { } // t.AggregateProof ([]uint8) (slice) - if len(t.AggregateProof) > cbg.ByteArrayMaxLen { + if uint64(len(t.AggregateProof)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.AggregateProof was too long") } @@ -5657,7 +5660,7 @@ func (t *ProveReplicaUpdatesParams) MarshalCBOR(w io.Writer) error { } // t.Updates ([]miner.ReplicaUpdate) (slice) - if len(t.Updates) > cbg.MaxLength { + if uint64(len(t.Updates)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Updates was too long") } @@ -5761,6 +5764,7 @@ func (t *CronEventPayload) MarshalCBOR(w io.Writer) error { return err } } + return nil } @@ -5830,7 +5834,7 @@ func (t *PreCommitSectorBatchParams2) MarshalCBOR(w io.Writer) error { } // t.Sectors ([]miner.SectorPreCommitInfo) (slice) - if len(t.Sectors) > cbg.MaxLength { + if uint64(len(t.Sectors)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Sectors was too long") } @@ -5925,7 +5929,7 @@ func (t *ProveReplicaUpdatesParams2) MarshalCBOR(w io.Writer) error { } // t.Updates ([]miner.ReplicaUpdate2) (slice) - if len(t.Updates) > cbg.MaxLength { + if uint64(len(t.Updates)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Updates was too long") } @@ -6039,6 +6043,7 @@ func (t *ChangeBeneficiaryParams) MarshalCBOR(w io.Writer) error { return err } } + return nil } @@ -6286,7 +6291,7 @@ func (t *GetPeerIDReturn) MarshalCBOR(w io.Writer) error { } // t.PeerId ([]uint8) (slice) - if len(t.PeerId) > cbg.ByteArrayMaxLen { + if uint64(len(t.PeerId)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.PeerId was too long") } @@ -6364,7 +6369,7 @@ func (t *GetMultiAddrsReturn) MarshalCBOR(w io.Writer) error { } // t.MultiAddrs ([]uint8) (slice) - if len(t.MultiAddrs) > cbg.ByteArrayMaxLen { + if uint64(len(t.MultiAddrs)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.MultiAddrs was too long") } @@ -6660,6 +6665,7 @@ func (t *ExpirationExtension) MarshalCBOR(w io.Writer) error { return err } } + return nil } @@ -6962,7 +6968,7 @@ func (t *ReplicaUpdate) MarshalCBOR(w io.Writer) error { } // t.Deals ([]abi.DealID) (slice) - if len(t.Deals) > cbg.MaxLength { + if uint64(len(t.Deals)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Deals was too long") } @@ -6989,7 +6995,7 @@ func (t *ReplicaUpdate) MarshalCBOR(w io.Writer) error { } // t.ReplicaProof ([]uint8) (slice) - if len(t.ReplicaProof) > cbg.ByteArrayMaxLen { + if uint64(len(t.ReplicaProof)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.ReplicaProof was too long") } @@ -7219,7 +7225,7 @@ func (t *ReplicaUpdate2) MarshalCBOR(w io.Writer) error { } // t.Deals ([]abi.DealID) (slice) - if len(t.Deals) > cbg.MaxLength { + if uint64(len(t.Deals)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Deals was too long") } @@ -7246,7 +7252,7 @@ func (t *ReplicaUpdate2) MarshalCBOR(w io.Writer) error { } // t.ReplicaProof ([]uint8) (slice) - if len(t.ReplicaProof) > cbg.ByteArrayMaxLen { + if uint64(len(t.ReplicaProof)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.ReplicaProof was too long") } @@ -7475,7 +7481,7 @@ func (t *ExpirationExtension2) MarshalCBOR(w io.Writer) error { } // t.SectorsWithClaims ([]miner.SectorClaim) (slice) - if len(t.SectorsWithClaims) > cbg.MaxLength { + if uint64(len(t.SectorsWithClaims)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.SectorsWithClaims was too long") } @@ -7499,6 +7505,7 @@ func (t *ExpirationExtension2) MarshalCBOR(w io.Writer) error { return err } } + return nil } @@ -7649,7 +7656,7 @@ func (t *SectorClaim) MarshalCBOR(w io.Writer) error { } // t.MaintainClaims ([]verifreg.ClaimId) (slice) - if len(t.MaintainClaims) > cbg.MaxLength { + if uint64(len(t.MaintainClaims)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.MaintainClaims was too long") } @@ -7665,7 +7672,7 @@ func (t *SectorClaim) MarshalCBOR(w io.Writer) error { } // t.DropClaims ([]verifreg.ClaimId) (slice) - if len(t.DropClaims) > cbg.MaxLength { + if uint64(len(t.DropClaims)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.DropClaims was too long") } diff --git a/builtin/v12/multisig/cbor_gen.go b/builtin/v12/multisig/cbor_gen.go index c5b4f9d9..c28dfdf4 100644 --- a/builtin/v12/multisig/cbor_gen.go +++ b/builtin/v12/multisig/cbor_gen.go @@ -36,7 +36,7 @@ func (t *State) MarshalCBOR(w io.Writer) error { } // t.Signers ([]address.Address) (slice) - if len(t.Signers) > cbg.MaxLength { + if uint64(len(t.Signers)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Signers was too long") } @@ -308,7 +308,7 @@ func (t *Transaction) MarshalCBOR(w io.Writer) error { } // t.Params ([]uint8) (slice) - if len(t.Params) > cbg.ByteArrayMaxLen { + if uint64(len(t.Params)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.Params was too long") } @@ -321,7 +321,7 @@ func (t *Transaction) MarshalCBOR(w io.Writer) error { } // t.Approved ([]address.Address) (slice) - if len(t.Approved) > cbg.MaxLength { + if uint64(len(t.Approved)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Approved was too long") } @@ -491,7 +491,7 @@ func (t *ProposalHashData) MarshalCBOR(w io.Writer) error { } // t.Params ([]uint8) (slice) - if len(t.Params) > cbg.ByteArrayMaxLen { + if uint64(len(t.Params)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.Params was too long") } @@ -610,7 +610,7 @@ func (t *ConstructorParams) MarshalCBOR(w io.Writer) error { } // t.Signers ([]address.Address) (slice) - if len(t.Signers) > cbg.MaxLength { + if uint64(len(t.Signers)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Signers was too long") } @@ -651,6 +651,7 @@ func (t *ConstructorParams) MarshalCBOR(w io.Writer) error { return err } } + return nil } @@ -813,7 +814,7 @@ func (t *ProposeParams) MarshalCBOR(w io.Writer) error { } // t.Params ([]uint8) (slice) - if len(t.Params) > cbg.ByteArrayMaxLen { + if uint64(len(t.Params)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.Params was too long") } @@ -950,7 +951,7 @@ func (t *ProposeReturn) MarshalCBOR(w io.Writer) error { } // t.Ret ([]uint8) (slice) - if len(t.Ret) > cbg.ByteArrayMaxLen { + if uint64(len(t.Ret)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.Ret was too long") } @@ -1262,7 +1263,7 @@ func (t *TxnIDParams) MarshalCBOR(w io.Writer) error { } // t.ProposalHash ([]uint8) (slice) - if len(t.ProposalHash) > cbg.ByteArrayMaxLen { + if uint64(len(t.ProposalHash)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.ProposalHash was too long") } @@ -1381,7 +1382,7 @@ func (t *ApproveReturn) MarshalCBOR(w io.Writer) error { } // t.Ret ([]uint8) (slice) - if len(t.Ret) > cbg.ByteArrayMaxLen { + if uint64(len(t.Ret)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.Ret was too long") } diff --git a/builtin/v12/paych/cbor_gen.go b/builtin/v12/paych/cbor_gen.go index f53c5e62..b4e06f44 100644 --- a/builtin/v12/paych/cbor_gen.go +++ b/builtin/v12/paych/cbor_gen.go @@ -362,7 +362,7 @@ func (t *UpdateChannelStateParams) MarshalCBOR(w io.Writer) error { } // t.Secret ([]uint8) (slice) - if len(t.Secret) > cbg.ByteArrayMaxLen { + if uint64(len(t.Secret)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.Secret was too long") } @@ -476,7 +476,7 @@ func (t *SignedVoucher) MarshalCBOR(w io.Writer) error { } // t.SecretHash ([]uint8) (slice) - if len(t.SecretHash) > cbg.ByteArrayMaxLen { + if uint64(len(t.SecretHash)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.SecretHash was too long") } @@ -522,7 +522,7 @@ func (t *SignedVoucher) MarshalCBOR(w io.Writer) error { } // t.Merges ([]paych.Merge) (slice) - if len(t.Merges) > cbg.MaxLength { + if uint64(len(t.Merges)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Merges was too long") } @@ -814,7 +814,7 @@ func (t *ModVerifyParams) MarshalCBOR(w io.Writer) error { } // t.Data ([]uint8) (slice) - if len(t.Data) > cbg.ByteArrayMaxLen { + if uint64(len(t.Data)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.Data was too long") } diff --git a/builtin/v12/power/cbor_gen.go b/builtin/v12/power/cbor_gen.go index 883b0b4c..827e4263 100644 --- a/builtin/v12/power/cbor_gen.go +++ b/builtin/v12/power/cbor_gen.go @@ -568,7 +568,7 @@ func (t *MinerConstructorParams) MarshalCBOR(w io.Writer) error { } // t.ControlAddrs ([]address.Address) (slice) - if len(t.ControlAddrs) > cbg.MaxLength { + if uint64(len(t.ControlAddrs)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.ControlAddrs was too long") } @@ -594,7 +594,7 @@ func (t *MinerConstructorParams) MarshalCBOR(w io.Writer) error { } // t.PeerId ([]uint8) (slice) - if len(t.PeerId) > cbg.ByteArrayMaxLen { + if uint64(len(t.PeerId)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.PeerId was too long") } @@ -607,7 +607,7 @@ func (t *MinerConstructorParams) MarshalCBOR(w io.Writer) error { } // t.Multiaddrs ([][]uint8) (slice) - if len(t.Multiaddrs) > cbg.MaxLength { + if uint64(len(t.Multiaddrs)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Multiaddrs was too long") } @@ -615,7 +615,7 @@ func (t *MinerConstructorParams) MarshalCBOR(w io.Writer) error { return err } for _, v := range t.Multiaddrs { - if len(v) > cbg.ByteArrayMaxLen { + if uint64(len(v)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field v was too long") } @@ -846,7 +846,7 @@ func (t *CreateMinerParams) MarshalCBOR(w io.Writer) error { } // t.Peer ([]uint8) (slice) - if len(t.Peer) > cbg.ByteArrayMaxLen { + if uint64(len(t.Peer)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.Peer was too long") } @@ -859,7 +859,7 @@ func (t *CreateMinerParams) MarshalCBOR(w io.Writer) error { } // t.Multiaddrs ([][]uint8) (slice) - if len(t.Multiaddrs) > cbg.MaxLength { + if uint64(len(t.Multiaddrs)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Multiaddrs was too long") } @@ -867,7 +867,7 @@ func (t *CreateMinerParams) MarshalCBOR(w io.Writer) error { return err } for _, v := range t.Multiaddrs { - if len(v) > cbg.ByteArrayMaxLen { + if uint64(len(v)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field v was too long") } @@ -1218,7 +1218,7 @@ func (t *EnrollCronEventParams) MarshalCBOR(w io.Writer) error { } // t.Payload ([]uint8) (slice) - if len(t.Payload) > cbg.ByteArrayMaxLen { + if uint64(len(t.Payload)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.Payload was too long") } @@ -1404,7 +1404,7 @@ func (t *CronEvent) MarshalCBOR(w io.Writer) error { } // t.CallbackPayload ([]uint8) (slice) - if len(t.CallbackPayload) > cbg.ByteArrayMaxLen { + if uint64(len(t.CallbackPayload)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.CallbackPayload was too long") } diff --git a/builtin/v12/reward/cbor_gen.go b/builtin/v12/reward/cbor_gen.go index d3365367..ec29a320 100644 --- a/builtin/v12/reward/cbor_gen.go +++ b/builtin/v12/reward/cbor_gen.go @@ -368,6 +368,7 @@ func (t *AwardBlockRewardParams) MarshalCBOR(w io.Writer) error { return err } } + return nil } diff --git a/builtin/v12/verifreg/cbor_gen.go b/builtin/v12/verifreg/cbor_gen.go index 230e422b..e16c254b 100644 --- a/builtin/v12/verifreg/cbor_gen.go +++ b/builtin/v12/verifreg/cbor_gen.go @@ -638,7 +638,7 @@ func (t *RemoveExpiredAllocationsParams) MarshalCBOR(w io.Writer) error { } // t.AllocationIds ([]verifreg.AllocationId) (slice) - if len(t.AllocationIds) > cbg.MaxLength { + if uint64(len(t.AllocationIds)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.AllocationIds was too long") } @@ -753,7 +753,7 @@ func (t *RemoveExpiredAllocationsReturn) MarshalCBOR(w io.Writer) error { } // t.Considered ([]verifreg.AllocationId) (slice) - if len(t.Considered) > cbg.MaxLength { + if uint64(len(t.Considered)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Considered was too long") } @@ -888,7 +888,7 @@ func (t *BatchReturn) MarshalCBOR(w io.Writer) error { } // t.FailCodes ([]verifreg.FailCode) (slice) - if len(t.FailCodes) > cbg.MaxLength { + if uint64(len(t.FailCodes)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.FailCodes was too long") } @@ -997,7 +997,7 @@ func (t *ClaimAllocationsParams) MarshalCBOR(w io.Writer) error { } // t.Sectors ([]verifreg.SectorAllocationClaim) (slice) - if len(t.Sectors) > cbg.MaxLength { + if uint64(len(t.Sectors)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Sectors was too long") } @@ -1190,7 +1190,7 @@ func (t *GetClaimsParams) MarshalCBOR(w io.Writer) error { } // t.ClaimIds ([]verifreg.ClaimId) (slice) - if len(t.ClaimIds) > cbg.MaxLength { + if uint64(len(t.ClaimIds)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.ClaimIds was too long") } @@ -1310,7 +1310,7 @@ func (t *GetClaimsReturn) MarshalCBOR(w io.Writer) error { } // t.Claims ([]verifreg.Claim) (slice) - if len(t.Claims) > cbg.MaxLength { + if uint64(len(t.Claims)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Claims was too long") } @@ -1420,7 +1420,7 @@ func (t *UniversalReceiverParams) MarshalCBOR(w io.Writer) error { } // t.Payload ([]uint8) (slice) - if len(t.Payload) > cbg.ByteArrayMaxLen { + if uint64(len(t.Payload)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.Payload was too long") } @@ -1522,7 +1522,7 @@ func (t *AllocationsResponse) MarshalCBOR(w io.Writer) error { } // t.NewAllocations ([]verifreg.AllocationId) (slice) - if len(t.NewAllocations) > cbg.MaxLength { + if uint64(len(t.NewAllocations)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.NewAllocations was too long") } @@ -1641,7 +1641,7 @@ func (t *ExtendClaimTermsParams) MarshalCBOR(w io.Writer) error { } // t.Terms ([]verifreg.ClaimTerm) (slice) - if len(t.Terms) > cbg.MaxLength { + if uint64(len(t.Terms)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Terms was too long") } @@ -1742,7 +1742,7 @@ func (t *ExtendClaimTermsReturn) MarshalCBOR(w io.Writer) error { } // t.FailCodes ([]verifreg.FailCode) (slice) - if len(t.FailCodes) > cbg.MaxLength { + if uint64(len(t.FailCodes)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.FailCodes was too long") } @@ -1857,7 +1857,7 @@ func (t *RemoveExpiredClaimsParams) MarshalCBOR(w io.Writer) error { } // t.ClaimIds ([]verifreg.ClaimId) (slice) - if len(t.ClaimIds) > cbg.MaxLength { + if uint64(len(t.ClaimIds)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.ClaimIds was too long") } @@ -1972,7 +1972,7 @@ func (t *RemoveExpiredClaimsReturn) MarshalCBOR(w io.Writer) error { } // t.Considered ([]verifreg.AllocationId) (slice) - if len(t.Considered) > cbg.MaxLength { + if uint64(len(t.Considered)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Considered was too long") } @@ -2319,6 +2319,7 @@ func (t *FailCode) MarshalCBOR(w io.Writer) error { return err } } + return nil } @@ -2441,6 +2442,7 @@ func (t *SectorAllocationClaim) MarshalCBOR(w io.Writer) error { return err } } + return nil } @@ -2848,6 +2850,7 @@ func (t *ClaimTerm) MarshalCBOR(w io.Writer) error { return err } } + return nil } @@ -2965,6 +2968,7 @@ func (t *ClaimExtensionRequest) MarshalCBOR(w io.Writer) error { return err } } + return nil } @@ -3112,6 +3116,7 @@ func (t *Allocation) MarshalCBOR(w io.Writer) error { return err } } + return nil } @@ -3334,6 +3339,7 @@ func (t *AllocationRequest) MarshalCBOR(w io.Writer) error { return err } } + return nil } @@ -3493,7 +3499,7 @@ func (t *AllocationRequests) MarshalCBOR(w io.Writer) error { } // t.Allocations ([]verifreg.AllocationRequest) (slice) - if len(t.Allocations) > cbg.MaxLength { + if uint64(len(t.Allocations)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Allocations was too long") } @@ -3508,7 +3514,7 @@ func (t *AllocationRequests) MarshalCBOR(w io.Writer) error { } // t.Extensions ([]verifreg.ClaimExtensionRequest) (slice) - if len(t.Extensions) > cbg.MaxLength { + if uint64(len(t.Extensions)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Extensions was too long") } diff --git a/builtin/v13/account/cbor_gen.go b/builtin/v13/account/cbor_gen.go index 4a49915b..0bd09be2 100644 --- a/builtin/v13/account/cbor_gen.go +++ b/builtin/v13/account/cbor_gen.go @@ -89,7 +89,7 @@ func (t *AuthenticateMessageParams) MarshalCBOR(w io.Writer) error { } // t.Signature ([]uint8) (slice) - if len(t.Signature) > cbg.ByteArrayMaxLen { + if uint64(len(t.Signature)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.Signature was too long") } @@ -102,7 +102,7 @@ func (t *AuthenticateMessageParams) MarshalCBOR(w io.Writer) error { } // t.Message ([]uint8) (slice) - if len(t.Message) > cbg.ByteArrayMaxLen { + if uint64(len(t.Message)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.Message was too long") } diff --git a/builtin/v13/cron/cbor_gen.go b/builtin/v13/cron/cbor_gen.go index 013f8f58..73deb41d 100644 --- a/builtin/v13/cron/cbor_gen.go +++ b/builtin/v13/cron/cbor_gen.go @@ -34,7 +34,7 @@ func (t *State) MarshalCBOR(w io.Writer) error { } // t.Entries ([]cron.Entry) (slice) - if len(t.Entries) > cbg.MaxLength { + if uint64(len(t.Entries)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Entries was too long") } diff --git a/builtin/v13/datacap/cbor_gen.go b/builtin/v13/datacap/cbor_gen.go index 4f61008b..42c936a6 100644 --- a/builtin/v13/datacap/cbor_gen.go +++ b/builtin/v13/datacap/cbor_gen.go @@ -227,7 +227,7 @@ func (t *MintParams) MarshalCBOR(w io.Writer) error { } // t.Operators ([]address.Address) (slice) - if len(t.Operators) > cbg.MaxLength { + if uint64(len(t.Operators)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Operators was too long") } @@ -350,7 +350,7 @@ func (t *MintReturn) MarshalCBOR(w io.Writer) error { } // t.RecipientData ([]uint8) (slice) - if len(t.RecipientData) > cbg.ByteArrayMaxLen { + if uint64(len(t.RecipientData)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.RecipientData was too long") } @@ -526,7 +526,7 @@ func (t *TransferParams) MarshalCBOR(w io.Writer) error { } // t.OperatorData ([]uint8) (slice) - if len(t.OperatorData) > cbg.ByteArrayMaxLen { + if uint64(len(t.OperatorData)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.OperatorData was too long") } @@ -632,7 +632,7 @@ func (t *TransferReturn) MarshalCBOR(w io.Writer) error { } // t.RecipientData ([]uint8) (slice) - if len(t.RecipientData) > cbg.ByteArrayMaxLen { + if uint64(len(t.RecipientData)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.RecipientData was too long") } @@ -743,7 +743,7 @@ func (t *TransferFromParams) MarshalCBOR(w io.Writer) error { } // t.OperatorData ([]uint8) (slice) - if len(t.OperatorData) > cbg.ByteArrayMaxLen { + if uint64(len(t.OperatorData)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.OperatorData was too long") } @@ -863,7 +863,7 @@ func (t *TransferFromReturn) MarshalCBOR(w io.Writer) error { } // t.RecipientData ([]uint8) (slice) - if len(t.RecipientData) > cbg.ByteArrayMaxLen { + if uint64(len(t.RecipientData)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.RecipientData was too long") } diff --git a/builtin/v13/eam/cbor_gen.go b/builtin/v13/eam/cbor_gen.go index 368a14e0..ef731149 100644 --- a/builtin/v13/eam/cbor_gen.go +++ b/builtin/v13/eam/cbor_gen.go @@ -34,7 +34,7 @@ func (t *CreateParams) MarshalCBOR(w io.Writer) error { } // t.Initcode ([]uint8) (slice) - if len(t.Initcode) > cbg.ByteArrayMaxLen { + if uint64(len(t.Initcode)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.Initcode was too long") } @@ -143,7 +143,7 @@ func (t *CreateReturn) MarshalCBOR(w io.Writer) error { } // t.EthAddress ([20]uint8) (array) - if len(t.EthAddress) > cbg.ByteArrayMaxLen { + if uint64(len(t.EthAddress)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.EthAddress was too long") } @@ -252,7 +252,7 @@ func (t *Create2Params) MarshalCBOR(w io.Writer) error { } // t.Initcode ([]uint8) (slice) - if len(t.Initcode) > cbg.ByteArrayMaxLen { + if uint64(len(t.Initcode)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.Initcode was too long") } @@ -265,7 +265,7 @@ func (t *Create2Params) MarshalCBOR(w io.Writer) error { } // t.Salt ([32]uint8) (array) - if len(t.Salt) > cbg.ByteArrayMaxLen { + if uint64(len(t.Salt)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.Salt was too long") } @@ -374,7 +374,7 @@ func (t *Create2Return) MarshalCBOR(w io.Writer) error { } // t.EthAddress ([20]uint8) (array) - if len(t.EthAddress) > cbg.ByteArrayMaxLen { + if uint64(len(t.EthAddress)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.EthAddress was too long") } @@ -494,7 +494,7 @@ func (t *CreateExternalReturn) MarshalCBOR(w io.Writer) error { } // t.EthAddress ([20]uint8) (array) - if len(t.EthAddress) > cbg.ByteArrayMaxLen { + if uint64(len(t.EthAddress)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.EthAddress was too long") } diff --git a/builtin/v13/evm/cbor_gen.go b/builtin/v13/evm/cbor_gen.go index f0b0a7b8..dffac8ac 100644 --- a/builtin/v13/evm/cbor_gen.go +++ b/builtin/v13/evm/cbor_gen.go @@ -123,7 +123,7 @@ func (t *State) MarshalCBOR(w io.Writer) error { } // t.BytecodeHash ([32]uint8) (array) - if len(t.BytecodeHash) > cbg.ByteArrayMaxLen { + if uint64(len(t.BytecodeHash)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.BytecodeHash was too long") } @@ -273,7 +273,7 @@ func (t *ConstructorParams) MarshalCBOR(w io.Writer) error { } // t.Creator ([20]uint8) (array) - if len(t.Creator) > cbg.ByteArrayMaxLen { + if uint64(len(t.Creator)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.Creator was too long") } @@ -286,7 +286,7 @@ func (t *ConstructorParams) MarshalCBOR(w io.Writer) error { } // t.Initcode ([]uint8) (slice) - if len(t.Initcode) > cbg.ByteArrayMaxLen { + if uint64(len(t.Initcode)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.Initcode was too long") } @@ -385,7 +385,7 @@ func (t *GetStorageAtParams) MarshalCBOR(w io.Writer) error { } // t.StorageKey ([32]uint8) (array) - if len(t.StorageKey) > cbg.ByteArrayMaxLen { + if uint64(len(t.StorageKey)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.StorageKey was too long") } @@ -467,7 +467,7 @@ func (t *DelegateCallParams) MarshalCBOR(w io.Writer) error { } // t.Input ([]uint8) (slice) - if len(t.Input) > cbg.ByteArrayMaxLen { + if uint64(len(t.Input)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.Input was too long") } @@ -480,7 +480,7 @@ func (t *DelegateCallParams) MarshalCBOR(w io.Writer) error { } // t.Caller ([20]uint8) (array) - if len(t.Caller) > cbg.ByteArrayMaxLen { + if uint64(len(t.Caller)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.Caller was too long") } diff --git a/builtin/v13/init/cbor_gen.go b/builtin/v13/init/cbor_gen.go index 161f445f..e648e48a 100644 --- a/builtin/v13/init/cbor_gen.go +++ b/builtin/v13/init/cbor_gen.go @@ -46,7 +46,7 @@ func (t *State) MarshalCBOR(w io.Writer) error { } // t.NetworkName (string) (string) - if len(t.NetworkName) > cbg.MaxLength { + if uint64(len(t.NetworkName)) > cbg.MaxLength { return xerrors.Errorf("Value in field t.NetworkName was too long") } @@ -136,7 +136,7 @@ func (t *ConstructorParams) MarshalCBOR(w io.Writer) error { } // t.NetworkName (string) (string) - if len(t.NetworkName) > cbg.MaxLength { + if uint64(len(t.NetworkName)) > cbg.MaxLength { return xerrors.Errorf("Value in field t.NetworkName was too long") } @@ -206,7 +206,7 @@ func (t *ExecParams) MarshalCBOR(w io.Writer) error { } // t.ConstructorParams ([]uint8) (slice) - if len(t.ConstructorParams) > cbg.ByteArrayMaxLen { + if uint64(len(t.ConstructorParams)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.ConstructorParams was too long") } @@ -372,7 +372,7 @@ func (t *Exec4Params) MarshalCBOR(w io.Writer) error { } // t.ConstructorParams ([]uint8) (slice) - if len(t.ConstructorParams) > cbg.ByteArrayMaxLen { + if uint64(len(t.ConstructorParams)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.ConstructorParams was too long") } @@ -385,7 +385,7 @@ func (t *Exec4Params) MarshalCBOR(w io.Writer) error { } // t.SubAddress ([]uint8) (slice) - if len(t.SubAddress) > cbg.ByteArrayMaxLen { + if uint64(len(t.SubAddress)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.SubAddress was too long") } diff --git a/builtin/v13/market/cbor_gen.go b/builtin/v13/market/cbor_gen.go index 2fd49cf2..e2889dc2 100644 --- a/builtin/v13/market/cbor_gen.go +++ b/builtin/v13/market/cbor_gen.go @@ -357,6 +357,7 @@ func (t *DealState) MarshalCBOR(w io.Writer) error { return err } } + return nil } @@ -479,7 +480,7 @@ func (t *SectorDealIDs) MarshalCBOR(w io.Writer) error { cw := cbg.NewCborWriter(w) // (*t) (market.SectorDealIDs) (slice) - if len((*t)) > cbg.MaxLength { + if uint64(len((*t))) > cbg.MaxLength { return xerrors.Errorf("Slice value in field (*t) was too long") } @@ -635,7 +636,7 @@ func (t *PublishStorageDealsParams) MarshalCBOR(w io.Writer) error { } // t.Deals ([]market.ClientDealProposal) (slice) - if len(t.Deals) > cbg.MaxLength { + if uint64(len(t.Deals)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Deals was too long") } @@ -730,7 +731,7 @@ func (t *PublishStorageDealsReturn) MarshalCBOR(w io.Writer) error { } // t.IDs ([]abi.DealID) (slice) - if len(t.IDs) > cbg.MaxLength { + if uint64(len(t.IDs)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.IDs was too long") } @@ -845,7 +846,7 @@ func (t *ActivateDealsParams) MarshalCBOR(w io.Writer) error { } // t.DealIDs ([]abi.DealID) (slice) - if len(t.DealIDs) > cbg.MaxLength { + if uint64(len(t.DealIDs)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.DealIDs was too long") } @@ -870,6 +871,7 @@ func (t *ActivateDealsParams) MarshalCBOR(w io.Writer) error { return err } } + return nil } @@ -987,7 +989,7 @@ func (t *ActivateDealsResult) MarshalCBOR(w io.Writer) error { } // t.VerifiedInfos ([]market.VerifiedDealInfo) (slice) - if len(t.VerifiedInfos) > cbg.MaxLength { + if uint64(len(t.VerifiedInfos)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.VerifiedInfos was too long") } @@ -1091,7 +1093,7 @@ func (t *VerifyDealsForActivationParams) MarshalCBOR(w io.Writer) error { } // t.Sectors ([]market.SectorDeals) (slice) - if len(t.Sectors) > cbg.MaxLength { + if uint64(len(t.Sectors)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Sectors was too long") } @@ -1186,7 +1188,7 @@ func (t *VerifyDealsForActivationReturn) MarshalCBOR(w io.Writer) error { } // t.UnsealedCIDs ([]*cid.Cid) (slice) - if len(t.UnsealedCIDs) > cbg.MaxLength { + if uint64(len(t.UnsealedCIDs)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.UnsealedCIDs was too long") } @@ -1472,6 +1474,7 @@ func (t *GetDealTermReturn) MarshalCBOR(w io.Writer) error { return err } } + return nil } @@ -1586,6 +1589,7 @@ func (t *GetDealActivationReturn) MarshalCBOR(w io.Writer) error { return err } } + return nil } @@ -1691,7 +1695,7 @@ func (t *OnMinerSectorsTerminateParams) MarshalCBOR(w io.Writer) error { } // t.DealIDs ([]abi.DealID) (slice) - if len(t.DealIDs) > cbg.MaxLength { + if uint64(len(t.DealIDs)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.DealIDs was too long") } @@ -2167,7 +2171,7 @@ func (t *SectorDeals) MarshalCBOR(w io.Writer) error { } // t.DealIDs ([]abi.DealID) (slice) - if len(t.DealIDs) > cbg.MaxLength { + if uint64(len(t.DealIDs)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.DealIDs was too long") } @@ -2388,7 +2392,7 @@ func (t *SectorDataSpec) MarshalCBOR(w io.Writer) error { } // t.DealIDs ([]abi.DealID) (slice) - if len(t.DealIDs) > cbg.MaxLength { + if uint64(len(t.DealIDs)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.DealIDs was too long") } @@ -2413,6 +2417,7 @@ func (t *SectorDataSpec) MarshalCBOR(w io.Writer) error { return err } } + return nil } diff --git a/builtin/v13/market/deal.go b/builtin/v13/market/deal.go index 0b19ae84..36b615ae 100644 --- a/builtin/v13/market/deal.go +++ b/builtin/v13/market/deal.go @@ -110,7 +110,7 @@ func (label *DealLabel) MarshalCBOR(w io.Writer) error { _, err := io.WriteString(w, string("")) return err } - if len(label.bs) > cbg.ByteArrayMaxLen { + if uint64(len(label.bs)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("label is too long to marshal (%d), max allowed (%d)", len(label.bs), cbg.ByteArrayMaxLen) } diff --git a/builtin/v13/miner/cbor_gen.go b/builtin/v13/miner/cbor_gen.go index c51ad003..1d73014b 100644 --- a/builtin/v13/miner/cbor_gen.go +++ b/builtin/v13/miner/cbor_gen.go @@ -364,7 +364,7 @@ func (t *MinerInfo) MarshalCBOR(w io.Writer) error { } // t.ControlAddresses ([]address.Address) (slice) - if len(t.ControlAddresses) > cbg.MaxLength { + if uint64(len(t.ControlAddresses)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.ControlAddresses was too long") } @@ -384,7 +384,7 @@ func (t *MinerInfo) MarshalCBOR(w io.Writer) error { } // t.PeerId ([]uint8) (slice) - if len(t.PeerId) > cbg.ByteArrayMaxLen { + if uint64(len(t.PeerId)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.PeerId was too long") } @@ -397,7 +397,7 @@ func (t *MinerInfo) MarshalCBOR(w io.Writer) error { } // t.Multiaddrs ([][]uint8) (slice) - if len(t.Multiaddrs) > cbg.MaxLength { + if uint64(len(t.Multiaddrs)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Multiaddrs was too long") } @@ -405,7 +405,7 @@ func (t *MinerInfo) MarshalCBOR(w io.Writer) error { return err } for _, v := range t.Multiaddrs { - if len(v) > cbg.ByteArrayMaxLen { + if uint64(len(v)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field v was too long") } @@ -797,7 +797,7 @@ func (t *Deadlines) MarshalCBOR(w io.Writer) error { } // t.Due ([48]cid.Cid) (array) - if len(t.Due) > cbg.MaxLength { + if uint64(len(t.Due)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Due was too long") } @@ -1534,6 +1534,7 @@ func (t *SectorPreCommitOnChainInfo) MarshalCBOR(w io.Writer) error { return err } } + return nil } @@ -1655,7 +1656,7 @@ func (t *SectorPreCommitInfo) MarshalCBOR(w io.Writer) error { } // t.DealIDs ([]abi.DealID) (slice) - if len(t.DealIDs) > cbg.MaxLength { + if uint64(len(t.DealIDs)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.DealIDs was too long") } @@ -1926,7 +1927,7 @@ func (t *SectorOnChainInfo) MarshalCBOR(w io.Writer) error { } // t.DealIDs ([]abi.DealID) (slice) - if len(t.DealIDs) > cbg.MaxLength { + if uint64(len(t.DealIDs)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.DealIDs was too long") } @@ -2339,6 +2340,7 @@ func (t *WorkerKeyChange) MarshalCBOR(w io.Writer) error { return err } } + return nil } @@ -2417,7 +2419,7 @@ func (t *VestingFunds) MarshalCBOR(w io.Writer) error { } // t.Funds ([]miner.VestingFund) (slice) - if len(t.Funds) > cbg.MaxLength { + if uint64(len(t.Funds)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Funds was too long") } @@ -2609,7 +2611,7 @@ func (t *WindowedPoSt) MarshalCBOR(w io.Writer) error { } // t.Proofs ([]proof.PoStProof) (slice) - if len(t.Proofs) > cbg.MaxLength { + if uint64(len(t.Proofs)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Proofs was too long") } @@ -2802,6 +2804,7 @@ func (t *BeneficiaryTerm) MarshalCBOR(w io.Writer) error { return err } } + return nil } @@ -3049,7 +3052,7 @@ func (t *GetControlAddressesReturn) MarshalCBOR(w io.Writer) error { } // t.ControlAddrs ([]address.Address) (slice) - if len(t.ControlAddrs) > cbg.MaxLength { + if uint64(len(t.ControlAddrs)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.ControlAddrs was too long") } @@ -3167,7 +3170,7 @@ func (t *ChangeWorkerAddressParams) MarshalCBOR(w io.Writer) error { } // t.NewControlAddrs ([]address.Address) (slice) - if len(t.NewControlAddrs) > cbg.MaxLength { + if uint64(len(t.NewControlAddrs)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.NewControlAddrs was too long") } @@ -3271,7 +3274,7 @@ func (t *ChangePeerIDParams) MarshalCBOR(w io.Writer) error { } // t.NewID ([]uint8) (slice) - if len(t.NewID) > cbg.ByteArrayMaxLen { + if uint64(len(t.NewID)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.NewID was too long") } @@ -3355,7 +3358,7 @@ func (t *SubmitWindowedPoStParams) MarshalCBOR(w io.Writer) error { } // t.Partitions ([]miner.PoStPartition) (slice) - if len(t.Partitions) > cbg.MaxLength { + if uint64(len(t.Partitions)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Partitions was too long") } @@ -3370,7 +3373,7 @@ func (t *SubmitWindowedPoStParams) MarshalCBOR(w io.Writer) error { } // t.Proofs ([]proof.PoStProof) (slice) - if len(t.Proofs) > cbg.MaxLength { + if uint64(len(t.Proofs)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Proofs was too long") } @@ -3396,7 +3399,7 @@ func (t *SubmitWindowedPoStParams) MarshalCBOR(w io.Writer) error { } // t.ChainCommitRand (abi.Randomness) (slice) - if len(t.ChainCommitRand) > cbg.ByteArrayMaxLen { + if uint64(len(t.ChainCommitRand)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.ChainCommitRand was too long") } @@ -3623,7 +3626,7 @@ func (t *PreCommitSectorParams) MarshalCBOR(w io.Writer) error { } // t.DealIDs ([]abi.DealID) (slice) - if len(t.DealIDs) > cbg.MaxLength { + if uint64(len(t.DealIDs)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.DealIDs was too long") } @@ -3925,7 +3928,7 @@ func (t *ProveCommitSectorParams) MarshalCBOR(w io.Writer) error { } // t.Proof ([]uint8) (slice) - if len(t.Proof) > cbg.ByteArrayMaxLen { + if uint64(len(t.Proof)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.Proof was too long") } @@ -4017,7 +4020,7 @@ func (t *ExtendSectorExpirationParams) MarshalCBOR(w io.Writer) error { } // t.Extensions ([]miner.ExpirationExtension) (slice) - if len(t.Extensions) > cbg.MaxLength { + if uint64(len(t.Extensions)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Extensions was too long") } @@ -4112,7 +4115,7 @@ func (t *ExtendSectorExpiration2Params) MarshalCBOR(w io.Writer) error { } // t.Extensions ([]miner.ExpirationExtension2) (slice) - if len(t.Extensions) > cbg.MaxLength { + if uint64(len(t.Extensions)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Extensions was too long") } @@ -4207,7 +4210,7 @@ func (t *TerminateSectorsParams) MarshalCBOR(w io.Writer) error { } // t.Terminations ([]miner.TerminationDeclaration) (slice) - if len(t.Terminations) > cbg.MaxLength { + if uint64(len(t.Terminations)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Terminations was too long") } @@ -4366,7 +4369,7 @@ func (t *DeclareFaultsParams) MarshalCBOR(w io.Writer) error { } // t.Faults ([]miner.FaultDeclaration) (slice) - if len(t.Faults) > cbg.MaxLength { + if uint64(len(t.Faults)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Faults was too long") } @@ -4461,7 +4464,7 @@ func (t *DeclareFaultsRecoveredParams) MarshalCBOR(w io.Writer) error { } // t.Recoveries ([]miner.RecoveryDeclaration) (slice) - if len(t.Recoveries) > cbg.MaxLength { + if uint64(len(t.Recoveries)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Recoveries was too long") } @@ -4556,7 +4559,7 @@ func (t *DeferredCronEventParams) MarshalCBOR(w io.Writer) error { } // t.EventPayload ([]uint8) (slice) - if len(t.EventPayload) > cbg.ByteArrayMaxLen { + if uint64(len(t.EventPayload)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.EventPayload was too long") } @@ -4794,7 +4797,7 @@ func (t *ReportConsensusFaultParams) MarshalCBOR(w io.Writer) error { } // t.BlockHeader1 ([]uint8) (slice) - if len(t.BlockHeader1) > cbg.ByteArrayMaxLen { + if uint64(len(t.BlockHeader1)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.BlockHeader1 was too long") } @@ -4807,7 +4810,7 @@ func (t *ReportConsensusFaultParams) MarshalCBOR(w io.Writer) error { } // t.BlockHeader2 ([]uint8) (slice) - if len(t.BlockHeader2) > cbg.ByteArrayMaxLen { + if uint64(len(t.BlockHeader2)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.BlockHeader2 was too long") } @@ -4820,7 +4823,7 @@ func (t *ReportConsensusFaultParams) MarshalCBOR(w io.Writer) error { } // t.BlockHeaderExtra ([]uint8) (slice) - if len(t.BlockHeaderExtra) > cbg.ByteArrayMaxLen { + if uint64(len(t.BlockHeaderExtra)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.BlockHeaderExtra was too long") } @@ -4998,7 +5001,7 @@ func (t *ConfirmSectorProofsParams) MarshalCBOR(w io.Writer) error { } // t.Sectors ([]abi.SectorNumber) (slice) - if len(t.Sectors) > cbg.MaxLength { + if uint64(len(t.Sectors)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Sectors was too long") } @@ -5141,7 +5144,7 @@ func (t *ChangeMultiaddrsParams) MarshalCBOR(w io.Writer) error { } // t.NewMultiaddrs ([][]uint8) (slice) - if len(t.NewMultiaddrs) > cbg.MaxLength { + if uint64(len(t.NewMultiaddrs)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.NewMultiaddrs was too long") } @@ -5149,7 +5152,7 @@ func (t *ChangeMultiaddrsParams) MarshalCBOR(w io.Writer) error { return err } for _, v := range t.NewMultiaddrs { - if len(v) > cbg.ByteArrayMaxLen { + if uint64(len(v)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field v was too long") } @@ -5471,7 +5474,7 @@ func (t *PreCommitSectorBatchParams) MarshalCBOR(w io.Writer) error { } // t.Sectors ([]miner.PreCommitSectorParams) (slice) - if len(t.Sectors) > cbg.MaxLength { + if uint64(len(t.Sectors)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Sectors was too long") } @@ -5571,7 +5574,7 @@ func (t *ProveCommitAggregateParams) MarshalCBOR(w io.Writer) error { } // t.AggregateProof ([]uint8) (slice) - if len(t.AggregateProof) > cbg.ByteArrayMaxLen { + if uint64(len(t.AggregateProof)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.AggregateProof was too long") } @@ -5658,7 +5661,7 @@ func (t *ProveReplicaUpdatesParams) MarshalCBOR(w io.Writer) error { } // t.Updates ([]miner.ReplicaUpdate) (slice) - if len(t.Updates) > cbg.MaxLength { + if uint64(len(t.Updates)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Updates was too long") } @@ -5762,6 +5765,7 @@ func (t *CronEventPayload) MarshalCBOR(w io.Writer) error { return err } } + return nil } @@ -5831,7 +5835,7 @@ func (t *PreCommitSectorBatchParams2) MarshalCBOR(w io.Writer) error { } // t.Sectors ([]miner.SectorPreCommitInfo) (slice) - if len(t.Sectors) > cbg.MaxLength { + if uint64(len(t.Sectors)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Sectors was too long") } @@ -5926,7 +5930,7 @@ func (t *ProveReplicaUpdatesParams2) MarshalCBOR(w io.Writer) error { } // t.Updates ([]miner.ReplicaUpdate2) (slice) - if len(t.Updates) > cbg.MaxLength { + if uint64(len(t.Updates)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Updates was too long") } @@ -6040,6 +6044,7 @@ func (t *ChangeBeneficiaryParams) MarshalCBOR(w io.Writer) error { return err } } + return nil } @@ -6287,7 +6292,7 @@ func (t *GetPeerIDReturn) MarshalCBOR(w io.Writer) error { } // t.PeerId ([]uint8) (slice) - if len(t.PeerId) > cbg.ByteArrayMaxLen { + if uint64(len(t.PeerId)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.PeerId was too long") } @@ -6365,7 +6370,7 @@ func (t *GetMultiAddrsReturn) MarshalCBOR(w io.Writer) error { } // t.MultiAddrs ([]uint8) (slice) - if len(t.MultiAddrs) > cbg.ByteArrayMaxLen { + if uint64(len(t.MultiAddrs)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.MultiAddrs was too long") } @@ -6443,7 +6448,7 @@ func (t *ProveCommitSectors3Params) MarshalCBOR(w io.Writer) error { } // t.SectorActivations ([]miner.SectorActivationManifest) (slice) - if len(t.SectorActivations) > cbg.MaxLength { + if uint64(len(t.SectorActivations)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.SectorActivations was too long") } @@ -6458,7 +6463,7 @@ func (t *ProveCommitSectors3Params) MarshalCBOR(w io.Writer) error { } // t.SectorProofs ([][]uint8) (slice) - if len(t.SectorProofs) > cbg.MaxLength { + if uint64(len(t.SectorProofs)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.SectorProofs was too long") } @@ -6466,7 +6471,7 @@ func (t *ProveCommitSectors3Params) MarshalCBOR(w io.Writer) error { return err } for _, v := range t.SectorProofs { - if len(v) > cbg.ByteArrayMaxLen { + if uint64(len(v)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field v was too long") } @@ -6481,7 +6486,7 @@ func (t *ProveCommitSectors3Params) MarshalCBOR(w io.Writer) error { } // t.AggregateProof ([]uint8) (slice) - if len(t.AggregateProof) > cbg.ByteArrayMaxLen { + if uint64(len(t.AggregateProof)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.AggregateProof was too long") } @@ -6494,13 +6499,19 @@ func (t *ProveCommitSectors3Params) MarshalCBOR(w io.Writer) error { } // t.AggregateProofType (abi.RegisteredAggregationProof) (int64) - if t.AggregateProofType >= 0 { - if err := cw.WriteMajorTypeHeader(cbg.MajUnsignedInt, uint64(t.AggregateProofType)); err != nil { + if t.AggregateProofType == nil { + if _, err := cw.Write(cbg.CborNull); err != nil { return err } } else { - if err := cw.WriteMajorTypeHeader(cbg.MajNegativeInt, uint64(-t.AggregateProofType-1)); err != nil { - return err + if *t.AggregateProofType >= 0 { + if err := cw.WriteMajorTypeHeader(cbg.MajUnsignedInt, uint64(*t.AggregateProofType)); err != nil { + return err + } + } else { + if err := cw.WriteMajorTypeHeader(cbg.MajNegativeInt, uint64(-*t.AggregateProofType-1)); err != nil { + return err + } } } @@ -6651,28 +6662,38 @@ func (t *ProveCommitSectors3Params) UnmarshalCBOR(r io.Reader) (err error) { // t.AggregateProofType (abi.RegisteredAggregationProof) (int64) { - maj, extra, err := cr.ReadHeader() - var extraI int64 + + b, err := cr.ReadByte() if err != nil { return err } - switch maj { - case cbg.MajUnsignedInt: - extraI = int64(extra) - if extraI < 0 { - return fmt.Errorf("int64 positive overflow") + if b != cbg.CborNull[0] { + if err := cr.UnreadByte(); err != nil { + return err } - case cbg.MajNegativeInt: - extraI = int64(extra) - if extraI < 0 { - return fmt.Errorf("int64 negative overflow") + maj, extra, err = cr.ReadHeader() + var extraI int64 + if err != nil { + return err } - extraI = -1 - extraI - default: - return fmt.Errorf("wrong type for int64 field: %d", maj) + switch maj { + case cbg.MajUnsignedInt: + extraI = int64(extra) + if extraI < 0 { + return fmt.Errorf("int64 positive overflow") + } + case cbg.MajNegativeInt: + extraI = int64(extra) + if extraI < 0 { + return fmt.Errorf("int64 negative overflow") + } + extraI = -1 - extraI + default: + return fmt.Errorf("wrong type for int64 field: %d", maj) + } + t.AggregateProofType = &extraI } - t.AggregateProofType = abi.RegisteredAggregationProof(extraI) } // t.RequireActivationSuccess (bool) (bool) @@ -6732,7 +6753,7 @@ func (t *SectorActivationManifest) MarshalCBOR(w io.Writer) error { } // t.Pieces ([]miner.PieceActivationManifest) (slice) - if len(t.Pieces) > cbg.MaxLength { + if uint64(len(t.Pieces)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Pieces was too long") } @@ -6858,7 +6879,7 @@ func (t *PieceActivationManifest) MarshalCBOR(w io.Writer) error { } // t.Notify ([]miner.DataActivationNotification) (slice) - if len(t.Notify) > cbg.MaxLength { + if uint64(len(t.Notify)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Notify was too long") } @@ -7086,7 +7107,7 @@ func (t *DataActivationNotification) MarshalCBOR(w io.Writer) error { } // t.Payload ([]uint8) (slice) - if len(t.Payload) > cbg.ByteArrayMaxLen { + if uint64(len(t.Payload)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.Payload was too long") } @@ -7179,7 +7200,7 @@ func (t *BatchReturn) MarshalCBOR(w io.Writer) error { } // t.FailCodes ([]miner.FailCode) (slice) - if len(t.FailCodes) > cbg.MaxLength { + if uint64(len(t.FailCodes)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.FailCodes was too long") } @@ -7303,6 +7324,7 @@ func (t *FailCode) MarshalCBOR(w io.Writer) error { return err } } + return nil } @@ -7386,7 +7408,7 @@ func (t *ProveReplicaUpdates3Params) MarshalCBOR(w io.Writer) error { } // t.SectorUpdates ([]miner.SectorUpdateManifest) (slice) - if len(t.SectorUpdates) > cbg.MaxLength { + if uint64(len(t.SectorUpdates)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.SectorUpdates was too long") } @@ -7401,7 +7423,7 @@ func (t *ProveReplicaUpdates3Params) MarshalCBOR(w io.Writer) error { } // t.SectorProofs ([][]uint8) (slice) - if len(t.SectorProofs) > cbg.MaxLength { + if uint64(len(t.SectorProofs)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.SectorProofs was too long") } @@ -7409,7 +7431,7 @@ func (t *ProveReplicaUpdates3Params) MarshalCBOR(w io.Writer) error { return err } for _, v := range t.SectorProofs { - if len(v) > cbg.ByteArrayMaxLen { + if uint64(len(v)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field v was too long") } @@ -7424,7 +7446,7 @@ func (t *ProveReplicaUpdates3Params) MarshalCBOR(w io.Writer) error { } // t.AggregateProof ([]uint8) (slice) - if len(t.AggregateProof) > cbg.ByteArrayMaxLen { + if uint64(len(t.AggregateProof)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.AggregateProof was too long") } @@ -7448,13 +7470,19 @@ func (t *ProveReplicaUpdates3Params) MarshalCBOR(w io.Writer) error { } // t.AggregateProofType (abi.RegisteredAggregationProof) (int64) - if t.AggregateProofType >= 0 { - if err := cw.WriteMajorTypeHeader(cbg.MajUnsignedInt, uint64(t.AggregateProofType)); err != nil { + if t.AggregateProofType == nil { + if _, err := cw.Write(cbg.CborNull); err != nil { return err } } else { - if err := cw.WriteMajorTypeHeader(cbg.MajNegativeInt, uint64(-t.AggregateProofType-1)); err != nil { - return err + if *t.AggregateProofType >= 0 { + if err := cw.WriteMajorTypeHeader(cbg.MajUnsignedInt, uint64(*t.AggregateProofType)); err != nil { + return err + } + } else { + if err := cw.WriteMajorTypeHeader(cbg.MajNegativeInt, uint64(-*t.AggregateProofType-1)); err != nil { + return err + } } } @@ -7630,28 +7658,38 @@ func (t *ProveReplicaUpdates3Params) UnmarshalCBOR(r io.Reader) (err error) { } // t.AggregateProofType (abi.RegisteredAggregationProof) (int64) { - maj, extra, err := cr.ReadHeader() - var extraI int64 + + b, err := cr.ReadByte() if err != nil { return err } - switch maj { - case cbg.MajUnsignedInt: - extraI = int64(extra) - if extraI < 0 { - return fmt.Errorf("int64 positive overflow") + if b != cbg.CborNull[0] { + if err := cr.UnreadByte(); err != nil { + return err } - case cbg.MajNegativeInt: - extraI = int64(extra) - if extraI < 0 { - return fmt.Errorf("int64 negative overflow") + maj, extra, err = cr.ReadHeader() + var extraI int64 + if err != nil { + return err } - extraI = -1 - extraI - default: - return fmt.Errorf("wrong type for int64 field: %d", maj) + switch maj { + case cbg.MajUnsignedInt: + extraI = int64(extra) + if extraI < 0 { + return fmt.Errorf("int64 positive overflow") + } + case cbg.MajNegativeInt: + extraI = int64(extra) + if extraI < 0 { + return fmt.Errorf("int64 negative overflow") + } + extraI = -1 - extraI + default: + return fmt.Errorf("wrong type for int64 field: %d", maj) + } + t.AggregateProofType = &extraI } - t.AggregateProofType = abi.RegisteredAggregationProof(extraI) } // t.RequireActivationSuccess (bool) (bool) @@ -7729,7 +7767,7 @@ func (t *SectorUpdateManifest) MarshalCBOR(w io.Writer) error { } // t.Pieces ([]miner.PieceActivationManifest) (slice) - if len(t.Pieces) > cbg.MaxLength { + if uint64(len(t.Pieces)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Pieces was too long") } @@ -7895,7 +7933,7 @@ func (t *SectorChanges) MarshalCBOR(w io.Writer) error { } // t.Added ([]miner.PieceChange) (slice) - if len(t.Added) > cbg.MaxLength { + if uint64(len(t.Added)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Added was too long") } @@ -8041,7 +8079,7 @@ func (t *PieceChange) MarshalCBOR(w io.Writer) error { } // t.Payload ([]uint8) (slice) - if len(t.Payload) > cbg.ByteArrayMaxLen { + if uint64(len(t.Payload)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.Payload was too long") } @@ -8363,6 +8401,7 @@ func (t *ExpirationExtension) MarshalCBOR(w io.Writer) error { return err } } + return nil } @@ -8665,7 +8704,7 @@ func (t *ReplicaUpdate) MarshalCBOR(w io.Writer) error { } // t.Deals ([]abi.DealID) (slice) - if len(t.Deals) > cbg.MaxLength { + if uint64(len(t.Deals)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Deals was too long") } @@ -8692,7 +8731,7 @@ func (t *ReplicaUpdate) MarshalCBOR(w io.Writer) error { } // t.ReplicaProof ([]uint8) (slice) - if len(t.ReplicaProof) > cbg.ByteArrayMaxLen { + if uint64(len(t.ReplicaProof)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.ReplicaProof was too long") } @@ -8922,7 +8961,7 @@ func (t *ReplicaUpdate2) MarshalCBOR(w io.Writer) error { } // t.Deals ([]abi.DealID) (slice) - if len(t.Deals) > cbg.MaxLength { + if uint64(len(t.Deals)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Deals was too long") } @@ -8949,7 +8988,7 @@ func (t *ReplicaUpdate2) MarshalCBOR(w io.Writer) error { } // t.ReplicaProof ([]uint8) (slice) - if len(t.ReplicaProof) > cbg.ByteArrayMaxLen { + if uint64(len(t.ReplicaProof)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.ReplicaProof was too long") } @@ -9178,7 +9217,7 @@ func (t *ExpirationExtension2) MarshalCBOR(w io.Writer) error { } // t.SectorsWithClaims ([]miner.SectorClaim) (slice) - if len(t.SectorsWithClaims) > cbg.MaxLength { + if uint64(len(t.SectorsWithClaims)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.SectorsWithClaims was too long") } @@ -9202,6 +9241,7 @@ func (t *ExpirationExtension2) MarshalCBOR(w io.Writer) error { return err } } + return nil } @@ -9352,7 +9392,7 @@ func (t *SectorClaim) MarshalCBOR(w io.Writer) error { } // t.MaintainClaims ([]verifreg.ClaimId) (slice) - if len(t.MaintainClaims) > cbg.MaxLength { + if uint64(len(t.MaintainClaims)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.MaintainClaims was too long") } @@ -9368,7 +9408,7 @@ func (t *SectorClaim) MarshalCBOR(w io.Writer) error { } // t.DropClaims ([]verifreg.ClaimId) (slice) - if len(t.DropClaims) > cbg.MaxLength { + if uint64(len(t.DropClaims)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.DropClaims was too long") } diff --git a/builtin/v13/miner/miner_types.go b/builtin/v13/miner/miner_types.go index f9f0c956..fabc5105 100644 --- a/builtin/v13/miner/miner_types.go +++ b/builtin/v13/miner/miner_types.go @@ -400,7 +400,7 @@ type ProveCommitSectors3Params struct { SectorActivations []SectorActivationManifest SectorProofs [][]byte AggregateProof []byte - AggregateProofType abi.RegisteredAggregationProof + AggregateProofType *abi.RegisteredAggregationProof RequireActivationSuccess bool RequireNotificationSuccess bool } @@ -454,7 +454,7 @@ type ProveReplicaUpdates3Params struct { SectorProofs [][]byte AggregateProof []byte UpdateProofsType abi.RegisteredUpdateProof - AggregateProofType abi.RegisteredAggregationProof + AggregateProofType *abi.RegisteredAggregationProof RequireActivationSuccess bool RequireNotificationSuccess bool } diff --git a/builtin/v13/multisig/cbor_gen.go b/builtin/v13/multisig/cbor_gen.go index c5b4f9d9..c28dfdf4 100644 --- a/builtin/v13/multisig/cbor_gen.go +++ b/builtin/v13/multisig/cbor_gen.go @@ -36,7 +36,7 @@ func (t *State) MarshalCBOR(w io.Writer) error { } // t.Signers ([]address.Address) (slice) - if len(t.Signers) > cbg.MaxLength { + if uint64(len(t.Signers)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Signers was too long") } @@ -308,7 +308,7 @@ func (t *Transaction) MarshalCBOR(w io.Writer) error { } // t.Params ([]uint8) (slice) - if len(t.Params) > cbg.ByteArrayMaxLen { + if uint64(len(t.Params)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.Params was too long") } @@ -321,7 +321,7 @@ func (t *Transaction) MarshalCBOR(w io.Writer) error { } // t.Approved ([]address.Address) (slice) - if len(t.Approved) > cbg.MaxLength { + if uint64(len(t.Approved)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Approved was too long") } @@ -491,7 +491,7 @@ func (t *ProposalHashData) MarshalCBOR(w io.Writer) error { } // t.Params ([]uint8) (slice) - if len(t.Params) > cbg.ByteArrayMaxLen { + if uint64(len(t.Params)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.Params was too long") } @@ -610,7 +610,7 @@ func (t *ConstructorParams) MarshalCBOR(w io.Writer) error { } // t.Signers ([]address.Address) (slice) - if len(t.Signers) > cbg.MaxLength { + if uint64(len(t.Signers)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Signers was too long") } @@ -651,6 +651,7 @@ func (t *ConstructorParams) MarshalCBOR(w io.Writer) error { return err } } + return nil } @@ -813,7 +814,7 @@ func (t *ProposeParams) MarshalCBOR(w io.Writer) error { } // t.Params ([]uint8) (slice) - if len(t.Params) > cbg.ByteArrayMaxLen { + if uint64(len(t.Params)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.Params was too long") } @@ -950,7 +951,7 @@ func (t *ProposeReturn) MarshalCBOR(w io.Writer) error { } // t.Ret ([]uint8) (slice) - if len(t.Ret) > cbg.ByteArrayMaxLen { + if uint64(len(t.Ret)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.Ret was too long") } @@ -1262,7 +1263,7 @@ func (t *TxnIDParams) MarshalCBOR(w io.Writer) error { } // t.ProposalHash ([]uint8) (slice) - if len(t.ProposalHash) > cbg.ByteArrayMaxLen { + if uint64(len(t.ProposalHash)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.ProposalHash was too long") } @@ -1381,7 +1382,7 @@ func (t *ApproveReturn) MarshalCBOR(w io.Writer) error { } // t.Ret ([]uint8) (slice) - if len(t.Ret) > cbg.ByteArrayMaxLen { + if uint64(len(t.Ret)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.Ret was too long") } diff --git a/builtin/v13/paych/cbor_gen.go b/builtin/v13/paych/cbor_gen.go index f53c5e62..b4e06f44 100644 --- a/builtin/v13/paych/cbor_gen.go +++ b/builtin/v13/paych/cbor_gen.go @@ -362,7 +362,7 @@ func (t *UpdateChannelStateParams) MarshalCBOR(w io.Writer) error { } // t.Secret ([]uint8) (slice) - if len(t.Secret) > cbg.ByteArrayMaxLen { + if uint64(len(t.Secret)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.Secret was too long") } @@ -476,7 +476,7 @@ func (t *SignedVoucher) MarshalCBOR(w io.Writer) error { } // t.SecretHash ([]uint8) (slice) - if len(t.SecretHash) > cbg.ByteArrayMaxLen { + if uint64(len(t.SecretHash)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.SecretHash was too long") } @@ -522,7 +522,7 @@ func (t *SignedVoucher) MarshalCBOR(w io.Writer) error { } // t.Merges ([]paych.Merge) (slice) - if len(t.Merges) > cbg.MaxLength { + if uint64(len(t.Merges)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Merges was too long") } @@ -814,7 +814,7 @@ func (t *ModVerifyParams) MarshalCBOR(w io.Writer) error { } // t.Data ([]uint8) (slice) - if len(t.Data) > cbg.ByteArrayMaxLen { + if uint64(len(t.Data)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.Data was too long") } diff --git a/builtin/v13/power/cbor_gen.go b/builtin/v13/power/cbor_gen.go index 883b0b4c..827e4263 100644 --- a/builtin/v13/power/cbor_gen.go +++ b/builtin/v13/power/cbor_gen.go @@ -568,7 +568,7 @@ func (t *MinerConstructorParams) MarshalCBOR(w io.Writer) error { } // t.ControlAddrs ([]address.Address) (slice) - if len(t.ControlAddrs) > cbg.MaxLength { + if uint64(len(t.ControlAddrs)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.ControlAddrs was too long") } @@ -594,7 +594,7 @@ func (t *MinerConstructorParams) MarshalCBOR(w io.Writer) error { } // t.PeerId ([]uint8) (slice) - if len(t.PeerId) > cbg.ByteArrayMaxLen { + if uint64(len(t.PeerId)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.PeerId was too long") } @@ -607,7 +607,7 @@ func (t *MinerConstructorParams) MarshalCBOR(w io.Writer) error { } // t.Multiaddrs ([][]uint8) (slice) - if len(t.Multiaddrs) > cbg.MaxLength { + if uint64(len(t.Multiaddrs)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Multiaddrs was too long") } @@ -615,7 +615,7 @@ func (t *MinerConstructorParams) MarshalCBOR(w io.Writer) error { return err } for _, v := range t.Multiaddrs { - if len(v) > cbg.ByteArrayMaxLen { + if uint64(len(v)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field v was too long") } @@ -846,7 +846,7 @@ func (t *CreateMinerParams) MarshalCBOR(w io.Writer) error { } // t.Peer ([]uint8) (slice) - if len(t.Peer) > cbg.ByteArrayMaxLen { + if uint64(len(t.Peer)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.Peer was too long") } @@ -859,7 +859,7 @@ func (t *CreateMinerParams) MarshalCBOR(w io.Writer) error { } // t.Multiaddrs ([][]uint8) (slice) - if len(t.Multiaddrs) > cbg.MaxLength { + if uint64(len(t.Multiaddrs)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Multiaddrs was too long") } @@ -867,7 +867,7 @@ func (t *CreateMinerParams) MarshalCBOR(w io.Writer) error { return err } for _, v := range t.Multiaddrs { - if len(v) > cbg.ByteArrayMaxLen { + if uint64(len(v)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field v was too long") } @@ -1218,7 +1218,7 @@ func (t *EnrollCronEventParams) MarshalCBOR(w io.Writer) error { } // t.Payload ([]uint8) (slice) - if len(t.Payload) > cbg.ByteArrayMaxLen { + if uint64(len(t.Payload)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.Payload was too long") } @@ -1404,7 +1404,7 @@ func (t *CronEvent) MarshalCBOR(w io.Writer) error { } // t.CallbackPayload ([]uint8) (slice) - if len(t.CallbackPayload) > cbg.ByteArrayMaxLen { + if uint64(len(t.CallbackPayload)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.CallbackPayload was too long") } diff --git a/builtin/v13/reward/cbor_gen.go b/builtin/v13/reward/cbor_gen.go index d3365367..ec29a320 100644 --- a/builtin/v13/reward/cbor_gen.go +++ b/builtin/v13/reward/cbor_gen.go @@ -368,6 +368,7 @@ func (t *AwardBlockRewardParams) MarshalCBOR(w io.Writer) error { return err } } + return nil } diff --git a/builtin/v13/verifreg/cbor_gen.go b/builtin/v13/verifreg/cbor_gen.go index 230e422b..e16c254b 100644 --- a/builtin/v13/verifreg/cbor_gen.go +++ b/builtin/v13/verifreg/cbor_gen.go @@ -638,7 +638,7 @@ func (t *RemoveExpiredAllocationsParams) MarshalCBOR(w io.Writer) error { } // t.AllocationIds ([]verifreg.AllocationId) (slice) - if len(t.AllocationIds) > cbg.MaxLength { + if uint64(len(t.AllocationIds)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.AllocationIds was too long") } @@ -753,7 +753,7 @@ func (t *RemoveExpiredAllocationsReturn) MarshalCBOR(w io.Writer) error { } // t.Considered ([]verifreg.AllocationId) (slice) - if len(t.Considered) > cbg.MaxLength { + if uint64(len(t.Considered)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Considered was too long") } @@ -888,7 +888,7 @@ func (t *BatchReturn) MarshalCBOR(w io.Writer) error { } // t.FailCodes ([]verifreg.FailCode) (slice) - if len(t.FailCodes) > cbg.MaxLength { + if uint64(len(t.FailCodes)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.FailCodes was too long") } @@ -997,7 +997,7 @@ func (t *ClaimAllocationsParams) MarshalCBOR(w io.Writer) error { } // t.Sectors ([]verifreg.SectorAllocationClaim) (slice) - if len(t.Sectors) > cbg.MaxLength { + if uint64(len(t.Sectors)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Sectors was too long") } @@ -1190,7 +1190,7 @@ func (t *GetClaimsParams) MarshalCBOR(w io.Writer) error { } // t.ClaimIds ([]verifreg.ClaimId) (slice) - if len(t.ClaimIds) > cbg.MaxLength { + if uint64(len(t.ClaimIds)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.ClaimIds was too long") } @@ -1310,7 +1310,7 @@ func (t *GetClaimsReturn) MarshalCBOR(w io.Writer) error { } // t.Claims ([]verifreg.Claim) (slice) - if len(t.Claims) > cbg.MaxLength { + if uint64(len(t.Claims)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Claims was too long") } @@ -1420,7 +1420,7 @@ func (t *UniversalReceiverParams) MarshalCBOR(w io.Writer) error { } // t.Payload ([]uint8) (slice) - if len(t.Payload) > cbg.ByteArrayMaxLen { + if uint64(len(t.Payload)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.Payload was too long") } @@ -1522,7 +1522,7 @@ func (t *AllocationsResponse) MarshalCBOR(w io.Writer) error { } // t.NewAllocations ([]verifreg.AllocationId) (slice) - if len(t.NewAllocations) > cbg.MaxLength { + if uint64(len(t.NewAllocations)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.NewAllocations was too long") } @@ -1641,7 +1641,7 @@ func (t *ExtendClaimTermsParams) MarshalCBOR(w io.Writer) error { } // t.Terms ([]verifreg.ClaimTerm) (slice) - if len(t.Terms) > cbg.MaxLength { + if uint64(len(t.Terms)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Terms was too long") } @@ -1742,7 +1742,7 @@ func (t *ExtendClaimTermsReturn) MarshalCBOR(w io.Writer) error { } // t.FailCodes ([]verifreg.FailCode) (slice) - if len(t.FailCodes) > cbg.MaxLength { + if uint64(len(t.FailCodes)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.FailCodes was too long") } @@ -1857,7 +1857,7 @@ func (t *RemoveExpiredClaimsParams) MarshalCBOR(w io.Writer) error { } // t.ClaimIds ([]verifreg.ClaimId) (slice) - if len(t.ClaimIds) > cbg.MaxLength { + if uint64(len(t.ClaimIds)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.ClaimIds was too long") } @@ -1972,7 +1972,7 @@ func (t *RemoveExpiredClaimsReturn) MarshalCBOR(w io.Writer) error { } // t.Considered ([]verifreg.AllocationId) (slice) - if len(t.Considered) > cbg.MaxLength { + if uint64(len(t.Considered)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Considered was too long") } @@ -2319,6 +2319,7 @@ func (t *FailCode) MarshalCBOR(w io.Writer) error { return err } } + return nil } @@ -2441,6 +2442,7 @@ func (t *SectorAllocationClaim) MarshalCBOR(w io.Writer) error { return err } } + return nil } @@ -2848,6 +2850,7 @@ func (t *ClaimTerm) MarshalCBOR(w io.Writer) error { return err } } + return nil } @@ -2965,6 +2968,7 @@ func (t *ClaimExtensionRequest) MarshalCBOR(w io.Writer) error { return err } } + return nil } @@ -3112,6 +3116,7 @@ func (t *Allocation) MarshalCBOR(w io.Writer) error { return err } } + return nil } @@ -3334,6 +3339,7 @@ func (t *AllocationRequest) MarshalCBOR(w io.Writer) error { return err } } + return nil } @@ -3493,7 +3499,7 @@ func (t *AllocationRequests) MarshalCBOR(w io.Writer) error { } // t.Allocations ([]verifreg.AllocationRequest) (slice) - if len(t.Allocations) > cbg.MaxLength { + if uint64(len(t.Allocations)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Allocations was too long") } @@ -3508,7 +3514,7 @@ func (t *AllocationRequests) MarshalCBOR(w io.Writer) error { } // t.Extensions ([]verifreg.ClaimExtensionRequest) (slice) - if len(t.Extensions) > cbg.MaxLength { + if uint64(len(t.Extensions)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Extensions was too long") } diff --git a/builtin/v8/cron/cbor_gen.go b/builtin/v8/cron/cbor_gen.go index 013f8f58..73deb41d 100644 --- a/builtin/v8/cron/cbor_gen.go +++ b/builtin/v8/cron/cbor_gen.go @@ -34,7 +34,7 @@ func (t *State) MarshalCBOR(w io.Writer) error { } // t.Entries ([]cron.Entry) (slice) - if len(t.Entries) > cbg.MaxLength { + if uint64(len(t.Entries)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Entries was too long") } diff --git a/builtin/v8/init/cbor_gen.go b/builtin/v8/init/cbor_gen.go index 7d64308d..ddb5664f 100644 --- a/builtin/v8/init/cbor_gen.go +++ b/builtin/v8/init/cbor_gen.go @@ -46,7 +46,7 @@ func (t *State) MarshalCBOR(w io.Writer) error { } // t.NetworkName (string) (string) - if len(t.NetworkName) > cbg.MaxLength { + if uint64(len(t.NetworkName)) > cbg.MaxLength { return xerrors.Errorf("Value in field t.NetworkName was too long") } @@ -136,7 +136,7 @@ func (t *ConstructorParams) MarshalCBOR(w io.Writer) error { } // t.NetworkName (string) (string) - if len(t.NetworkName) > cbg.MaxLength { + if uint64(len(t.NetworkName)) > cbg.MaxLength { return xerrors.Errorf("Value in field t.NetworkName was too long") } @@ -206,7 +206,7 @@ func (t *ExecParams) MarshalCBOR(w io.Writer) error { } // t.ConstructorParams ([]uint8) (slice) - if len(t.ConstructorParams) > cbg.ByteArrayMaxLen { + if uint64(len(t.ConstructorParams)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.ConstructorParams was too long") } diff --git a/builtin/v8/market/cbor_gen.go b/builtin/v8/market/cbor_gen.go index 599ce610..4cfec096 100644 --- a/builtin/v8/market/cbor_gen.go +++ b/builtin/v8/market/cbor_gen.go @@ -313,6 +313,7 @@ func (t *DealState) MarshalCBOR(w io.Writer) error { return err } } + return nil } @@ -502,7 +503,7 @@ func (t *PublishStorageDealsParams) MarshalCBOR(w io.Writer) error { } // t.Deals ([]market.ClientDealProposal) (slice) - if len(t.Deals) > cbg.MaxLength { + if uint64(len(t.Deals)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Deals was too long") } @@ -597,7 +598,7 @@ func (t *PublishStorageDealsReturn) MarshalCBOR(w io.Writer) error { } // t.IDs ([]abi.DealID) (slice) - if len(t.IDs) > cbg.MaxLength { + if uint64(len(t.IDs)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.IDs was too long") } @@ -712,7 +713,7 @@ func (t *ActivateDealsParams) MarshalCBOR(w io.Writer) error { } // t.DealIDs ([]abi.DealID) (slice) - if len(t.DealIDs) > cbg.MaxLength { + if uint64(len(t.DealIDs)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.DealIDs was too long") } @@ -737,6 +738,7 @@ func (t *ActivateDealsParams) MarshalCBOR(w io.Writer) error { return err } } + return nil } @@ -849,7 +851,7 @@ func (t *VerifyDealsForActivationParams) MarshalCBOR(w io.Writer) error { } // t.Sectors ([]market.SectorDeals) (slice) - if len(t.Sectors) > cbg.MaxLength { + if uint64(len(t.Sectors)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Sectors was too long") } @@ -944,7 +946,7 @@ func (t *VerifyDealsForActivationReturn) MarshalCBOR(w io.Writer) error { } // t.Sectors ([]market.SectorWeights) (slice) - if len(t.Sectors) > cbg.MaxLength { + if uint64(len(t.Sectors)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Sectors was too long") } @@ -1039,7 +1041,7 @@ func (t *ComputeDataCommitmentParams) MarshalCBOR(w io.Writer) error { } // t.Inputs ([]*market.SectorDataSpec) (slice) - if len(t.Inputs) > cbg.MaxLength { + if uint64(len(t.Inputs)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Inputs was too long") } @@ -1144,7 +1146,7 @@ func (t *ComputeDataCommitmentReturn) MarshalCBOR(w io.Writer) error { } // t.CommDs ([]typegen.CborCid) (slice) - if len(t.CommDs) > cbg.MaxLength { + if uint64(len(t.CommDs)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.CommDs was too long") } @@ -1250,7 +1252,7 @@ func (t *OnMinerSectorsTerminateParams) MarshalCBOR(w io.Writer) error { } // t.DealIDs ([]abi.DealID) (slice) - if len(t.DealIDs) > cbg.MaxLength { + if uint64(len(t.DealIDs)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.DealIDs was too long") } @@ -1715,7 +1717,7 @@ func (t *SectorDeals) MarshalCBOR(w io.Writer) error { } // t.DealIDs ([]abi.DealID) (slice) - if len(t.DealIDs) > cbg.MaxLength { + if uint64(len(t.DealIDs)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.DealIDs was too long") } @@ -1931,7 +1933,7 @@ func (t *SectorDataSpec) MarshalCBOR(w io.Writer) error { } // t.DealIDs ([]abi.DealID) (slice) - if len(t.DealIDs) > cbg.MaxLength { + if uint64(len(t.DealIDs)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.DealIDs was too long") } @@ -1956,6 +1958,7 @@ func (t *SectorDataSpec) MarshalCBOR(w io.Writer) error { return err } } + return nil } diff --git a/builtin/v8/market/deal.go b/builtin/v8/market/deal.go index c6c2da20..5393d4e8 100644 --- a/builtin/v8/market/deal.go +++ b/builtin/v8/market/deal.go @@ -109,7 +109,7 @@ func (label *DealLabel) MarshalCBOR(w io.Writer) error { _, err := io.WriteString(w, string("")) return err } - if len(label.bs) > cbg.ByteArrayMaxLen { + if uint64(len(label.bs)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("label is too long to marshal (%d), max allowed (%d)", len(label.bs), cbg.ByteArrayMaxLen) } diff --git a/builtin/v8/miner/cbor_gen.go b/builtin/v8/miner/cbor_gen.go index 95d39068..cd1a1b73 100644 --- a/builtin/v8/miner/cbor_gen.go +++ b/builtin/v8/miner/cbor_gen.go @@ -362,7 +362,7 @@ func (t *MinerInfo) MarshalCBOR(w io.Writer) error { } // t.ControlAddresses ([]address.Address) (slice) - if len(t.ControlAddresses) > cbg.MaxLength { + if uint64(len(t.ControlAddresses)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.ControlAddresses was too long") } @@ -382,7 +382,7 @@ func (t *MinerInfo) MarshalCBOR(w io.Writer) error { } // t.PeerId ([]uint8) (slice) - if len(t.PeerId) > cbg.ByteArrayMaxLen { + if uint64(len(t.PeerId)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.PeerId was too long") } @@ -395,7 +395,7 @@ func (t *MinerInfo) MarshalCBOR(w io.Writer) error { } // t.Multiaddrs ([][]uint8) (slice) - if len(t.Multiaddrs) > cbg.MaxLength { + if uint64(len(t.Multiaddrs)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Multiaddrs was too long") } @@ -403,7 +403,7 @@ func (t *MinerInfo) MarshalCBOR(w io.Writer) error { return err } for _, v := range t.Multiaddrs { - if len(v) > cbg.ByteArrayMaxLen { + if uint64(len(v)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field v was too long") } @@ -743,7 +743,7 @@ func (t *Deadlines) MarshalCBOR(w io.Writer) error { } // t.Due ([48]cid.Cid) (array) - if len(t.Due) > cbg.MaxLength { + if uint64(len(t.Due)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Due was too long") } @@ -1629,7 +1629,7 @@ func (t *SectorPreCommitInfo) MarshalCBOR(w io.Writer) error { } // t.DealIDs ([]abi.DealID) (slice) - if len(t.DealIDs) > cbg.MaxLength { + if uint64(len(t.DealIDs)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.DealIDs was too long") } @@ -1948,7 +1948,7 @@ func (t *SectorOnChainInfo) MarshalCBOR(w io.Writer) error { } // t.DealIDs ([]abi.DealID) (slice) - if len(t.DealIDs) > cbg.MaxLength { + if uint64(len(t.DealIDs)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.DealIDs was too long") } @@ -2341,6 +2341,7 @@ func (t *WorkerKeyChange) MarshalCBOR(w io.Writer) error { return err } } + return nil } @@ -2419,7 +2420,7 @@ func (t *VestingFunds) MarshalCBOR(w io.Writer) error { } // t.Funds ([]miner.VestingFund) (slice) - if len(t.Funds) > cbg.MaxLength { + if uint64(len(t.Funds)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Funds was too long") } @@ -2611,7 +2612,7 @@ func (t *WindowedPoSt) MarshalCBOR(w io.Writer) error { } // t.Proofs ([]proof.PoStProof) (slice) - if len(t.Proofs) > cbg.MaxLength { + if uint64(len(t.Proofs)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Proofs was too long") } @@ -2725,7 +2726,7 @@ func (t *GetControlAddressesReturn) MarshalCBOR(w io.Writer) error { } // t.ControlAddrs ([]address.Address) (slice) - if len(t.ControlAddrs) > cbg.MaxLength { + if uint64(len(t.ControlAddrs)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.ControlAddrs was too long") } @@ -2843,7 +2844,7 @@ func (t *ChangeWorkerAddressParams) MarshalCBOR(w io.Writer) error { } // t.NewControlAddrs ([]address.Address) (slice) - if len(t.NewControlAddrs) > cbg.MaxLength { + if uint64(len(t.NewControlAddrs)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.NewControlAddrs was too long") } @@ -2947,7 +2948,7 @@ func (t *ChangePeerIDParams) MarshalCBOR(w io.Writer) error { } // t.NewID ([]uint8) (slice) - if len(t.NewID) > cbg.ByteArrayMaxLen { + if uint64(len(t.NewID)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.NewID was too long") } @@ -3031,7 +3032,7 @@ func (t *SubmitWindowedPoStParams) MarshalCBOR(w io.Writer) error { } // t.Partitions ([]miner.PoStPartition) (slice) - if len(t.Partitions) > cbg.MaxLength { + if uint64(len(t.Partitions)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Partitions was too long") } @@ -3046,7 +3047,7 @@ func (t *SubmitWindowedPoStParams) MarshalCBOR(w io.Writer) error { } // t.Proofs ([]proof.PoStProof) (slice) - if len(t.Proofs) > cbg.MaxLength { + if uint64(len(t.Proofs)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Proofs was too long") } @@ -3072,7 +3073,7 @@ func (t *SubmitWindowedPoStParams) MarshalCBOR(w io.Writer) error { } // t.ChainCommitRand (abi.Randomness) (slice) - if len(t.ChainCommitRand) > cbg.ByteArrayMaxLen { + if uint64(len(t.ChainCommitRand)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.ChainCommitRand was too long") } @@ -3299,7 +3300,7 @@ func (t *PreCommitSectorParams) MarshalCBOR(w io.Writer) error { } // t.DealIDs ([]abi.DealID) (slice) - if len(t.DealIDs) > cbg.MaxLength { + if uint64(len(t.DealIDs)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.DealIDs was too long") } @@ -3601,7 +3602,7 @@ func (t *ProveCommitSectorParams) MarshalCBOR(w io.Writer) error { } // t.Proof ([]uint8) (slice) - if len(t.Proof) > cbg.ByteArrayMaxLen { + if uint64(len(t.Proof)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.Proof was too long") } @@ -3693,7 +3694,7 @@ func (t *ExtendSectorExpirationParams) MarshalCBOR(w io.Writer) error { } // t.Extensions ([]miner.ExpirationExtension) (slice) - if len(t.Extensions) > cbg.MaxLength { + if uint64(len(t.Extensions)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Extensions was too long") } @@ -3788,7 +3789,7 @@ func (t *TerminateSectorsParams) MarshalCBOR(w io.Writer) error { } // t.Terminations ([]miner.TerminationDeclaration) (slice) - if len(t.Terminations) > cbg.MaxLength { + if uint64(len(t.Terminations)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Terminations was too long") } @@ -3947,7 +3948,7 @@ func (t *DeclareFaultsParams) MarshalCBOR(w io.Writer) error { } // t.Faults ([]miner.FaultDeclaration) (slice) - if len(t.Faults) > cbg.MaxLength { + if uint64(len(t.Faults)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Faults was too long") } @@ -4042,7 +4043,7 @@ func (t *DeclareFaultsRecoveredParams) MarshalCBOR(w io.Writer) error { } // t.Recoveries ([]miner.RecoveryDeclaration) (slice) - if len(t.Recoveries) > cbg.MaxLength { + if uint64(len(t.Recoveries)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Recoveries was too long") } @@ -4137,7 +4138,7 @@ func (t *DeferredCronEventParams) MarshalCBOR(w io.Writer) error { } // t.EventPayload ([]uint8) (slice) - if len(t.EventPayload) > cbg.ByteArrayMaxLen { + if uint64(len(t.EventPayload)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.EventPayload was too long") } @@ -4375,7 +4376,7 @@ func (t *ReportConsensusFaultParams) MarshalCBOR(w io.Writer) error { } // t.BlockHeader1 ([]uint8) (slice) - if len(t.BlockHeader1) > cbg.ByteArrayMaxLen { + if uint64(len(t.BlockHeader1)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.BlockHeader1 was too long") } @@ -4388,7 +4389,7 @@ func (t *ReportConsensusFaultParams) MarshalCBOR(w io.Writer) error { } // t.BlockHeader2 ([]uint8) (slice) - if len(t.BlockHeader2) > cbg.ByteArrayMaxLen { + if uint64(len(t.BlockHeader2)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.BlockHeader2 was too long") } @@ -4401,7 +4402,7 @@ func (t *ReportConsensusFaultParams) MarshalCBOR(w io.Writer) error { } // t.BlockHeaderExtra ([]uint8) (slice) - if len(t.BlockHeaderExtra) > cbg.ByteArrayMaxLen { + if uint64(len(t.BlockHeaderExtra)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.BlockHeaderExtra was too long") } @@ -4579,7 +4580,7 @@ func (t *ConfirmSectorProofsParams) MarshalCBOR(w io.Writer) error { } // t.Sectors ([]abi.SectorNumber) (slice) - if len(t.Sectors) > cbg.MaxLength { + if uint64(len(t.Sectors)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Sectors was too long") } @@ -4722,7 +4723,7 @@ func (t *ChangeMultiaddrsParams) MarshalCBOR(w io.Writer) error { } // t.NewMultiaddrs ([][]uint8) (slice) - if len(t.NewMultiaddrs) > cbg.MaxLength { + if uint64(len(t.NewMultiaddrs)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.NewMultiaddrs was too long") } @@ -4730,7 +4731,7 @@ func (t *ChangeMultiaddrsParams) MarshalCBOR(w io.Writer) error { return err } for _, v := range t.NewMultiaddrs { - if len(v) > cbg.ByteArrayMaxLen { + if uint64(len(v)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field v was too long") } @@ -5052,7 +5053,7 @@ func (t *PreCommitSectorBatchParams) MarshalCBOR(w io.Writer) error { } // t.Sectors ([]miner.SectorPreCommitInfo) (slice) - if len(t.Sectors) > cbg.MaxLength { + if uint64(len(t.Sectors)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Sectors was too long") } @@ -5152,7 +5153,7 @@ func (t *ProveCommitAggregateParams) MarshalCBOR(w io.Writer) error { } // t.AggregateProof ([]uint8) (slice) - if len(t.AggregateProof) > cbg.ByteArrayMaxLen { + if uint64(len(t.AggregateProof)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.AggregateProof was too long") } @@ -5239,7 +5240,7 @@ func (t *ProveReplicaUpdatesParams) MarshalCBOR(w io.Writer) error { } // t.Updates ([]miner.ReplicaUpdate) (slice) - if len(t.Updates) > cbg.MaxLength { + if uint64(len(t.Updates)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Updates was too long") } @@ -5343,6 +5344,7 @@ func (t *CronEventPayload) MarshalCBOR(w io.Writer) error { return err } } + return nil } @@ -5630,6 +5632,7 @@ func (t *ExpirationExtension) MarshalCBOR(w io.Writer) error { return err } } + return nil } @@ -5932,7 +5935,7 @@ func (t *ReplicaUpdate) MarshalCBOR(w io.Writer) error { } // t.Deals ([]abi.DealID) (slice) - if len(t.Deals) > cbg.MaxLength { + if uint64(len(t.Deals)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Deals was too long") } @@ -5959,7 +5962,7 @@ func (t *ReplicaUpdate) MarshalCBOR(w io.Writer) error { } // t.ReplicaProof ([]uint8) (slice) - if len(t.ReplicaProof) > cbg.ByteArrayMaxLen { + if uint64(len(t.ReplicaProof)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.ReplicaProof was too long") } diff --git a/builtin/v8/multisig/cbor_gen.go b/builtin/v8/multisig/cbor_gen.go index c5b4f9d9..c28dfdf4 100644 --- a/builtin/v8/multisig/cbor_gen.go +++ b/builtin/v8/multisig/cbor_gen.go @@ -36,7 +36,7 @@ func (t *State) MarshalCBOR(w io.Writer) error { } // t.Signers ([]address.Address) (slice) - if len(t.Signers) > cbg.MaxLength { + if uint64(len(t.Signers)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Signers was too long") } @@ -308,7 +308,7 @@ func (t *Transaction) MarshalCBOR(w io.Writer) error { } // t.Params ([]uint8) (slice) - if len(t.Params) > cbg.ByteArrayMaxLen { + if uint64(len(t.Params)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.Params was too long") } @@ -321,7 +321,7 @@ func (t *Transaction) MarshalCBOR(w io.Writer) error { } // t.Approved ([]address.Address) (slice) - if len(t.Approved) > cbg.MaxLength { + if uint64(len(t.Approved)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Approved was too long") } @@ -491,7 +491,7 @@ func (t *ProposalHashData) MarshalCBOR(w io.Writer) error { } // t.Params ([]uint8) (slice) - if len(t.Params) > cbg.ByteArrayMaxLen { + if uint64(len(t.Params)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.Params was too long") } @@ -610,7 +610,7 @@ func (t *ConstructorParams) MarshalCBOR(w io.Writer) error { } // t.Signers ([]address.Address) (slice) - if len(t.Signers) > cbg.MaxLength { + if uint64(len(t.Signers)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Signers was too long") } @@ -651,6 +651,7 @@ func (t *ConstructorParams) MarshalCBOR(w io.Writer) error { return err } } + return nil } @@ -813,7 +814,7 @@ func (t *ProposeParams) MarshalCBOR(w io.Writer) error { } // t.Params ([]uint8) (slice) - if len(t.Params) > cbg.ByteArrayMaxLen { + if uint64(len(t.Params)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.Params was too long") } @@ -950,7 +951,7 @@ func (t *ProposeReturn) MarshalCBOR(w io.Writer) error { } // t.Ret ([]uint8) (slice) - if len(t.Ret) > cbg.ByteArrayMaxLen { + if uint64(len(t.Ret)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.Ret was too long") } @@ -1262,7 +1263,7 @@ func (t *TxnIDParams) MarshalCBOR(w io.Writer) error { } // t.ProposalHash ([]uint8) (slice) - if len(t.ProposalHash) > cbg.ByteArrayMaxLen { + if uint64(len(t.ProposalHash)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.ProposalHash was too long") } @@ -1381,7 +1382,7 @@ func (t *ApproveReturn) MarshalCBOR(w io.Writer) error { } // t.Ret ([]uint8) (slice) - if len(t.Ret) > cbg.ByteArrayMaxLen { + if uint64(len(t.Ret)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.Ret was too long") } diff --git a/builtin/v8/paych/cbor_gen.go b/builtin/v8/paych/cbor_gen.go index f53c5e62..b4e06f44 100644 --- a/builtin/v8/paych/cbor_gen.go +++ b/builtin/v8/paych/cbor_gen.go @@ -362,7 +362,7 @@ func (t *UpdateChannelStateParams) MarshalCBOR(w io.Writer) error { } // t.Secret ([]uint8) (slice) - if len(t.Secret) > cbg.ByteArrayMaxLen { + if uint64(len(t.Secret)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.Secret was too long") } @@ -476,7 +476,7 @@ func (t *SignedVoucher) MarshalCBOR(w io.Writer) error { } // t.SecretHash ([]uint8) (slice) - if len(t.SecretHash) > cbg.ByteArrayMaxLen { + if uint64(len(t.SecretHash)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.SecretHash was too long") } @@ -522,7 +522,7 @@ func (t *SignedVoucher) MarshalCBOR(w io.Writer) error { } // t.Merges ([]paych.Merge) (slice) - if len(t.Merges) > cbg.MaxLength { + if uint64(len(t.Merges)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Merges was too long") } @@ -814,7 +814,7 @@ func (t *ModVerifyParams) MarshalCBOR(w io.Writer) error { } // t.Data ([]uint8) (slice) - if len(t.Data) > cbg.ByteArrayMaxLen { + if uint64(len(t.Data)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.Data was too long") } diff --git a/builtin/v8/power/cbor_gen.go b/builtin/v8/power/cbor_gen.go index 67c51152..d28e889e 100644 --- a/builtin/v8/power/cbor_gen.go +++ b/builtin/v8/power/cbor_gen.go @@ -568,7 +568,7 @@ func (t *MinerConstructorParams) MarshalCBOR(w io.Writer) error { } // t.ControlAddrs ([]address.Address) (slice) - if len(t.ControlAddrs) > cbg.MaxLength { + if uint64(len(t.ControlAddrs)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.ControlAddrs was too long") } @@ -594,7 +594,7 @@ func (t *MinerConstructorParams) MarshalCBOR(w io.Writer) error { } // t.PeerId ([]uint8) (slice) - if len(t.PeerId) > cbg.ByteArrayMaxLen { + if uint64(len(t.PeerId)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.PeerId was too long") } @@ -607,7 +607,7 @@ func (t *MinerConstructorParams) MarshalCBOR(w io.Writer) error { } // t.Multiaddrs ([][]uint8) (slice) - if len(t.Multiaddrs) > cbg.MaxLength { + if uint64(len(t.Multiaddrs)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Multiaddrs was too long") } @@ -615,7 +615,7 @@ func (t *MinerConstructorParams) MarshalCBOR(w io.Writer) error { return err } for _, v := range t.Multiaddrs { - if len(v) > cbg.ByteArrayMaxLen { + if uint64(len(v)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field v was too long") } @@ -846,7 +846,7 @@ func (t *CreateMinerParams) MarshalCBOR(w io.Writer) error { } // t.Peer ([]uint8) (slice) - if len(t.Peer) > cbg.ByteArrayMaxLen { + if uint64(len(t.Peer)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.Peer was too long") } @@ -859,7 +859,7 @@ func (t *CreateMinerParams) MarshalCBOR(w io.Writer) error { } // t.Multiaddrs ([][]uint8) (slice) - if len(t.Multiaddrs) > cbg.MaxLength { + if uint64(len(t.Multiaddrs)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Multiaddrs was too long") } @@ -867,7 +867,7 @@ func (t *CreateMinerParams) MarshalCBOR(w io.Writer) error { return err } for _, v := range t.Multiaddrs { - if len(v) > cbg.ByteArrayMaxLen { + if uint64(len(v)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field v was too long") } @@ -1218,7 +1218,7 @@ func (t *EnrollCronEventParams) MarshalCBOR(w io.Writer) error { } // t.Payload ([]uint8) (slice) - if len(t.Payload) > cbg.ByteArrayMaxLen { + if uint64(len(t.Payload)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.Payload was too long") } @@ -1326,7 +1326,7 @@ func (t *CronEvent) MarshalCBOR(w io.Writer) error { } // t.CallbackPayload ([]uint8) (slice) - if len(t.CallbackPayload) > cbg.ByteArrayMaxLen { + if uint64(len(t.CallbackPayload)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.CallbackPayload was too long") } diff --git a/builtin/v8/reward/cbor_gen.go b/builtin/v8/reward/cbor_gen.go index d3365367..ec29a320 100644 --- a/builtin/v8/reward/cbor_gen.go +++ b/builtin/v8/reward/cbor_gen.go @@ -368,6 +368,7 @@ func (t *AwardBlockRewardParams) MarshalCBOR(w io.Writer) error { return err } } + return nil } diff --git a/builtin/v9/account/cbor_gen.go b/builtin/v9/account/cbor_gen.go index 4a49915b..0bd09be2 100644 --- a/builtin/v9/account/cbor_gen.go +++ b/builtin/v9/account/cbor_gen.go @@ -89,7 +89,7 @@ func (t *AuthenticateMessageParams) MarshalCBOR(w io.Writer) error { } // t.Signature ([]uint8) (slice) - if len(t.Signature) > cbg.ByteArrayMaxLen { + if uint64(len(t.Signature)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.Signature was too long") } @@ -102,7 +102,7 @@ func (t *AuthenticateMessageParams) MarshalCBOR(w io.Writer) error { } // t.Message ([]uint8) (slice) - if len(t.Message) > cbg.ByteArrayMaxLen { + if uint64(len(t.Message)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.Message was too long") } diff --git a/builtin/v9/cron/cbor_gen.go b/builtin/v9/cron/cbor_gen.go index 013f8f58..73deb41d 100644 --- a/builtin/v9/cron/cbor_gen.go +++ b/builtin/v9/cron/cbor_gen.go @@ -34,7 +34,7 @@ func (t *State) MarshalCBOR(w io.Writer) error { } // t.Entries ([]cron.Entry) (slice) - if len(t.Entries) > cbg.MaxLength { + if uint64(len(t.Entries)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Entries was too long") } diff --git a/builtin/v9/datacap/cbor_gen.go b/builtin/v9/datacap/cbor_gen.go index 4f61008b..42c936a6 100644 --- a/builtin/v9/datacap/cbor_gen.go +++ b/builtin/v9/datacap/cbor_gen.go @@ -227,7 +227,7 @@ func (t *MintParams) MarshalCBOR(w io.Writer) error { } // t.Operators ([]address.Address) (slice) - if len(t.Operators) > cbg.MaxLength { + if uint64(len(t.Operators)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Operators was too long") } @@ -350,7 +350,7 @@ func (t *MintReturn) MarshalCBOR(w io.Writer) error { } // t.RecipientData ([]uint8) (slice) - if len(t.RecipientData) > cbg.ByteArrayMaxLen { + if uint64(len(t.RecipientData)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.RecipientData was too long") } @@ -526,7 +526,7 @@ func (t *TransferParams) MarshalCBOR(w io.Writer) error { } // t.OperatorData ([]uint8) (slice) - if len(t.OperatorData) > cbg.ByteArrayMaxLen { + if uint64(len(t.OperatorData)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.OperatorData was too long") } @@ -632,7 +632,7 @@ func (t *TransferReturn) MarshalCBOR(w io.Writer) error { } // t.RecipientData ([]uint8) (slice) - if len(t.RecipientData) > cbg.ByteArrayMaxLen { + if uint64(len(t.RecipientData)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.RecipientData was too long") } @@ -743,7 +743,7 @@ func (t *TransferFromParams) MarshalCBOR(w io.Writer) error { } // t.OperatorData ([]uint8) (slice) - if len(t.OperatorData) > cbg.ByteArrayMaxLen { + if uint64(len(t.OperatorData)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.OperatorData was too long") } @@ -863,7 +863,7 @@ func (t *TransferFromReturn) MarshalCBOR(w io.Writer) error { } // t.RecipientData ([]uint8) (slice) - if len(t.RecipientData) > cbg.ByteArrayMaxLen { + if uint64(len(t.RecipientData)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.RecipientData was too long") } diff --git a/builtin/v9/init/cbor_gen.go b/builtin/v9/init/cbor_gen.go index 7d64308d..ddb5664f 100644 --- a/builtin/v9/init/cbor_gen.go +++ b/builtin/v9/init/cbor_gen.go @@ -46,7 +46,7 @@ func (t *State) MarshalCBOR(w io.Writer) error { } // t.NetworkName (string) (string) - if len(t.NetworkName) > cbg.MaxLength { + if uint64(len(t.NetworkName)) > cbg.MaxLength { return xerrors.Errorf("Value in field t.NetworkName was too long") } @@ -136,7 +136,7 @@ func (t *ConstructorParams) MarshalCBOR(w io.Writer) error { } // t.NetworkName (string) (string) - if len(t.NetworkName) > cbg.MaxLength { + if uint64(len(t.NetworkName)) > cbg.MaxLength { return xerrors.Errorf("Value in field t.NetworkName was too long") } @@ -206,7 +206,7 @@ func (t *ExecParams) MarshalCBOR(w io.Writer) error { } // t.ConstructorParams ([]uint8) (slice) - if len(t.ConstructorParams) > cbg.ByteArrayMaxLen { + if uint64(len(t.ConstructorParams)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.ConstructorParams was too long") } diff --git a/builtin/v9/init/init_actor_state.go b/builtin/v9/init/init_actor_state.go index 28f1e229..fca70b59 100644 --- a/builtin/v9/init/init_actor_state.go +++ b/builtin/v9/init/init_actor_state.go @@ -130,7 +130,7 @@ func (d *InstalledActors) MarshalCBOR(w io.Writer) error { scratch := make([]byte, 9) - if len(d.Entries) > cbg.MaxLength { + if uint64(len(d.Entries)) > cbg.MaxLength { return fmt.Errorf("too many installed actor entries") } diff --git a/builtin/v9/market/cbor_gen.go b/builtin/v9/market/cbor_gen.go index ac3fea63..f8939df4 100644 --- a/builtin/v9/market/cbor_gen.go +++ b/builtin/v9/market/cbor_gen.go @@ -543,7 +543,7 @@ func (t *PublishStorageDealsParams) MarshalCBOR(w io.Writer) error { } // t.Deals ([]market.ClientDealProposal) (slice) - if len(t.Deals) > cbg.MaxLength { + if uint64(len(t.Deals)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Deals was too long") } @@ -638,7 +638,7 @@ func (t *PublishStorageDealsReturn) MarshalCBOR(w io.Writer) error { } // t.IDs ([]abi.DealID) (slice) - if len(t.IDs) > cbg.MaxLength { + if uint64(len(t.IDs)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.IDs was too long") } @@ -753,7 +753,7 @@ func (t *ActivateDealsParams) MarshalCBOR(w io.Writer) error { } // t.DealIDs ([]abi.DealID) (slice) - if len(t.DealIDs) > cbg.MaxLength { + if uint64(len(t.DealIDs)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.DealIDs was too long") } @@ -778,6 +778,7 @@ func (t *ActivateDealsParams) MarshalCBOR(w io.Writer) error { return err } } + return nil } @@ -895,7 +896,7 @@ func (t *ActivateDealsResult) MarshalCBOR(w io.Writer) error { } // t.VerifiedInfos ([]market.VerifiedDealInfo) (slice) - if len(t.VerifiedInfos) > cbg.MaxLength { + if uint64(len(t.VerifiedInfos)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.VerifiedInfos was too long") } @@ -999,7 +1000,7 @@ func (t *VerifyDealsForActivationParams) MarshalCBOR(w io.Writer) error { } // t.Sectors ([]market.SectorDeals) (slice) - if len(t.Sectors) > cbg.MaxLength { + if uint64(len(t.Sectors)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Sectors was too long") } @@ -1094,7 +1095,7 @@ func (t *VerifyDealsForActivationReturn) MarshalCBOR(w io.Writer) error { } // t.Sectors ([]market.SectorDealData) (slice) - if len(t.Sectors) > cbg.MaxLength { + if uint64(len(t.Sectors)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Sectors was too long") } @@ -1189,7 +1190,7 @@ func (t *ComputeDataCommitmentParams) MarshalCBOR(w io.Writer) error { } // t.Inputs ([]*market.SectorDataSpec) (slice) - if len(t.Inputs) > cbg.MaxLength { + if uint64(len(t.Inputs)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Inputs was too long") } @@ -1294,7 +1295,7 @@ func (t *ComputeDataCommitmentReturn) MarshalCBOR(w io.Writer) error { } // t.CommDs ([]typegen.CborCid) (slice) - if len(t.CommDs) > cbg.MaxLength { + if uint64(len(t.CommDs)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.CommDs was too long") } @@ -1400,7 +1401,7 @@ func (t *OnMinerSectorsTerminateParams) MarshalCBOR(w io.Writer) error { } // t.DealIDs ([]abi.DealID) (slice) - if len(t.DealIDs) > cbg.MaxLength { + if uint64(len(t.DealIDs)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.DealIDs was too long") } @@ -1876,7 +1877,7 @@ func (t *SectorDeals) MarshalCBOR(w io.Writer) error { } // t.DealIDs ([]abi.DealID) (slice) - if len(t.DealIDs) > cbg.MaxLength { + if uint64(len(t.DealIDs)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.DealIDs was too long") } @@ -2174,7 +2175,7 @@ func (t *SectorDataSpec) MarshalCBOR(w io.Writer) error { } // t.DealIDs ([]abi.DealID) (slice) - if len(t.DealIDs) > cbg.MaxLength { + if uint64(len(t.DealIDs)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.DealIDs was too long") } @@ -2199,6 +2200,7 @@ func (t *SectorDataSpec) MarshalCBOR(w io.Writer) error { return err } } + return nil } diff --git a/builtin/v9/market/deal.go b/builtin/v9/market/deal.go index 147ff7bc..fca7d9d4 100644 --- a/builtin/v9/market/deal.go +++ b/builtin/v9/market/deal.go @@ -112,7 +112,7 @@ func (label *DealLabel) MarshalCBOR(w io.Writer) error { _, err := io.WriteString(w, string("")) return err } - if len(label.bs) > cbg.ByteArrayMaxLen { + if uint64(len(label.bs)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("label is too long to marshal (%d), max allowed (%d)", len(label.bs), cbg.ByteArrayMaxLen) } diff --git a/builtin/v9/miner/cbor_gen.go b/builtin/v9/miner/cbor_gen.go index c4a69b10..5dc35eda 100644 --- a/builtin/v9/miner/cbor_gen.go +++ b/builtin/v9/miner/cbor_gen.go @@ -363,7 +363,7 @@ func (t *MinerInfo) MarshalCBOR(w io.Writer) error { } // t.ControlAddresses ([]address.Address) (slice) - if len(t.ControlAddresses) > cbg.MaxLength { + if uint64(len(t.ControlAddresses)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.ControlAddresses was too long") } @@ -383,7 +383,7 @@ func (t *MinerInfo) MarshalCBOR(w io.Writer) error { } // t.PeerId ([]uint8) (slice) - if len(t.PeerId) > cbg.ByteArrayMaxLen { + if uint64(len(t.PeerId)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.PeerId was too long") } @@ -396,7 +396,7 @@ func (t *MinerInfo) MarshalCBOR(w io.Writer) error { } // t.Multiaddrs ([][]uint8) (slice) - if len(t.Multiaddrs) > cbg.MaxLength { + if uint64(len(t.Multiaddrs)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Multiaddrs was too long") } @@ -404,7 +404,7 @@ func (t *MinerInfo) MarshalCBOR(w io.Writer) error { return err } for _, v := range t.Multiaddrs { - if len(v) > cbg.ByteArrayMaxLen { + if uint64(len(v)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field v was too long") } @@ -796,7 +796,7 @@ func (t *Deadlines) MarshalCBOR(w io.Writer) error { } // t.Due ([48]cid.Cid) (array) - if len(t.Due) > cbg.MaxLength { + if uint64(len(t.Due)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Due was too long") } @@ -1533,6 +1533,7 @@ func (t *SectorPreCommitOnChainInfo) MarshalCBOR(w io.Writer) error { return err } } + return nil } @@ -1654,7 +1655,7 @@ func (t *SectorPreCommitInfo) MarshalCBOR(w io.Writer) error { } // t.DealIDs ([]abi.DealID) (slice) - if len(t.DealIDs) > cbg.MaxLength { + if uint64(len(t.DealIDs)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.DealIDs was too long") } @@ -1925,7 +1926,7 @@ func (t *SectorOnChainInfo) MarshalCBOR(w io.Writer) error { } // t.DealIDs ([]abi.DealID) (slice) - if len(t.DealIDs) > cbg.MaxLength { + if uint64(len(t.DealIDs)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.DealIDs was too long") } @@ -2339,6 +2340,7 @@ func (t *WorkerKeyChange) MarshalCBOR(w io.Writer) error { return err } } + return nil } @@ -2417,7 +2419,7 @@ func (t *VestingFunds) MarshalCBOR(w io.Writer) error { } // t.Funds ([]miner.VestingFund) (slice) - if len(t.Funds) > cbg.MaxLength { + if uint64(len(t.Funds)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Funds was too long") } @@ -2609,7 +2611,7 @@ func (t *WindowedPoSt) MarshalCBOR(w io.Writer) error { } // t.Proofs ([]proof.PoStProof) (slice) - if len(t.Proofs) > cbg.MaxLength { + if uint64(len(t.Proofs)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Proofs was too long") } @@ -2802,6 +2804,7 @@ func (t *BeneficiaryTerm) MarshalCBOR(w io.Writer) error { return err } } + return nil } @@ -3049,7 +3052,7 @@ func (t *GetControlAddressesReturn) MarshalCBOR(w io.Writer) error { } // t.ControlAddrs ([]address.Address) (slice) - if len(t.ControlAddrs) > cbg.MaxLength { + if uint64(len(t.ControlAddrs)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.ControlAddrs was too long") } @@ -3167,7 +3170,7 @@ func (t *ChangeWorkerAddressParams) MarshalCBOR(w io.Writer) error { } // t.NewControlAddrs ([]address.Address) (slice) - if len(t.NewControlAddrs) > cbg.MaxLength { + if uint64(len(t.NewControlAddrs)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.NewControlAddrs was too long") } @@ -3271,7 +3274,7 @@ func (t *ChangePeerIDParams) MarshalCBOR(w io.Writer) error { } // t.NewID ([]uint8) (slice) - if len(t.NewID) > cbg.ByteArrayMaxLen { + if uint64(len(t.NewID)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.NewID was too long") } @@ -3355,7 +3358,7 @@ func (t *SubmitWindowedPoStParams) MarshalCBOR(w io.Writer) error { } // t.Partitions ([]miner.PoStPartition) (slice) - if len(t.Partitions) > cbg.MaxLength { + if uint64(len(t.Partitions)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Partitions was too long") } @@ -3370,7 +3373,7 @@ func (t *SubmitWindowedPoStParams) MarshalCBOR(w io.Writer) error { } // t.Proofs ([]proof.PoStProof) (slice) - if len(t.Proofs) > cbg.MaxLength { + if uint64(len(t.Proofs)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Proofs was too long") } @@ -3396,7 +3399,7 @@ func (t *SubmitWindowedPoStParams) MarshalCBOR(w io.Writer) error { } // t.ChainCommitRand (abi.Randomness) (slice) - if len(t.ChainCommitRand) > cbg.ByteArrayMaxLen { + if uint64(len(t.ChainCommitRand)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.ChainCommitRand was too long") } @@ -3623,7 +3626,7 @@ func (t *PreCommitSectorParams) MarshalCBOR(w io.Writer) error { } // t.DealIDs ([]abi.DealID) (slice) - if len(t.DealIDs) > cbg.MaxLength { + if uint64(len(t.DealIDs)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.DealIDs was too long") } @@ -3925,7 +3928,7 @@ func (t *ProveCommitSectorParams) MarshalCBOR(w io.Writer) error { } // t.Proof ([]uint8) (slice) - if len(t.Proof) > cbg.ByteArrayMaxLen { + if uint64(len(t.Proof)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.Proof was too long") } @@ -4017,7 +4020,7 @@ func (t *ExtendSectorExpirationParams) MarshalCBOR(w io.Writer) error { } // t.Extensions ([]miner.ExpirationExtension) (slice) - if len(t.Extensions) > cbg.MaxLength { + if uint64(len(t.Extensions)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Extensions was too long") } @@ -4112,7 +4115,7 @@ func (t *ExtendSectorExpiration2Params) MarshalCBOR(w io.Writer) error { } // t.Extensions ([]miner.ExpirationExtension2) (slice) - if len(t.Extensions) > cbg.MaxLength { + if uint64(len(t.Extensions)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Extensions was too long") } @@ -4207,7 +4210,7 @@ func (t *TerminateSectorsParams) MarshalCBOR(w io.Writer) error { } // t.Terminations ([]miner.TerminationDeclaration) (slice) - if len(t.Terminations) > cbg.MaxLength { + if uint64(len(t.Terminations)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Terminations was too long") } @@ -4366,7 +4369,7 @@ func (t *DeclareFaultsParams) MarshalCBOR(w io.Writer) error { } // t.Faults ([]miner.FaultDeclaration) (slice) - if len(t.Faults) > cbg.MaxLength { + if uint64(len(t.Faults)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Faults was too long") } @@ -4461,7 +4464,7 @@ func (t *DeclareFaultsRecoveredParams) MarshalCBOR(w io.Writer) error { } // t.Recoveries ([]miner.RecoveryDeclaration) (slice) - if len(t.Recoveries) > cbg.MaxLength { + if uint64(len(t.Recoveries)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Recoveries was too long") } @@ -4556,7 +4559,7 @@ func (t *DeferredCronEventParams) MarshalCBOR(w io.Writer) error { } // t.EventPayload ([]uint8) (slice) - if len(t.EventPayload) > cbg.ByteArrayMaxLen { + if uint64(len(t.EventPayload)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.EventPayload was too long") } @@ -4794,7 +4797,7 @@ func (t *ReportConsensusFaultParams) MarshalCBOR(w io.Writer) error { } // t.BlockHeader1 ([]uint8) (slice) - if len(t.BlockHeader1) > cbg.ByteArrayMaxLen { + if uint64(len(t.BlockHeader1)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.BlockHeader1 was too long") } @@ -4807,7 +4810,7 @@ func (t *ReportConsensusFaultParams) MarshalCBOR(w io.Writer) error { } // t.BlockHeader2 ([]uint8) (slice) - if len(t.BlockHeader2) > cbg.ByteArrayMaxLen { + if uint64(len(t.BlockHeader2)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.BlockHeader2 was too long") } @@ -4820,7 +4823,7 @@ func (t *ReportConsensusFaultParams) MarshalCBOR(w io.Writer) error { } // t.BlockHeaderExtra ([]uint8) (slice) - if len(t.BlockHeaderExtra) > cbg.ByteArrayMaxLen { + if uint64(len(t.BlockHeaderExtra)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.BlockHeaderExtra was too long") } @@ -4998,7 +5001,7 @@ func (t *ConfirmSectorProofsParams) MarshalCBOR(w io.Writer) error { } // t.Sectors ([]abi.SectorNumber) (slice) - if len(t.Sectors) > cbg.MaxLength { + if uint64(len(t.Sectors)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Sectors was too long") } @@ -5141,7 +5144,7 @@ func (t *ChangeMultiaddrsParams) MarshalCBOR(w io.Writer) error { } // t.NewMultiaddrs ([][]uint8) (slice) - if len(t.NewMultiaddrs) > cbg.MaxLength { + if uint64(len(t.NewMultiaddrs)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.NewMultiaddrs was too long") } @@ -5149,7 +5152,7 @@ func (t *ChangeMultiaddrsParams) MarshalCBOR(w io.Writer) error { return err } for _, v := range t.NewMultiaddrs { - if len(v) > cbg.ByteArrayMaxLen { + if uint64(len(v)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field v was too long") } @@ -5471,7 +5474,7 @@ func (t *PreCommitSectorBatchParams) MarshalCBOR(w io.Writer) error { } // t.Sectors ([]miner.PreCommitSectorParams) (slice) - if len(t.Sectors) > cbg.MaxLength { + if uint64(len(t.Sectors)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Sectors was too long") } @@ -5571,7 +5574,7 @@ func (t *ProveCommitAggregateParams) MarshalCBOR(w io.Writer) error { } // t.AggregateProof ([]uint8) (slice) - if len(t.AggregateProof) > cbg.ByteArrayMaxLen { + if uint64(len(t.AggregateProof)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.AggregateProof was too long") } @@ -5658,7 +5661,7 @@ func (t *ProveReplicaUpdatesParams) MarshalCBOR(w io.Writer) error { } // t.Updates ([]miner.ReplicaUpdate) (slice) - if len(t.Updates) > cbg.MaxLength { + if uint64(len(t.Updates)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Updates was too long") } @@ -5762,6 +5765,7 @@ func (t *CronEventPayload) MarshalCBOR(w io.Writer) error { return err } } + return nil } @@ -5831,7 +5835,7 @@ func (t *PreCommitSectorBatchParams2) MarshalCBOR(w io.Writer) error { } // t.Sectors ([]miner.SectorPreCommitInfo) (slice) - if len(t.Sectors) > cbg.MaxLength { + if uint64(len(t.Sectors)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Sectors was too long") } @@ -5926,7 +5930,7 @@ func (t *ProveReplicaUpdatesParams2) MarshalCBOR(w io.Writer) error { } // t.Updates ([]miner.ReplicaUpdate2) (slice) - if len(t.Updates) > cbg.MaxLength { + if uint64(len(t.Updates)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Updates was too long") } @@ -6040,6 +6044,7 @@ func (t *ChangeBeneficiaryParams) MarshalCBOR(w io.Writer) error { return err } } + return nil } @@ -6425,6 +6430,7 @@ func (t *ExpirationExtension) MarshalCBOR(w io.Writer) error { return err } } + return nil } @@ -6727,7 +6733,7 @@ func (t *ReplicaUpdate) MarshalCBOR(w io.Writer) error { } // t.Deals ([]abi.DealID) (slice) - if len(t.Deals) > cbg.MaxLength { + if uint64(len(t.Deals)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Deals was too long") } @@ -6754,7 +6760,7 @@ func (t *ReplicaUpdate) MarshalCBOR(w io.Writer) error { } // t.ReplicaProof ([]uint8) (slice) - if len(t.ReplicaProof) > cbg.ByteArrayMaxLen { + if uint64(len(t.ReplicaProof)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.ReplicaProof was too long") } @@ -6984,7 +6990,7 @@ func (t *ReplicaUpdate2) MarshalCBOR(w io.Writer) error { } // t.Deals ([]abi.DealID) (slice) - if len(t.Deals) > cbg.MaxLength { + if uint64(len(t.Deals)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Deals was too long") } @@ -7011,7 +7017,7 @@ func (t *ReplicaUpdate2) MarshalCBOR(w io.Writer) error { } // t.ReplicaProof ([]uint8) (slice) - if len(t.ReplicaProof) > cbg.ByteArrayMaxLen { + if uint64(len(t.ReplicaProof)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.ReplicaProof was too long") } @@ -7240,7 +7246,7 @@ func (t *ExpirationExtension2) MarshalCBOR(w io.Writer) error { } // t.SectorsWithClaims ([]miner.SectorClaim) (slice) - if len(t.SectorsWithClaims) > cbg.MaxLength { + if uint64(len(t.SectorsWithClaims)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.SectorsWithClaims was too long") } @@ -7264,6 +7270,7 @@ func (t *ExpirationExtension2) MarshalCBOR(w io.Writer) error { return err } } + return nil } @@ -7414,7 +7421,7 @@ func (t *SectorClaim) MarshalCBOR(w io.Writer) error { } // t.MaintainClaims ([]verifreg.ClaimId) (slice) - if len(t.MaintainClaims) > cbg.MaxLength { + if uint64(len(t.MaintainClaims)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.MaintainClaims was too long") } @@ -7430,7 +7437,7 @@ func (t *SectorClaim) MarshalCBOR(w io.Writer) error { } // t.DropClaims ([]verifreg.ClaimId) (slice) - if len(t.DropClaims) > cbg.MaxLength { + if uint64(len(t.DropClaims)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.DropClaims was too long") } diff --git a/builtin/v9/multisig/cbor_gen.go b/builtin/v9/multisig/cbor_gen.go index c5b4f9d9..c28dfdf4 100644 --- a/builtin/v9/multisig/cbor_gen.go +++ b/builtin/v9/multisig/cbor_gen.go @@ -36,7 +36,7 @@ func (t *State) MarshalCBOR(w io.Writer) error { } // t.Signers ([]address.Address) (slice) - if len(t.Signers) > cbg.MaxLength { + if uint64(len(t.Signers)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Signers was too long") } @@ -308,7 +308,7 @@ func (t *Transaction) MarshalCBOR(w io.Writer) error { } // t.Params ([]uint8) (slice) - if len(t.Params) > cbg.ByteArrayMaxLen { + if uint64(len(t.Params)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.Params was too long") } @@ -321,7 +321,7 @@ func (t *Transaction) MarshalCBOR(w io.Writer) error { } // t.Approved ([]address.Address) (slice) - if len(t.Approved) > cbg.MaxLength { + if uint64(len(t.Approved)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Approved was too long") } @@ -491,7 +491,7 @@ func (t *ProposalHashData) MarshalCBOR(w io.Writer) error { } // t.Params ([]uint8) (slice) - if len(t.Params) > cbg.ByteArrayMaxLen { + if uint64(len(t.Params)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.Params was too long") } @@ -610,7 +610,7 @@ func (t *ConstructorParams) MarshalCBOR(w io.Writer) error { } // t.Signers ([]address.Address) (slice) - if len(t.Signers) > cbg.MaxLength { + if uint64(len(t.Signers)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Signers was too long") } @@ -651,6 +651,7 @@ func (t *ConstructorParams) MarshalCBOR(w io.Writer) error { return err } } + return nil } @@ -813,7 +814,7 @@ func (t *ProposeParams) MarshalCBOR(w io.Writer) error { } // t.Params ([]uint8) (slice) - if len(t.Params) > cbg.ByteArrayMaxLen { + if uint64(len(t.Params)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.Params was too long") } @@ -950,7 +951,7 @@ func (t *ProposeReturn) MarshalCBOR(w io.Writer) error { } // t.Ret ([]uint8) (slice) - if len(t.Ret) > cbg.ByteArrayMaxLen { + if uint64(len(t.Ret)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.Ret was too long") } @@ -1262,7 +1263,7 @@ func (t *TxnIDParams) MarshalCBOR(w io.Writer) error { } // t.ProposalHash ([]uint8) (slice) - if len(t.ProposalHash) > cbg.ByteArrayMaxLen { + if uint64(len(t.ProposalHash)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.ProposalHash was too long") } @@ -1381,7 +1382,7 @@ func (t *ApproveReturn) MarshalCBOR(w io.Writer) error { } // t.Ret ([]uint8) (slice) - if len(t.Ret) > cbg.ByteArrayMaxLen { + if uint64(len(t.Ret)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.Ret was too long") } diff --git a/builtin/v9/paych/cbor_gen.go b/builtin/v9/paych/cbor_gen.go index f53c5e62..b4e06f44 100644 --- a/builtin/v9/paych/cbor_gen.go +++ b/builtin/v9/paych/cbor_gen.go @@ -362,7 +362,7 @@ func (t *UpdateChannelStateParams) MarshalCBOR(w io.Writer) error { } // t.Secret ([]uint8) (slice) - if len(t.Secret) > cbg.ByteArrayMaxLen { + if uint64(len(t.Secret)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.Secret was too long") } @@ -476,7 +476,7 @@ func (t *SignedVoucher) MarshalCBOR(w io.Writer) error { } // t.SecretHash ([]uint8) (slice) - if len(t.SecretHash) > cbg.ByteArrayMaxLen { + if uint64(len(t.SecretHash)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.SecretHash was too long") } @@ -522,7 +522,7 @@ func (t *SignedVoucher) MarshalCBOR(w io.Writer) error { } // t.Merges ([]paych.Merge) (slice) - if len(t.Merges) > cbg.MaxLength { + if uint64(len(t.Merges)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Merges was too long") } @@ -814,7 +814,7 @@ func (t *ModVerifyParams) MarshalCBOR(w io.Writer) error { } // t.Data ([]uint8) (slice) - if len(t.Data) > cbg.ByteArrayMaxLen { + if uint64(len(t.Data)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.Data was too long") } diff --git a/builtin/v9/power/cbor_gen.go b/builtin/v9/power/cbor_gen.go index 67c51152..d28e889e 100644 --- a/builtin/v9/power/cbor_gen.go +++ b/builtin/v9/power/cbor_gen.go @@ -568,7 +568,7 @@ func (t *MinerConstructorParams) MarshalCBOR(w io.Writer) error { } // t.ControlAddrs ([]address.Address) (slice) - if len(t.ControlAddrs) > cbg.MaxLength { + if uint64(len(t.ControlAddrs)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.ControlAddrs was too long") } @@ -594,7 +594,7 @@ func (t *MinerConstructorParams) MarshalCBOR(w io.Writer) error { } // t.PeerId ([]uint8) (slice) - if len(t.PeerId) > cbg.ByteArrayMaxLen { + if uint64(len(t.PeerId)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.PeerId was too long") } @@ -607,7 +607,7 @@ func (t *MinerConstructorParams) MarshalCBOR(w io.Writer) error { } // t.Multiaddrs ([][]uint8) (slice) - if len(t.Multiaddrs) > cbg.MaxLength { + if uint64(len(t.Multiaddrs)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Multiaddrs was too long") } @@ -615,7 +615,7 @@ func (t *MinerConstructorParams) MarshalCBOR(w io.Writer) error { return err } for _, v := range t.Multiaddrs { - if len(v) > cbg.ByteArrayMaxLen { + if uint64(len(v)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field v was too long") } @@ -846,7 +846,7 @@ func (t *CreateMinerParams) MarshalCBOR(w io.Writer) error { } // t.Peer ([]uint8) (slice) - if len(t.Peer) > cbg.ByteArrayMaxLen { + if uint64(len(t.Peer)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.Peer was too long") } @@ -859,7 +859,7 @@ func (t *CreateMinerParams) MarshalCBOR(w io.Writer) error { } // t.Multiaddrs ([][]uint8) (slice) - if len(t.Multiaddrs) > cbg.MaxLength { + if uint64(len(t.Multiaddrs)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Multiaddrs was too long") } @@ -867,7 +867,7 @@ func (t *CreateMinerParams) MarshalCBOR(w io.Writer) error { return err } for _, v := range t.Multiaddrs { - if len(v) > cbg.ByteArrayMaxLen { + if uint64(len(v)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field v was too long") } @@ -1218,7 +1218,7 @@ func (t *EnrollCronEventParams) MarshalCBOR(w io.Writer) error { } // t.Payload ([]uint8) (slice) - if len(t.Payload) > cbg.ByteArrayMaxLen { + if uint64(len(t.Payload)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.Payload was too long") } @@ -1326,7 +1326,7 @@ func (t *CronEvent) MarshalCBOR(w io.Writer) error { } // t.CallbackPayload ([]uint8) (slice) - if len(t.CallbackPayload) > cbg.ByteArrayMaxLen { + if uint64(len(t.CallbackPayload)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.CallbackPayload was too long") } diff --git a/builtin/v9/reward/cbor_gen.go b/builtin/v9/reward/cbor_gen.go index d3365367..ec29a320 100644 --- a/builtin/v9/reward/cbor_gen.go +++ b/builtin/v9/reward/cbor_gen.go @@ -368,6 +368,7 @@ func (t *AwardBlockRewardParams) MarshalCBOR(w io.Writer) error { return err } } + return nil } diff --git a/builtin/v9/verifreg/cbor_gen.go b/builtin/v9/verifreg/cbor_gen.go index 230e422b..e16c254b 100644 --- a/builtin/v9/verifreg/cbor_gen.go +++ b/builtin/v9/verifreg/cbor_gen.go @@ -638,7 +638,7 @@ func (t *RemoveExpiredAllocationsParams) MarshalCBOR(w io.Writer) error { } // t.AllocationIds ([]verifreg.AllocationId) (slice) - if len(t.AllocationIds) > cbg.MaxLength { + if uint64(len(t.AllocationIds)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.AllocationIds was too long") } @@ -753,7 +753,7 @@ func (t *RemoveExpiredAllocationsReturn) MarshalCBOR(w io.Writer) error { } // t.Considered ([]verifreg.AllocationId) (slice) - if len(t.Considered) > cbg.MaxLength { + if uint64(len(t.Considered)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Considered was too long") } @@ -888,7 +888,7 @@ func (t *BatchReturn) MarshalCBOR(w io.Writer) error { } // t.FailCodes ([]verifreg.FailCode) (slice) - if len(t.FailCodes) > cbg.MaxLength { + if uint64(len(t.FailCodes)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.FailCodes was too long") } @@ -997,7 +997,7 @@ func (t *ClaimAllocationsParams) MarshalCBOR(w io.Writer) error { } // t.Sectors ([]verifreg.SectorAllocationClaim) (slice) - if len(t.Sectors) > cbg.MaxLength { + if uint64(len(t.Sectors)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Sectors was too long") } @@ -1190,7 +1190,7 @@ func (t *GetClaimsParams) MarshalCBOR(w io.Writer) error { } // t.ClaimIds ([]verifreg.ClaimId) (slice) - if len(t.ClaimIds) > cbg.MaxLength { + if uint64(len(t.ClaimIds)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.ClaimIds was too long") } @@ -1310,7 +1310,7 @@ func (t *GetClaimsReturn) MarshalCBOR(w io.Writer) error { } // t.Claims ([]verifreg.Claim) (slice) - if len(t.Claims) > cbg.MaxLength { + if uint64(len(t.Claims)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Claims was too long") } @@ -1420,7 +1420,7 @@ func (t *UniversalReceiverParams) MarshalCBOR(w io.Writer) error { } // t.Payload ([]uint8) (slice) - if len(t.Payload) > cbg.ByteArrayMaxLen { + if uint64(len(t.Payload)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.Payload was too long") } @@ -1522,7 +1522,7 @@ func (t *AllocationsResponse) MarshalCBOR(w io.Writer) error { } // t.NewAllocations ([]verifreg.AllocationId) (slice) - if len(t.NewAllocations) > cbg.MaxLength { + if uint64(len(t.NewAllocations)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.NewAllocations was too long") } @@ -1641,7 +1641,7 @@ func (t *ExtendClaimTermsParams) MarshalCBOR(w io.Writer) error { } // t.Terms ([]verifreg.ClaimTerm) (slice) - if len(t.Terms) > cbg.MaxLength { + if uint64(len(t.Terms)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Terms was too long") } @@ -1742,7 +1742,7 @@ func (t *ExtendClaimTermsReturn) MarshalCBOR(w io.Writer) error { } // t.FailCodes ([]verifreg.FailCode) (slice) - if len(t.FailCodes) > cbg.MaxLength { + if uint64(len(t.FailCodes)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.FailCodes was too long") } @@ -1857,7 +1857,7 @@ func (t *RemoveExpiredClaimsParams) MarshalCBOR(w io.Writer) error { } // t.ClaimIds ([]verifreg.ClaimId) (slice) - if len(t.ClaimIds) > cbg.MaxLength { + if uint64(len(t.ClaimIds)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.ClaimIds was too long") } @@ -1972,7 +1972,7 @@ func (t *RemoveExpiredClaimsReturn) MarshalCBOR(w io.Writer) error { } // t.Considered ([]verifreg.AllocationId) (slice) - if len(t.Considered) > cbg.MaxLength { + if uint64(len(t.Considered)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Considered was too long") } @@ -2319,6 +2319,7 @@ func (t *FailCode) MarshalCBOR(w io.Writer) error { return err } } + return nil } @@ -2441,6 +2442,7 @@ func (t *SectorAllocationClaim) MarshalCBOR(w io.Writer) error { return err } } + return nil } @@ -2848,6 +2850,7 @@ func (t *ClaimTerm) MarshalCBOR(w io.Writer) error { return err } } + return nil } @@ -2965,6 +2968,7 @@ func (t *ClaimExtensionRequest) MarshalCBOR(w io.Writer) error { return err } } + return nil } @@ -3112,6 +3116,7 @@ func (t *Allocation) MarshalCBOR(w io.Writer) error { return err } } + return nil } @@ -3334,6 +3339,7 @@ func (t *AllocationRequest) MarshalCBOR(w io.Writer) error { return err } } + return nil } @@ -3493,7 +3499,7 @@ func (t *AllocationRequests) MarshalCBOR(w io.Writer) error { } // t.Allocations ([]verifreg.AllocationRequest) (slice) - if len(t.Allocations) > cbg.MaxLength { + if uint64(len(t.Allocations)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Allocations was too long") } @@ -3508,7 +3514,7 @@ func (t *AllocationRequests) MarshalCBOR(w io.Writer) error { } // t.Extensions ([]verifreg.ClaimExtensionRequest) (slice) - if len(t.Extensions) > cbg.MaxLength { + if uint64(len(t.Extensions)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Extensions was too long") } diff --git a/go.mod b/go.mod index cc25d3df..1966584f 100644 --- a/go.mod +++ b/go.mod @@ -4,12 +4,14 @@ go 1.18 retract v0.12.7 // wrongfully skipped a patch version, use v0.12.6 or v0.12.8&^ +replace github.com/whyrusleeping/cbor-gen => ../../whyrusleeping/cbor-gen + require ( github.com/filecoin-project/go-address v1.1.0 - github.com/filecoin-project/go-amt-ipld/v4 v4.2.0 + github.com/filecoin-project/go-amt-ipld/v4 v4.2.1-0.20240206063011-8207d7a1e4ef github.com/filecoin-project/go-bitfield v0.2.4 github.com/filecoin-project/go-commp-utils/nonffi v0.0.0-20220905160352-62059082a837 - github.com/filecoin-project/go-hamt-ipld/v3 v3.1.0 + github.com/filecoin-project/go-hamt-ipld/v3 v3.3.1-0.20240206064418-6c31c2ab8045 github.com/ipfs/go-block-format v0.0.3 github.com/ipfs/go-cid v0.3.2 github.com/ipfs/go-ipld-cbor v0.0.6 @@ -20,8 +22,8 @@ require ( github.com/multiformats/go-multihash v0.2.1 github.com/multiformats/go-varint v0.0.6 github.com/stretchr/testify v1.7.0 - github.com/whyrusleeping/cbor-gen v0.0.0-20240124134906-0efd71a8493b - golang.org/x/crypto v0.1.0 + github.com/whyrusleeping/cbor-gen v0.0.0-20240202185644-fcdaca49d05c + golang.org/x/crypto v0.17.0 golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4 golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 ) @@ -39,7 +41,7 @@ require ( github.com/pmezard/go-difflib v1.0.0 // indirect github.com/polydawn/refmt v0.0.0-20201211092308-30ac6d18308e // indirect github.com/spaolacci/murmur3 v1.1.0 // indirect - golang.org/x/sys v0.1.0 // indirect - gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect + golang.org/x/sys v0.15.0 // indirect + gopkg.in/yaml.v3 v3.0.0 // indirect lukechampine.com/blake3 v1.1.6 // indirect ) diff --git a/go.sum b/go.sum index 804f2b7c..c991e443 100644 --- a/go.sum +++ b/go.sum @@ -8,8 +8,8 @@ github.com/filecoin-project/go-address v0.0.3/go.mod h1:jr8JxKsYx+lQlQZmF5i2U0Z+ github.com/filecoin-project/go-address v1.1.0 h1:ofdtUtEsNxkIxkDw67ecSmvtzaVSdcea4boAmLbnHfE= github.com/filecoin-project/go-address v1.1.0/go.mod h1:5t3z6qPmIADZBtuE9EIzi0EwzcRy2nVhpo0I/c1r0OA= github.com/filecoin-project/go-amt-ipld/v2 v2.1.0/go.mod h1:nfFPoGyX0CU9SkXX8EoCcSuHN1XcbN0c6KBh7yvP5fs= -github.com/filecoin-project/go-amt-ipld/v4 v4.2.0 h1:DQTXQwMXxaetd+lhZGODjt5qC1WYT7tMAlYrWqI/fwI= -github.com/filecoin-project/go-amt-ipld/v4 v4.2.0/go.mod h1:0eDVF7pROvxrsxvLJx+SJZXqRaXXcEPUcgb/rG0zGU4= +github.com/filecoin-project/go-amt-ipld/v4 v4.2.1-0.20240206063011-8207d7a1e4ef h1:d2a6kO4Nq8wnFzWC/+x967xZa3y0KrWB5cnnWTH693I= +github.com/filecoin-project/go-amt-ipld/v4 v4.2.1-0.20240206063011-8207d7a1e4ef/go.mod h1:yho4SqDGret1aOl53OnsBL0h7zgodUuzrwsADe0v9ho= github.com/filecoin-project/go-bitfield v0.2.0/go.mod h1:CNl9WG8hgR5mttCnUErjcQjGvuiZjRqK9rHVBsQF4oM= github.com/filecoin-project/go-bitfield v0.2.4 h1:uZ7MeE+XfM5lqrHJZ93OnhQKc/rveW8p9au0C68JPgk= github.com/filecoin-project/go-bitfield v0.2.4/go.mod h1:CNl9WG8hgR5mttCnUErjcQjGvuiZjRqK9rHVBsQF4oM= @@ -23,8 +23,8 @@ github.com/filecoin-project/go-fil-commcid v0.0.0-20200716160307-8f644712406f/go github.com/filecoin-project/go-fil-commcid v0.0.0-20201016201715-d41df56b4f6a/go.mod h1:Eaox7Hvus1JgPrL5+M3+h7aSPHc0cVqpSxA+TxIEpZQ= github.com/filecoin-project/go-fil-commcid v0.1.0 h1:3R4ds1A9r6cr8mvZBfMYxTS88OqLYEo6roi+GiIeOh8= github.com/filecoin-project/go-fil-commcid v0.1.0/go.mod h1:Eaox7Hvus1JgPrL5+M3+h7aSPHc0cVqpSxA+TxIEpZQ= -github.com/filecoin-project/go-hamt-ipld/v3 v3.1.0 h1:rVVNq0x6RGQIzCo1iiJlGFm9AGIZzeifggxtKMU7zmI= -github.com/filecoin-project/go-hamt-ipld/v3 v3.1.0/go.mod h1:bxmzgT8tmeVQA1/gvBwFmYdT8SOFUwB3ovSUfG1Ux0g= +github.com/filecoin-project/go-hamt-ipld/v3 v3.3.1-0.20240206064418-6c31c2ab8045 h1:w2Ydu6hiPnxR9lDIbHKU5i31Ho+1pGtN5xTk2i7/sII= +github.com/filecoin-project/go-hamt-ipld/v3 v3.3.1-0.20240206064418-6c31c2ab8045/go.mod h1:LOii7J9ZDSEeMK9jTfYFbStSqD0FlyA0qKoep7w36jw= github.com/filecoin-project/go-padreader v0.0.0-20200903213702-ed5fae088b20/go.mod h1:mPn+LRRd5gEKNAtc+r3ScpW2JRU/pj4NBKdADYWHiak= github.com/filecoin-project/go-state-types v0.0.0-20200903145444-247639ffa6ad/go.mod h1:IQ0MBPnonv35CJHtWSN3YY1Hz2gkPru1Q9qoaYLxx9I= github.com/filecoin-project/go-state-types v0.0.0-20200904021452-1883f36ca2f4/go.mod h1:IQ0MBPnonv35CJHtWSN3YY1Hz2gkPru1Q9qoaYLxx9I= @@ -48,7 +48,6 @@ github.com/ipfs/go-cid v0.0.1/go.mod h1:GHWU/WuQdMPmIosc4Yn1bcCT7dSeX4lBafM7iqUP github.com/ipfs/go-cid v0.0.2/go.mod h1:GHWU/WuQdMPmIosc4Yn1bcCT7dSeX4lBafM7iqUPQvM= github.com/ipfs/go-cid v0.0.3/go.mod h1:GHWU/WuQdMPmIosc4Yn1bcCT7dSeX4lBafM7iqUPQvM= github.com/ipfs/go-cid v0.0.5/go.mod h1:plgt+Y5MnOey4vO4UlUazGqdbEXuFYitED67FexhXog= -github.com/ipfs/go-cid v0.0.6-0.20200501230655-7c82f3b81c00/go.mod h1:plgt+Y5MnOey4vO4UlUazGqdbEXuFYitED67FexhXog= github.com/ipfs/go-cid v0.0.6/go.mod h1:6Ux9z5e+HpkQdckYoX1PG/6xqKspzlEIR5SDmgqgC/I= github.com/ipfs/go-cid v0.0.7/go.mod h1:6Ux9z5e+HpkQdckYoX1PG/6xqKspzlEIR5SDmgqgC/I= github.com/ipfs/go-cid v0.3.2 h1:OGgOd+JCFM+y1DjWPmVH+2/4POtpDzwcr7VgnB7mZXc= @@ -148,15 +147,6 @@ github.com/tj/go-spin v1.1.0/go.mod h1:Mg1mzmePZm4dva8Qz60H2lHwmJ2loum4VIrLgVnKw github.com/warpfork/go-wish v0.0.0-20180510122957-5ad1f5abf436/go.mod h1:x6AKhvSSexNrVSrViXSHUEbICjmGXhtgABaHIySUSGw= github.com/warpfork/go-wish v0.0.0-20190328234359-8b3e70f8e830/go.mod h1:x6AKhvSSexNrVSrViXSHUEbICjmGXhtgABaHIySUSGw= github.com/warpfork/go-wish v0.0.0-20200122115046-b9ea61034e4a h1:G++j5e0OC488te356JvdhaM8YS6nMsjLAYF7JxCv07w= -github.com/whyrusleeping/cbor-gen v0.0.0-20200123233031-1cdf64d27158/go.mod h1:Xj/M2wWU+QdTdRbu/L/1dIZY8/Wb2K9pAhtroQuxJJI= -github.com/whyrusleeping/cbor-gen v0.0.0-20200414195334-429a0b5e922e/go.mod h1:Xj/M2wWU+QdTdRbu/L/1dIZY8/Wb2K9pAhtroQuxJJI= -github.com/whyrusleeping/cbor-gen v0.0.0-20200504204219-64967432584d/go.mod h1:W5MvapuoHRP8rz4vxjwCK1pDqF1aQcWsV5PZ+AHbqdg= -github.com/whyrusleeping/cbor-gen v0.0.0-20200715143311-227fab5a2377/go.mod h1:fgkXqYy7bV2cFeIEOkVTZS/WjXARfBqSH6Q2qHL33hQ= -github.com/whyrusleeping/cbor-gen v0.0.0-20200806213330-63aa96ca5488/go.mod h1:fgkXqYy7bV2cFeIEOkVTZS/WjXARfBqSH6Q2qHL33hQ= -github.com/whyrusleeping/cbor-gen v0.0.0-20200810223238-211df3b9e24c/go.mod h1:fgkXqYy7bV2cFeIEOkVTZS/WjXARfBqSH6Q2qHL33hQ= -github.com/whyrusleeping/cbor-gen v0.0.0-20200812213548-958ddffe352c/go.mod h1:fgkXqYy7bV2cFeIEOkVTZS/WjXARfBqSH6Q2qHL33hQ= -github.com/whyrusleeping/cbor-gen v0.0.0-20240124134906-0efd71a8493b h1:+Yd0HVs6f9v2sRlpqcODhojlOd2PiBtWZTPcYmaSm5A= -github.com/whyrusleeping/cbor-gen v0.0.0-20240124134906-0efd71a8493b/go.mod h1:fgkXqYy7bV2cFeIEOkVTZS/WjXARfBqSH6Q2qHL33hQ= github.com/xlab/c-for-go v0.0.0-20200718154222-87b0065af829 h1:wb7xrDzfkLgPHsSEBm+VSx6aDdi64VtV0xvP0E6j8bk= github.com/xlab/c-for-go v0.0.0-20200718154222-87b0065af829/go.mod h1:h/1PEBwj7Ym/8kOuMWvO2ujZ6Lt+TMbySEXNhjjR87I= github.com/xlab/pkgconfig v0.0.0-20170226114623-cea12a0fd245 h1:Sw125DKxZhPUI4JLlWugkzsrlB50jR9v2khiD9FxuSo= @@ -176,8 +166,8 @@ golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.1.0 h1:MDRAIl0xIo9Io2xV565hzXHw3zVseKrJKodhohM5CjU= -golang.org/x/crypto v0.1.0/go.mod h1:RecgLatLF4+eUMCP1PoPZQb+cVrJcOPbHkTkbkB9sbw= +golang.org/x/crypto v0.17.0 h1:r8bRNjWL3GshPW3gkd+RpvzWrZAwPS49OmTGZ/uhM4k= +golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= golang.org/x/mod v0.3.0 h1:RM4zey1++hCTbCVQfnWeKs9/IEsaBLA8vTkd0WVtmH4= @@ -196,8 +186,8 @@ golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190626221950-04f50cda93cb/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20220704084225-05e143d24a9e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.1.0 h1:kunALQeHf1/185U1i0GOB/fy1IPRDDpuoOOqRReG57U= -golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc= +golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= @@ -223,8 +213,8 @@ gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= -gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.0 h1:hjy8E9ON/egN1tAYqKb61G10WtihqetD4sz2H+8nIeA= +gopkg.in/yaml.v3 v3.0.0/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= lukechampine.com/blake3 v1.1.6 h1:H3cROdztr7RCfoaTpGZFQsrqvweFLrqS73j7L7cmR5c= lukechampine.com/blake3 v1.1.6/go.mod h1:tkKEOtDkNtklkXtLNEOGNq5tcV90tJiA1vAA12R78LA= diff --git a/manifest/cbor_gen.go b/manifest/cbor_gen.go index d596609e..b3a9e63e 100644 --- a/manifest/cbor_gen.go +++ b/manifest/cbor_gen.go @@ -101,7 +101,7 @@ func (t *ManifestEntry) MarshalCBOR(w io.Writer) error { scratch := make([]byte, 9) // t.Name (string) (string) - if len(t.Name) > cbg.MaxLength { + if uint64(len(t.Name)) > cbg.MaxLength { return xerrors.Errorf("Value in field t.Name was too long") } diff --git a/manifest/manifest.go b/manifest/manifest.go index a1cecc4c..a859de5a 100644 --- a/manifest/manifest.go +++ b/manifest/manifest.go @@ -15,10 +15,10 @@ import ( ) const ( - AccountKey = "account" - CronKey = "cron" - InitKey = "init" - MarketKey = "storagemarket" + AccountKey = "account" + CronKey = "cron" + InitKey = "init" + MarketKey = "storagemarket" MinerKey = "storageminer" MultisigKey = "multisig" PaychKey = "paymentchannel" @@ -137,7 +137,7 @@ func (d *ManifestData) MarshalCBOR(w io.Writer) error { scratch := make([]byte, 9) - if len(d.Entries) > cbg.MaxLength { + if uint64(len(d.Entries)) > cbg.MaxLength { return fmt.Errorf("too many manifest entries") } diff --git a/proof/cbor_gen.go b/proof/cbor_gen.go index 8816a82f..6184391e 100644 --- a/proof/cbor_gen.go +++ b/proof/cbor_gen.go @@ -38,7 +38,7 @@ func (t *PoStProof) MarshalCBOR(w io.Writer) error { } // t.ProofBytes ([]uint8) (slice) - if len(t.ProofBytes) > cbg.ByteArrayMaxLen { + if uint64(len(t.ProofBytes)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.ProofBytes was too long") } @@ -294,7 +294,7 @@ func (t *SealVerifyInfo) MarshalCBOR(w io.Writer) error { } // t.DealIDs ([]abi.DealID) (slice) - if len(t.DealIDs) > cbg.MaxLength { + if uint64(len(t.DealIDs)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.DealIDs was too long") } @@ -308,7 +308,7 @@ func (t *SealVerifyInfo) MarshalCBOR(w io.Writer) error { } // t.Randomness (abi.SealRandomness) (slice) - if len(t.Randomness) > cbg.ByteArrayMaxLen { + if uint64(len(t.Randomness)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.Randomness was too long") } @@ -321,7 +321,7 @@ func (t *SealVerifyInfo) MarshalCBOR(w io.Writer) error { } // t.InteractiveRandomness (abi.InteractiveSealRandomness) (slice) - if len(t.InteractiveRandomness) > cbg.ByteArrayMaxLen { + if uint64(len(t.InteractiveRandomness)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.InteractiveRandomness was too long") } @@ -334,7 +334,7 @@ func (t *SealVerifyInfo) MarshalCBOR(w io.Writer) error { } // t.Proof ([]uint8) (slice) - if len(t.Proof) > cbg.ByteArrayMaxLen { + if uint64(len(t.Proof)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.Proof was too long") } @@ -550,7 +550,7 @@ func (t *WindowPoStVerifyInfo) MarshalCBOR(w io.Writer) error { scratch := make([]byte, 9) // t.Randomness (abi.PoStRandomness) (slice) - if len(t.Randomness) > cbg.ByteArrayMaxLen { + if uint64(len(t.Randomness)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.Randomness was too long") } @@ -563,7 +563,7 @@ func (t *WindowPoStVerifyInfo) MarshalCBOR(w io.Writer) error { } // t.Proofs ([]proof.PoStProof) (slice) - if len(t.Proofs) > cbg.MaxLength { + if uint64(len(t.Proofs)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Proofs was too long") } @@ -577,7 +577,7 @@ func (t *WindowPoStVerifyInfo) MarshalCBOR(w io.Writer) error { } // t.ChallengedSectors ([]proof.SectorInfo) (slice) - if len(t.ChallengedSectors) > cbg.MaxLength { + if uint64(len(t.ChallengedSectors)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.ChallengedSectors was too long") } @@ -727,7 +727,7 @@ func (t *WinningPoStVerifyInfo) MarshalCBOR(w io.Writer) error { scratch := make([]byte, 9) // t.Randomness (abi.PoStRandomness) (slice) - if len(t.Randomness) > cbg.ByteArrayMaxLen { + if uint64(len(t.Randomness)) > cbg.ByteArrayMaxLen { return xerrors.Errorf("Byte array in field t.Randomness was too long") } @@ -740,7 +740,7 @@ func (t *WinningPoStVerifyInfo) MarshalCBOR(w io.Writer) error { } // t.Proofs ([]proof.PoStProof) (slice) - if len(t.Proofs) > cbg.MaxLength { + if uint64(len(t.Proofs)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Proofs was too long") } @@ -754,7 +754,7 @@ func (t *WinningPoStVerifyInfo) MarshalCBOR(w io.Writer) error { } // t.ChallengedSectors ([]proof.SectorInfo) (slice) - if len(t.ChallengedSectors) > cbg.MaxLength { + if uint64(len(t.ChallengedSectors)) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.ChallengedSectors was too long") }