-
Notifications
You must be signed in to change notification settings - Fork 276
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Signed-off-by: Dmitry Balashov <[email protected]>
- Loading branch information
Showing
16 changed files
with
297 additions
and
136 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,3 +6,4 @@ pub mod client_api; | |
pub mod kura; | ||
pub mod logger; | ||
pub mod parameters; | ||
pub mod snapshot; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
//! Configuration related to Snapshot specifically | ||
/// Functioning mode of the Snapshot Iroha module | ||
#[derive( | ||
Copy, | ||
Clone, | ||
Debug, | ||
Default, | ||
strum::Display, | ||
strum::EnumString, | ||
serde_with::SerializeDisplay, | ||
serde_with::DeserializeFromStr, | ||
)] | ||
#[strum(serialize_all = "snake_case")] | ||
pub enum Mode { | ||
/// Read the snapshot on startup, update periodically | ||
#[default] | ||
ReadWrite, | ||
/// Read the snapshot on startup, do not update | ||
Readonly, | ||
/// Do not read or write the snapshot | ||
Disabled, | ||
} | ||
|
||
#[cfg(test)] | ||
mod tests { | ||
use crate::snapshot::Mode; | ||
|
||
#[test] | ||
fn mode_display_form() { | ||
assert_eq!( | ||
format!("{} {} {}", Mode::ReadWrite, Mode::Readonly, Mode::Disabled), | ||
"read_write readonly disabled" | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.