Adds roundtrip tests for Network::from_core_arg
This commit is contained in:
parent
bd1eb29f61
commit
d7006ef80d
|
@ -599,4 +599,19 @@ mod tests {
|
||||||
assert_eq!(&magic.to_string(), magic_str);
|
assert_eq!(&magic.to_string(), magic_str);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn from_to_core_arg() {
|
||||||
|
let expected_pairs = [
|
||||||
|
(Network::Bitcoin, "main"),
|
||||||
|
(Network::Testnet, "test"),
|
||||||
|
(Network::Regtest, "regtest"),
|
||||||
|
(Network::Signet, "signet"),
|
||||||
|
];
|
||||||
|
|
||||||
|
for (net, core_arg) in &expected_pairs {
|
||||||
|
assert_eq!(Network::from_core_arg(core_arg), Ok(*net));
|
||||||
|
assert_eq!(net.to_core_arg(), *core_arg);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue