mirror of
https://github.com/aljazceru/cdk.git
synced 2025-12-24 08:05:02 +01:00
Integration tests: fix wait_for_mint_to_be_paid loop
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
|
|
||||||
use anyhow::{bail, Result};
|
use anyhow::{anyhow, bail, Result};
|
||||||
use cdk::amount::{Amount, SplitTarget};
|
use cdk::amount::{Amount, SplitTarget};
|
||||||
use cdk::nuts::nut00::ProofsMethods;
|
use cdk::nuts::nut00::ProofsMethods;
|
||||||
use cdk::nuts::{MintQuoteState, NotificationPayload, State};
|
use cdk::nuts::{MintQuoteState, NotificationPayload, State};
|
||||||
@@ -86,7 +86,7 @@ pub async fn wait_for_mint_to_be_paid(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Ok(())
|
Err(anyhow!("Subscription ended without quote being paid"))
|
||||||
};
|
};
|
||||||
|
|
||||||
let timeout_future = timeout(Duration::from_secs(timeout_secs), wait_future);
|
let timeout_future = timeout(Duration::from_secs(timeout_secs), wait_future);
|
||||||
@@ -114,7 +114,7 @@ pub async fn wait_for_mint_to_be_paid(
|
|||||||
result = timeout_future => {
|
result = timeout_future => {
|
||||||
match result {
|
match result {
|
||||||
Ok(payment_result) => payment_result,
|
Ok(payment_result) => payment_result,
|
||||||
Err(_) => Err(anyhow::anyhow!("Timeout waiting for mint quote to be paid")),
|
Err(_) => Err(anyhow!("Timeout waiting for mint quote to be paid")),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
result = periodic_task => {
|
result = periodic_task => {
|
||||||
|
|||||||
Reference in New Issue
Block a user