implementations for DbTx functions for TxMock (#5015)

This commit is contained in:
DoTheBestToGetTheBest
2023-10-23 10:33:38 -07:00
committed by GitHub
parent 6b79978747
commit 916b6b3b28

View File

@ -60,25 +60,23 @@ impl DbTx for TxMock {
} }
fn commit(self) -> Result<bool, DatabaseError> { fn commit(self) -> Result<bool, DatabaseError> {
todo!() Ok(true)
} }
fn drop(self) { fn drop(self) {}
todo!()
}
fn cursor_read<T: Table>(&self) -> Result<<Self as DbTxGAT<'_>>::Cursor<T>, DatabaseError> { fn cursor_read<T: Table>(&self) -> Result<<Self as DbTxGAT<'_>>::Cursor<T>, DatabaseError> {
todo!() Ok(CursorMock { _cursor: 0 })
} }
fn cursor_dup_read<T: DupSort>( fn cursor_dup_read<T: DupSort>(
&self, &self,
) -> Result<<Self as DbTxGAT<'_>>::DupCursor<T>, DatabaseError> { ) -> Result<<Self as DbTxGAT<'_>>::DupCursor<T>, DatabaseError> {
todo!() Ok(CursorMock { _cursor: 0 })
} }
fn entries<T: Table>(&self) -> Result<usize, DatabaseError> { fn entries<T: Table>(&self) -> Result<usize, DatabaseError> {
todo!() Ok(self._table.len())
} }
} }