fedimint_testing_core::db

Function snapshot_db_migrations

Source
pub async fn snapshot_db_migrations<'a, F, I>(
    snapshot_name: &str,
    prepare_fn: F,
) -> Result<()>
where F: Fn(Database) -> BoxFuture<'a, ()>, I: CommonModuleInit,
Expand description

Creates the database backup directory for a server module by appending the snapshot_name to db/migrations. Then this function will execute the provided prepare_fn which is expected to populate the database with the appropriate data for testing a migration.