Skip to content

Commit

Permalink
stacks-signer test add support for both ipv4 and ipv6
Browse files Browse the repository at this point in the history
  • Loading branch information
ASuciuX committed Jul 6, 2024
1 parent 18fd4a5 commit 09f731c
Showing 1 changed file with 19 additions and 6 deletions.
25 changes: 19 additions & 6 deletions stacks-signer/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -635,10 +635,8 @@ mod tests {
fn test_config_to_string() {
let config = GlobalConfig::load_from_file("./src/tests/conf/signer-0.toml").unwrap();
let config_str = config.config_to_log_string();
assert_eq!(
config_str,
format!(
r#"

let expected_str_v4 = r#"
Stacks node host: 127.0.0.1:20443
Signer endpoint: 127.0.0.1:30000
Stacks address: ST3FPN8KBZ3YPBP0ZJGAAHTVFMQDTJCR5QPS7VTNJ
Expand All @@ -647,8 +645,23 @@ Network: testnet
Database path: :memory:
DKG transaction fee: 0.01 uSTX
Metrics endpoint: 0.0.0.0:9090
"#
)
"#;

let expected_str_v6 = r#"
Stacks node host: 127.0.0.1:20443
Signer endpoint: ::1:30000
Stacks address: ST3FPN8KBZ3YPBP0ZJGAAHTVFMQDTJCR5QPS7VTNJ
Public key: 03bc489f27da3701d9f9e577c88de5567cf4023111b7577042d55cde4d823a3505
Network: testnet
Database path: :memory:
DKG transaction fee: 0.01 uSTX
Metrics endpoint: 0.0.0.0:9090
"#;

assert!(
config_str == expected_str_v4 || config_str == expected_str_v6,
"Config string does not match expected output. Actual:\n{}",
config_str
);
}

Expand Down

0 comments on commit 09f731c

Please sign in to comment.