Skip to content

Commit

Permalink
update mock querier for grpc
Browse files Browse the repository at this point in the history
  • Loading branch information
kwtalley committed Aug 30, 2024
1 parent 9a8f7b7 commit 0573bde
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions packages/provwasm-mocks/src/querier.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,14 @@ impl MockProvenanceQuerier {
}
SystemResult::Err(SystemError::UnsupportedRequest { kind: path.into() })
}
QueryRequest::Grpc(grpc_query) => {
if let Some(response_fn) = self.registered_custom_queries.get(&grpc_query.path) {
return response_fn(&grpc_query.data);
}
SystemResult::Err(SystemError::UnsupportedRequest {
kind: grpc_query.path.to_string(),
})
}
_ => self.mock_querier.handle_query(request),
}
}
Expand Down

0 comments on commit 0573bde

Please sign in to comment.