fedimint_testing::db

Function snapshot_db_migrations_with_decoders

Source
pub async fn snapshot_db_migrations_with_decoders<'a, F>(
    snapshot_name: &str,
    prepare_fn: F,
    decoders: ModuleRegistry<Decoder, DecodingMode>,
) -> Result<(), Error>
where F: Fn(Database) -> Pin<Box<dyn Future<Output = ()> + Send + 'a>>,
Expand description

Creates the database backup for 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. If the snapshot directory already exists, this function will do nothing.