validateAddPiecesBatch
validateAddPiecesBatch(
pieceCount):void
Defined in: packages/synapse-core/src/sp/add-pieces.ts:118
Validate the piece count for an addPieces (or createDataSetAndAddPieces) batch, failing early instead of reverting on-chain.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
pieceCount | number | Number of pieces in the batch |
Returns
Section titled “Returns”void
Throws
Section titled “Throws”AtLeastOnePieceRequiredError when not a positive integer
Throws
Section titled “Throws”TooManyPiecesError when above SIZE_CONSTANTS.MAX_ADD_PIECES_BATCH_SIZE