mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-03 00:31:50 +00:00
Test database schema stability (#7669)
This PR implements some heuristics to check for breaking database changes. The goal is to prevent accidental changes to the database schema occurring without a version bump.
This commit is contained in:
@@ -86,5 +86,9 @@ mod tests {
|
||||
.unwrap();
|
||||
let dht: PersistedDht = store.get_item(&DHT_DB_KEY).unwrap().unwrap();
|
||||
assert_eq!(dht.enrs, enrs);
|
||||
|
||||
// This hardcoded length check is for database schema compatibility. If the on-disk format
|
||||
// of `PersistedDht` changes, we need a DB schema change.
|
||||
assert_eq!(dht.as_store_bytes().len(), 136);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user