Added commit data.
This commit is contained in:
parent
0f8670f686
commit
69acfefc0c
@ -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),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user