certify method

Transaction certify()

Step 4: Build the certify transaction.

Returns an unsigned Transaction for external signing.

Implementation

Transaction certify() {
  if (_step != _FlowStep.uploaded) {
    throw StateError('Must call upload() before certify()');
  }

  if (_certificate == null) {
    throw StateError('No certificate available for certification');
  }

  // Determine committee size for signers→bitmap conversion.
  // Include non-signers so the bitmap spans the complete committee.
  final committeeSize = _committeeSize ?? _committee?.nodes.length ?? 0;
  if (committeeSize <= 0) {
    throw StateError(
      'The complete chain committee size is required to certify',
    );
  }

  final tx = _txBuilder.certifyBlobTransaction(
    CertifyBlobOptions(
      blobId: _metadata!.blobId,
      blobObjectId: _blobObjectId!,
      deletable: _deletable,
      certificate: _certificate,
      committeeSize: committeeSize,
    ),
  );

  _step = _FlowStep.certified;
  return tx;
}