Skip to content

Commit

Permalink
Rename sigint to terminate
Browse files Browse the repository at this point in the history
It no longer just sends a sigint, so rename it to something more
descriptive.
  • Loading branch information
spacebear21 committed Feb 7, 2025
1 parent 4f4432b commit 1a56abb
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions payjoin-cli/tests/e2e.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ mod e2e {
use tokio::io::{AsyncBufReadExt, AsyncWriteExt, BufReader};
use tokio::process::Command;

async fn sigint(mut child: tokio::process::Child) -> tokio::io::Result<ExitStatus> {
async fn terminate(mut child: tokio::process::Child) -> tokio::io::Result<ExitStatus> {
let pid = child.id().expect("Failed to get child PID");
kill(Pid::from_raw(pid as i32), Signal::SIGINT)?;
// wait for child process to exit completely
Expand Down Expand Up @@ -121,8 +121,8 @@ mod e2e {
.unwrap_or(Some(false)) // timed out
.expect("rx channel closed prematurely"); // recv() returned None

sigint(cli_receiver).await.expect("Failed to kill payjoin-cli");
sigint(cli_sender).await.expect("Failed to kill payjoin-cli");
terminate(cli_receiver).await.expect("Failed to kill payjoin-cli");
terminate(cli_sender).await.expect("Failed to kill payjoin-cli");

payjoin_sent
})
Expand Down Expand Up @@ -275,7 +275,7 @@ mod e2e {
.expect("payjoin-cli receiver should output a bitcoin URI");
log::debug!("Got bip21 {}", &bip21);

sigint(cli_receiver).await.expect("Failed to kill payjoin-cli");
terminate(cli_receiver).await.expect("Failed to kill payjoin-cli");
bip21
}

Expand All @@ -289,7 +289,7 @@ mod e2e {
)
.await?;

sigint(cli_sender).await.expect("Failed to kill payjoin-cli initial sender");
terminate(cli_sender).await.expect("Failed to kill payjoin-cli initial sender");
assert!(res.is_some(), "Fallback send was not detected");
Ok(())
}
Expand All @@ -304,7 +304,7 @@ mod e2e {
)
.await?;

sigint(cli_receive_resumer).await.expect("Failed to kill payjoin-cli");
terminate(cli_receive_resumer).await.expect("Failed to kill payjoin-cli");
assert!(res.is_some(), "Did not respond with Payjoin PSBT");
Ok(())
}
Expand All @@ -319,7 +319,7 @@ mod e2e {
)
.await?;

sigint(cli_send_resumer).await.expect("Failed to kill payjoin-cli");
terminate(cli_send_resumer).await.expect("Failed to kill payjoin-cli");
assert!(res.is_some(), "Payjoin send was not detected");
Ok(())
}
Expand Down

0 comments on commit 1a56abb

Please sign in to comment.