drive/util/grove_operations/grove_apply_batch/
mod.rs

1use crate::drive::Drive;
2use crate::error::Error;
3use crate::util::batch::GroveDbOpBatch;
4use dpp::version::drive_versions::DriveVersion;
5use grovedb::TransactionArg;
6
7impl Drive {
8    /// Applies the given groveDB operations batch.
9    ///
10    /// # Parameters
11    /// * `ops`: The groveDB operations batch.
12    /// * `validate`: Specifies whether to validate that insertions do not override existing entries.
13    /// * `transaction`: The groveDB transaction associated with this operation.
14    /// * `drive_version`: The drive version to select the correct function version to run.
15    ///
16    /// # Returns
17    /// * `Ok(())` if the operation was successful.
18    /// * `Err(DriveError::UnknownVersionMismatch)` if the drive version does not match known versions.
19    pub fn grove_apply_batch(
20        &self,
21        ops: GroveDbOpBatch,
22        validate: bool,
23        transaction: TransactionArg,
24        drive_version: &DriveVersion,
25    ) -> Result<(), Error> {
26        self.grove_apply_batch_with_add_costs(
27            ops,
28            validate,
29            transaction,
30            &mut vec![],
31            drive_version,
32        )
33    }
34}