Skip to content

Commit

Permalink
Fix tests and warning.
Browse files Browse the repository at this point in the history
- get_data test still fails
  • Loading branch information
RobinP122 committed Jul 12, 2024
1 parent b49ac2b commit 26634d6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/tests/interfaces.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ impl KvStoreConnection for DbStub {
async fn get_data<T: DeserializeOwned>(
&mut self,
_key: &str,
value_id: Option<&str>,
_value_id: Option<&str>,
) -> Result<Option<HashMap<String, T>>, Box<dyn std::error::Error + Send + Sync>> {
if self.data.is_none() {
return Ok(None);
Expand All @@ -61,7 +61,7 @@ impl KvStoreConnection for DbStub {
async fn del_data(
&mut self,
_key: &str,
value_id: Option<&str>,
_value_id: Option<&str>,
) -> Result<(), Box<dyn std::error::Error + Send + Sync>> {
self.data = None;

Expand All @@ -71,7 +71,7 @@ impl KvStoreConnection for DbStub {
async fn set_data_with_expiry<T: Serialize + Send>(
&mut self,
_key: &str,
value_id: &str,
_value_id: &str,
value: T,
_seconds: usize,
) -> Result<(), Box<dyn std::error::Error + Send + Sync>> {
Expand All @@ -83,7 +83,7 @@ impl KvStoreConnection for DbStub {
async fn set_data<T: Serialize + Send>(
&mut self,
_key: &str,
value_id: &str,
_value_id: &str,
value: T,
) -> Result<(), Box<dyn std::error::Error + Send + Sync>> {
self.data = Some(serialize_data(&value));
Expand Down
2 changes: 1 addition & 1 deletion src/tests/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ async fn test_set_data() {
//
// Arrange
//
let req_body = "{\"address\":\"0x123\",\"data\":\"{\\\"Hello\\\":20}\"}";
let req_body = "{\"address\":\"0x123\",\"data\":\"{\\\"Hello\\\":20}\", \"data_id\":\"id\"}";

let request = warp::test::request()
.method("POST")
Expand Down

0 comments on commit 26634d6

Please sign in to comment.