Add swap id to tracing context

This commit is contained in:
Franck Royer 2021-01-27 18:04:16 +11:00
parent b8a9356d1b
commit 704a8e7b01
No known key found for this signature in database
GPG Key ID: A82ED75A8DFC50A4
2 changed files with 2 additions and 0 deletions

View File

@ -55,6 +55,7 @@ pub async fn run(swap: alice::Swap) -> Result<AliceState> {
run_until(swap, is_complete).await
}
#[tracing::instrument(name = "swap", skip(swap,is_target_state), fields(id = %swap.swap_id))]
pub async fn run_until(
swap: alice::Swap,
is_target_state: fn(&AliceState) -> bool,

View File

@ -32,6 +32,7 @@ pub async fn run(swap: bob::Swap) -> Result<BobState> {
run_until(swap, is_complete).await
}
#[tracing::instrument(name = "swap", skip(swap,is_target_state), fields(id = %swap.swap_id))]
pub async fn run_until(
swap: bob::Swap,
is_target_state: fn(&BobState) -> bool,