use std::sync::Arc; use super::{ ClientDB, DBError, }; use super::VALIDATOR_DB_COLUMN as DB_COLUMN; pub struct ValidatorStore where T: ClientDB { db: Arc, } impl ValidatorStore { pub fn new(db: Arc) -> Self { Self { db, } } pub fn put_validator_record_by_index(&self, hash: &[u8], val: &[u8]) -> Result<(), DBError> { self.db.put(DB_COLUMN, hash, &vec![0]) } pub fn get_validator_record_by_index(&self, hash: &[u8]) -> Result { self.db.exists(DB_COLUMN, hash) } } // TODO: add tests