Skip to content

Commit

Permalink
address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
wilyle committed Sep 28, 2023
1 parent 91ee209 commit 2929d65
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ use crate::config::Config;
use freyja_common::{config_utils, out_dir};
use freyja_contracts::mapping_client::*;

const CONFIG_FILE: &str = "mock_mapping_config";
const CONFIG_EXT: &str = "json";
const CONFIG_FILE_STEM: &str = "mock_mapping_config";
const CONFIG_FILE_EXT: &str = "json";

/// Mocks a mapping provider in memory
pub struct InMemoryMockMappingClient {
Expand Down Expand Up @@ -41,8 +41,8 @@ impl MappingClient for InMemoryMockMappingClient {
/// Creates a new instance of an InMemoryMockMappingClient with default settings
fn create_new() -> Result<Self, MappingClientError> {
let config = config_utils::read_from_files(
CONFIG_FILE,
CONFIG_EXT,
CONFIG_FILE_STEM,
CONFIG_FILE_EXT,
out_dir!(),
MappingClientError::io,
MappingClientError::deserialize,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ use crate::config::Config;
use freyja_common::{config_utils, out_dir, retry_utils::execute_with_retry};
use freyja_contracts::mapping_client::*;

const CONFIG_FILE: &str = "mock_mapping_client_config";
const CONFIG_EXT: &str = "json";
const CONFIG_FILE_STEM: &str = "mock_mapping_client_config";
const CONFIG_FILE_EXT: &str = "json";

/// Mocks a mapping provider in memory
pub struct MockMappingServiceClient {
Expand Down Expand Up @@ -49,8 +49,8 @@ impl MappingClient for MockMappingServiceClient {
/// Creates a new instance of a MockMappingServiceClient with default settings
fn create_new() -> Result<Self, MappingClientError> {
let config = config_utils::read_from_files(
CONFIG_FILE,
CONFIG_EXT,
CONFIG_FILE_STEM,
CONFIG_FILE_EXT,
out_dir!(),
MappingClientError::io,
MappingClientError::deserialize,
Expand Down
8 changes: 4 additions & 4 deletions mocks/mock_mapping_service/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ use freyja_contracts::mapping_client::{
CheckForWorkResponse, GetMappingResponse, SendInventoryRequest, SendInventoryResponse,
};

const CONFIG_FILE: &str = "mock_mapping_config";
const CONFIG_EXT: &str = "json";
const CONFIG_FILE_STEM: &str = "mock_mapping_config";
const CONFIG_FILE_EXT: &str = "json";

struct MappingState {
count: u8,
Expand All @@ -52,8 +52,8 @@ async fn main() {
.init();

let config = config_utils::read_from_files(
CONFIG_FILE,
CONFIG_EXT,
CONFIG_FILE_STEM,
CONFIG_FILE_EXT,
out_dir!(),
|e| log::error!("{}", e),
|e| log::error!("{}", e),
Expand Down
2 changes: 1 addition & 1 deletion provider_proxies/grpc/v1/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ The GRPC Provider Proxy interfaces with providers which support GRPC. It acts as

This proxy's default config is located at `res/grpc_proxy_config.default.json` and will be copied to the build output automatically. This proxy supports the following configuration settings:

- `consumer_address`: The listen address for the proxy's consumer
- `consumer_address`: The address for the proxy's consumer

You can override the default values by defining your own `grpc_proxy_config.json`. The adapter will probe for and unify config in this order, with values near the end of the list taking higher precedence:

Expand Down
8 changes: 4 additions & 4 deletions provider_proxies/grpc/v1/src/grpc_provider_proxy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ use freyja_contracts::provider_proxy::{
OperationKind, ProviderProxy, ProviderProxyError, SignalValue,
};

const CONFIG_FILE: &str = "grpc_proxy_config";
const CONFIG_EXT: &str = "json";
const CONFIG_FILE_STEM: &str = "grpc_proxy_config";
const CONFIG_FILE_EXT: &str = "json";
const SUPPORTED_OPERATIONS: &[OperationKind] = &[OperationKind::Get, OperationKind::Subscribe];

/// Interfaces with providers which support GRPC. Based on the Ibeji mixed sample.
Expand Down Expand Up @@ -59,8 +59,8 @@ impl ProviderProxy for GRPCProviderProxy {
Self: Sized,
{
let config = config_utils::read_from_files(
CONFIG_FILE,
CONFIG_EXT,
CONFIG_FILE_STEM,
CONFIG_FILE_EXT,
out_dir!(),
ProviderProxyError::io,
ProviderProxyError::deserialize,
Expand Down

0 comments on commit 2929d65

Please sign in to comment.