Skip to content

assertPieceValid

assertPieceValid(piece): void

Defined in: packages/synapse-core/src/utils/add-pieces-fits.ts:230

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.

Parameter Type Description
piece LimiterPiece The piece to check.

void

Errors assertPieceValid.ErrorType