Skip to content

move RemoteSigningConfig and RetryConfig to unit tests #66

@ikwuoz

Description

@ikwuoz

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions