Added commit data.

This commit is contained in:
Jeff Baskin 2023-05-11 08:46:44 -04:00
parent 0f8670f686
commit 69acfefc0c
1 changed files with 9 additions and 3 deletions

View File

@ -389,7 +389,7 @@ struct CacheQuery {
struct CacheCommit { struct CacheCommit {
reply: Sender<FromCache>, reply: Sender<FromCache>,
// data: DataType, data: DataType,
} }
impl CacheCommit { impl CacheCommit {
@ -399,7 +399,7 @@ impl CacheCommit {
_ => return Err(MTTError::from_code(ErrorCode::InvalidCommitData)), _ => return Err(MTTError::from_code(ErrorCode::InvalidCommitData)),
} }
Ok(Self { Ok(Self {
// data: data, data: data,
reply: channel, reply: channel,
}) })
} }
@ -412,7 +412,13 @@ mod commits {
fn create() -> Result<(), MTTError> { fn create() -> Result<(), MTTError> {
let (s, _) = unbounded(); let (s, _) = unbounded();
match CacheCommit::new(DataType::new("store"), s) { match CacheCommit::new(DataType::new("store"), s) {
Ok(_) => Ok(()), Ok(output) => match output.data {
DataType::DBMap(_) => Ok(()),
_ => Err(MTTError::new(format!(
"{:?} should have been DBMap",
output.data
))),
},
Err(err) => Err(err), Err(err) => Err(err),
} }
} }