Skip to content

Commit

Permalink
Merge pull request #2340 from input-output-hk/djo/2316/cleanup-legacy…
Browse files Browse the repository at this point in the history
…-code-from-thales-era

Cleanup legacy code from thales era
  • Loading branch information
Alenar authored Feb 26, 2025
2 parents 3f77f6b + dac8109 commit daedb00
Show file tree
Hide file tree
Showing 102 changed files with 2,246 additions and 7,242 deletions.
18 changes: 9 additions & 9 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions docs/website/root/manual/develop/run-mithril-devnet.md
Original file line number Diff line number Diff line change
Expand Up @@ -231,8 +231,6 @@ The networks will be queried every second and will display:
=== Mithril Network
=====================================================================

>> Query pending certificate

>> Query latest certificates
[
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -231,8 +231,6 @@ The networks will be queried every second and will display:
=== Mithril Network
=====================================================================

>> Query pending certificate

>> Query latest certificates
[
{
Expand Down
2 changes: 1 addition & 1 deletion internal/mithril-persistence/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "mithril-persistence"
version = "0.2.46"
version = "0.2.47"
description = "Common types, interfaces, and utilities to persist data for Mithril nodes."
authors = { workspace = true }
edition = { workspace = true }
Expand Down
31 changes: 31 additions & 0 deletions internal/mithril-persistence/src/database/version_checker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,37 @@ mod tests {
check_database_version(&connection, 4);
}

#[test]
fn test_upgrade_with_migration_with_a_version_gap() {
let (_filepath, connection) =
create_sqlite_file("test_upgrade_with_migration_with_a_version_gap.sqlite3").unwrap();
let mut db_checker = DatabaseVersionChecker::new(
discard_logger(),
ApplicationNodeType::Aggregator,
&connection,
);

let alterations = "create table whatever (thing_id integer); insert into whatever (thing_id) values (1), (2), (3), (4);";
let migration = SqlMigration {
version: 3,
alterations: alterations.to_string(),
};
db_checker.add_migration(migration);
db_checker.apply().unwrap();
assert_eq!(1, get_table_whatever_column_count(&connection));
check_database_version(&connection, 3);

let alterations = "alter table whatever add column thing_content text; update whatever set thing_content = 'some content'";
let migration_with_version_gap = SqlMigration {
version: 10,
alterations: alterations.to_string(),
};
db_checker.add_migration(migration_with_version_gap);
db_checker.apply().unwrap();
assert_eq!(2, get_table_whatever_column_count(&connection));
check_database_version(&connection, 10);
}

#[test]
fn starting_with_migration() {
let (_filepath, connection) = create_sqlite_file("starting_with_migration").unwrap();
Expand Down
2 changes: 1 addition & 1 deletion mithril-aggregator/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "mithril-aggregator"
version = "0.7.6"
version = "0.7.7"
description = "A Mithril Aggregator server"
authors = { workspace = true }
edition = { workspace = true }
Expand Down
Loading

0 comments on commit daedb00

Please sign in to comment.