Added commit data.
This commit is contained in:
		@@ -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),
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user