Skip to content

assertAddPiecesFit

assertAddPiecesFit(options): void

Defined in: packages/synapse-core/src/sp/add-pieces-fits.ts:225

Throw if pieces is empty, a PieceCID is outside Curio’s size bounds, or the list does not fit in one addPieces / createAndAdd message.

Parameter Type Description
options LimiterOptions LimiterOptions

void

AtLeastOnePieceRequiredError when pieces is empty

InvalidUploadSizeError when a PieceCID size is below SIZE_CONSTANTS.MIN_UPLOAD_SIZE or above SIZE_CONSTANTS.MAX_UPLOAD_SIZE

AddPiecesBatchTooLargeError when a piece-count or message-size limit is exceeded

Error when data set or piece metadata exceeds the contract limits