assertPieceValid
assertPieceValid(
piece):void
Defined in: packages/synapse-core/src/sp/add-pieces-fits.ts:210
Throw if a piece can never be added: its PieceCID size is outside Curio’s upload bounds or its metadata exceeds the contract limits. Use it to reject bad pieces before any network work.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
piece |
LimiterPiece |
The piece to check. |
Returns
Section titled “Returns”void
Throws
Section titled “Throws”InvalidUploadSizeError when the PieceCID size is below SIZE_CONSTANTS.MIN_UPLOAD_SIZE or above SIZE_CONSTANTS.MAX_UPLOAD_SIZE
Throws
Section titled “Throws”Error when the piece metadata exceeds the contract limits