Skip to content

Commit

Permalink
test: Fix indexer state tests
Browse files Browse the repository at this point in the history
  • Loading branch information
morgsmccauley committed Jul 16, 2024
1 parent 6e6b928 commit 100ea2e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions coordinator/src/indexer_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ mod tests {
let mut mock_redis_client = RedisClient::default();
mock_redis_client
.expect_list_indexer_states()
.returning(|| Ok(vec![serde_json::json!({ "account_id": "morgs.near", "function_name": "test", "block_stream_synced_at": 200, "enabled": true, "provisioned_state": "Provisioned" }).to_string()]))
.returning(|| Ok(vec![serde_json::json!({ "account_id": "morgs.near", "function_name": "test", "block_stream_synced_at": 200, "enabled": true, "lifecycle_state": "Initializing" }).to_string()]))
.once();
mock_redis_client
.expect_list_indexer_states()
Expand Down Expand Up @@ -224,15 +224,15 @@ mod tests {
.with(predicate::eq(indexer_config.clone()))
.returning(|_| {
Ok(Some(
serde_json::json!({ "account_id": "morgs.near", "function_name": "test", "block_stream_synced_at": 123, "enabled": true, "provisioned_state": "Provisioned" })
serde_json::json!({ "account_id": "morgs.near", "function_name": "test", "block_stream_synced_at": 123, "enabled": true, "lifecycle_state": "Initializing" })
.to_string(),
))
});
redis_client
.expect_set_indexer_state::<IndexerConfig>()
.with(
predicate::always(),
predicate::eq("{\"account_id\":\"morgs.near\",\"function_name\":\"test\",\"block_stream_synced_at\":123,\"enabled\":false,\"provisioned_state\":\"Provisioned\"}".to_string()),
predicate::eq("{\"account_id\":\"morgs.near\",\"function_name\":\"test\",\"block_stream_synced_at\":123,\"enabled\":false,\"lifecycle_state\":\"Initializing\"}".to_string()),
)
.returning(|_, _| Ok(()))
.once();
Expand Down

0 comments on commit 100ea2e

Please sign in to comment.