zebra_state/service/finalized_state/disk_format/upgrade/
no_migration.rs
1use crossbeam_channel::Receiver;
4
5use semver::Version;
6use zebra_chain::block::Height;
7
8use crate::service::finalized_state::ZebraDb;
9
10use super::{CancelFormatChange, DiskFormatUpgrade};
11
12pub struct NoMigration {
15 description: &'static str,
16 version: Version,
17}
18
19impl NoMigration {
20 pub fn new(description: &'static str, version: Version) -> Self {
22 Self {
23 description,
24 version,
25 }
26 }
27}
28
29impl DiskFormatUpgrade for NoMigration {
30 fn version(&self) -> Version {
31 self.version.clone()
32 }
33
34 fn description(&self) -> &'static str {
35 self.description
36 }
37
38 #[allow(clippy::unwrap_in_result)]
39 fn run(
40 &self,
41 _initial_tip_height: Height,
42 _db: &ZebraDb,
43 _cancel_receiver: &Receiver<CancelFormatChange>,
44 ) -> Result<(), CancelFormatChange> {
45 Ok(())
46 }
47
48 fn needs_migration(&self) -> bool {
49 false
50 }
51}