Move tower save into the VotingService
This commit is contained in:
@@ -1230,6 +1230,21 @@ pub trait TowerStorage: Sync + Send {
|
||||
fn store(&self, saved_tower: &SavedTower) -> Result<()>;
|
||||
}
|
||||
|
||||
#[derive(Debug, Default, Clone, PartialEq)]
|
||||
pub struct NullTowerStorage {}
|
||||
|
||||
impl TowerStorage for NullTowerStorage {
|
||||
fn load(&self, _node_pubkey: &Pubkey) -> Result<SavedTower> {
|
||||
Err(TowerError::WrongTower(
|
||||
"NullTowerStorage has no storage".into(),
|
||||
))
|
||||
}
|
||||
|
||||
fn store(&self, _saved_tower: &SavedTower) -> Result<()> {
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Default, Clone, PartialEq)]
|
||||
pub struct FileTowerStorage {
|
||||
pub tower_path: PathBuf,
|
||||
|
||||
Reference in New Issue
Block a user