fedimint_testing::db

Function snapshot_db_migrations

Source
pub async fn snapshot_db_migrations<'a, F, I>(
    snapshot_name: &str,
    prepare_fn: F,
) -> Result<(), Error>
where F: Fn(Database) -> Pin<Box<dyn Future<Output = ()> + Send + '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.