style: rustfmt the code added in 01-04 and the reconcile fix
The release gate's cargo-fmt stage failed on my own additions — the tests in message_types.rs and lnd/info.rs and the reconcile branch in prod_orchestrator.rs were written programmatically and never passed through rustfmt. Formatting only; rustfmt is semantics-preserving and the gate re-runs the suites before building. Caught by the gate rather than in review, which is the gate working. Also a reminder that a piped command's exit code is the pipe's, not the script's: the task notification reported success while the log said CREATE_RELEASE_EXIT=1. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5
parent
41de23e71f
commit
b15b160294
@@ -269,8 +269,7 @@ mod tests {
|
||||
use super::*;
|
||||
|
||||
/// A real compressed secp256k1 pubkey shape: 66 hex characters.
|
||||
const GOOD_PUBKEY: &str =
|
||||
"03a1b2c3d4e5f60718293a4b5c6d7e8f90a1b2c3d4e5f60718293a4b5c6d7e8f90";
|
||||
const GOOD_PUBKEY: &str = "03a1b2c3d4e5f60718293a4b5c6d7e8f90a1b2c3d4e5f60718293a4b5c6d7e8f90";
|
||||
|
||||
fn parse(body: &str) -> LndGetInfoResponse {
|
||||
serde_json::from_str(body).expect("LND getinfo body must deserialize")
|
||||
@@ -285,7 +284,11 @@ mod tests {
|
||||
let (pubkey, uris) = map_identity(&parsed);
|
||||
|
||||
assert_eq!(pubkey.as_deref(), Some(GOOD_PUBKEY));
|
||||
assert_eq!(uris.len(), 2, "both advertised URIs must survive the mapping");
|
||||
assert_eq!(
|
||||
uris.len(),
|
||||
2,
|
||||
"both advertised URIs must survive the mapping"
|
||||
);
|
||||
assert!(uris[0].starts_with(GOOD_PUBKEY));
|
||||
}
|
||||
|
||||
|
||||
@@ -6085,7 +6085,9 @@ app:
|
||||
// Rewriting the file is not enough — nginx only loads it on restart.
|
||||
let calls = rt.calls();
|
||||
assert!(
|
||||
calls.iter().any(|c| c == "start_container:archy-bitcoin-ui"),
|
||||
calls
|
||||
.iter()
|
||||
.any(|c| c == "start_container:archy-bitcoin-ui"),
|
||||
"container must be restarted so nginx picks the new config up: {calls:?}"
|
||||
);
|
||||
assert_eq!(
|
||||
|
||||
@@ -1024,12 +1024,14 @@ mod tests {
|
||||
assert_eq!(decoded.height, 890412);
|
||||
}
|
||||
|
||||
const LN_PUBKEY: &str =
|
||||
"03a1b2c3d4e5f60718293a4b5c6d7e8f90a1b2c3d4e5f60718293a4b5c6d7e8f90";
|
||||
const LN_PUBKEY: &str = "03a1b2c3d4e5f60718293a4b5c6d7e8f90a1b2c3d4e5f60718293a4b5c6d7e8f90";
|
||||
|
||||
#[test]
|
||||
fn lightning_info_round_trips_through_u8_label_and_back() {
|
||||
assert_eq!(MeshMessageType::from_u8(26), Some(MeshMessageType::LightningInfo));
|
||||
assert_eq!(
|
||||
MeshMessageType::from_u8(26),
|
||||
Some(MeshMessageType::LightningInfo)
|
||||
);
|
||||
assert_eq!(MeshMessageType::LightningInfo.label(), "lightning_info");
|
||||
assert_eq!(
|
||||
MeshMessageType::from_label("lightning_info"),
|
||||
@@ -1077,10 +1079,14 @@ mod tests {
|
||||
#[test]
|
||||
fn valid_lightning_uris_are_accepted() {
|
||||
assert!(is_valid_lightning_uri(&format!("{LN_PUBKEY}@1.2.3.4:9735")));
|
||||
assert!(is_valid_lightning_uri(&format!("{LN_PUBKEY}@example.com:9735")));
|
||||
assert!(is_valid_lightning_uri(&format!(
|
||||
"{LN_PUBKEY}@example.com:9735"
|
||||
)));
|
||||
// The :port suffix is optional.
|
||||
assert!(is_valid_lightning_uri(&format!("{LN_PUBKEY}@1.2.3.4")));
|
||||
assert!(is_valid_lightning_uri(&format!("{LN_PUBKEY}@abcdefghij.onion:9735")));
|
||||
assert!(is_valid_lightning_uri(&format!(
|
||||
"{LN_PUBKEY}@abcdefghij.onion:9735"
|
||||
)));
|
||||
}
|
||||
|
||||
#[test]
|
||||
@@ -1088,16 +1094,16 @@ mod tests {
|
||||
let bad = [
|
||||
"".to_string(),
|
||||
"no-at-sign".to_string(),
|
||||
LN_PUBKEY.to_string(), // no host at all
|
||||
format!("{LN_PUBKEY}@"), // empty host
|
||||
"@1.2.3.4:9735".to_string(), // no pubkey
|
||||
format!("{}@1.2.3.4:9735", &LN_PUBKEY[..65]), // pubkey too short
|
||||
LN_PUBKEY.to_string(), // no host at all
|
||||
format!("{LN_PUBKEY}@"), // empty host
|
||||
"@1.2.3.4:9735".to_string(), // no pubkey
|
||||
format!("{}@1.2.3.4:9735", &LN_PUBKEY[..65]), // pubkey too short
|
||||
format!("{}z@1.2.3.4:9735", &LN_PUBKEY[..65]), // pubkey not hex
|
||||
format!("{LN_PUBKEY}@1.2.3.4:99999"), // port out of u16 range
|
||||
format!("{LN_PUBKEY}@1.2.3.4:"), // empty port
|
||||
format!("{LN_PUBKEY}@1.2.3.4:http"), // non-numeric port
|
||||
format!("{LN_PUBKEY}@1.2.3.4:99999"), // port out of u16 range
|
||||
format!("{LN_PUBKEY}@1.2.3.4:"), // empty port
|
||||
format!("{LN_PUBKEY}@1.2.3.4:http"), // non-numeric port
|
||||
format!("{LN_PUBKEY}@host with spaces:9735"),
|
||||
format!("{LN_PUBKEY}@a@b:9735"), // two '@'
|
||||
format!("{LN_PUBKEY}@a@b:9735"), // two '@'
|
||||
];
|
||||
for uri in bad {
|
||||
assert!(
|
||||
|
||||
Reference in New Issue
Block a user