Skip to content

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.

ParameterTypeDescription
pieceCountnumberNumber of pieces in the batch

void

AtLeastOnePieceRequiredError when not a positive integer

TooManyPiecesError when above SIZE_CONSTANTS.MAX_ADD_PIECES_BATCH_SIZE