Added commit data.

This commit is contained in:
Jeff Baskin 2023-05-11 08:46:44 -04:00
parent 0f8670f686
commit 69acfefc0c

View File

@ -389,7 +389,7 @@ struct CacheQuery {
struct CacheCommit {
reply: Sender<FromCache>,
// data: DataType,
data: DataType,
}
impl CacheCommit {
@ -399,7 +399,7 @@ impl CacheCommit {
_ => return Err(MTTError::from_code(ErrorCode::InvalidCommitData)),
}
Ok(Self {
// data: data,
data: data,
reply: channel,
})
}
@ -412,7 +412,13 @@ mod commits {
fn create() -> Result<(), MTTError> {
let (s, _) = unbounded();
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),
}
}