|
async fn config_builder_pattern() { |
|
let config = RemoteSigningConfig::default() |
|
.with_timeout(Duration::from_secs(10)) |
|
.with_retry_config(RetryConfig::new( |
|
2, |
|
Duration::from_millis(50), |
|
Duration::from_secs(1), |
|
)); |
|
|
|
assert_eq!(config.endpoint, "http://0.0.0.0:10340"); |
|
assert_eq!(config.timeout, Duration::from_secs(10)); |
|
assert_eq!(config.retry_config.max_retries, 2); |
|
} |
|
|
|
#[tokio::test] |
|
async fn retry_config_validation() { |
|
let retry_config = RetryConfig::new(5, Duration::from_millis(100), Duration::from_secs(10)) |
|
.with_backoff_multiplier(1.5); |
|
|
|
assert_eq!(retry_config.max_retries, 5); |
|
assert_eq!(retry_config.initial_backoff, Duration::from_millis(100)); |
|
assert_eq!(retry_config.max_backoff, Duration::from_secs(10)); |
|
assert_eq!(retry_config.backoff_multiplier, 1.5); |
|
} |
|
} |
Both tests assert field values for RemoteSigningConfig and RetryConfig, which
involve no remote signer client or gRPC channel(s), hence should be appropriate for
unit test section in config.rs
arc-node/crates/remote-signer/src/client.rs
Lines 399 to 423 in cf51a19
Both tests assert field values for RemoteSigningConfig and RetryConfig, which
involve no remote signer client or gRPC channel(s), hence should be appropriate for
unit test section in
config.rs