// DeleteAll deletes all operations for suffixes.
DeleteAll deletes all operations for suffixes.
// DeleteAll deletes all operations for suffixes .
func (s *Store) DeleteAll(ops []*operation.AnchoredOperation) error {
	if len(ops) == 0 {
		return nil
	}
	operations := make([]storage.Operation, len(ops))
	for i, op := range ops {
		key, err := hashing.CalculateModelMultihash(op.OperationRequest, sha2_256)
		if err != nil {
			return fmt.Errorf("failed to generate key for unpublished operation for suffix[%s]: %w", op.UniqueSuffix, err)
		}
		operations[i] = storage.Operation{Key: key}
	}
	err := s.store.Batch(operations)
	if err != nil {
		return orberrors.NewTransient(fmt.Errorf("failed to delete unpublished operations: %w", err))
	}
	logger.Debugf("deleted %d unpublished operations", len(ops))
	return nil
}
func ( s * Store ) DeleteAll ( ops [ ] * operation . AnchoredOperation ) error { if len ( ops ) == 0 { return nil } operations := make ( [ ] storage . Operation , len ( ops ) ) for i , op := range ops { key , err := hashing . CalculateModelMultihash ( op . OperationRequest , sha2_256 ) if err != nil { return fmt . Errorf ( " " , op . UniqueSuffix , err ) } operations [ i ] = storage . Operation { Key : key } } err := s . store . Batch ( operations ) if err != nil { return orberrors . NewTransient ( fmt . Errorf ( " " , err ) ) } logger . Debugf ( " " , len ( ops ) ) return nil }
DeleteAll deletes all operations for suffixes.
DeleteAll deletes all operations for suffixes .