fedimint_testing

Module db

Source

Constants§

BYTE_8
BYTE_20
BYTE_32
BYTE_33
STRING_64
TEST_MODULE_INSTANCE_ID

Functions§

copy_directory
Helper function that recursively copies all contents from src to dst.
get_project_root
Get the project root (relative to closest Cargo.lock file)
snapshot_db_migrations
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.
snapshot_db_migrations_client
Create the database backup directory for a client module. Two prepare functions are taken as parameters. data_prepare is expected to create any data that the client module uses and is stored in the isolated namespace. state_machine_prepare creates client state machine data that can be used for testing state machine migrations. This is created in the global namespace.
snapshot_db_migrations_with_decoders
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.
validate_migrations_client
Validates the database migrations for a client module. First applies all database migrations to the module, including the state machine migrations. Then calls the validate function, including the new active_states and inactive_states, and is expected to confirm the database migrations were successful.
validate_migrations_core_client
Validates the database migrations for the core client. First applies all database migrations to the core client. Then calls the validate function, including the new active_states and inactive_states, and is expected to confirm the database migrations were successful.
validate_migrations_global
Validates the database migrations. decoders need to be passed in as an argument since this is module agnostic. First applies all defined migrations to the database then executes the `validate`` function which should confirm the database migrations were successful.
validate_migrations_server
Validates the database migrations for a server module. First applies all database migrations to the module, then calls the validate which should confirm the database migrations were successful.