Skip to content

Commit c91b137

Browse files
committed
refactor(ffi): expose satscard stepwise wait via wait
1 parent 257ac57 commit c91b137

3 files changed

Lines changed: 425 additions & 291 deletions

File tree

cktap-ffi/src/sats_card.rs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -67,14 +67,10 @@ impl SatsCard {
6767
Ok(pubkey_desc)
6868
}
6969

70-
/// Wait 15 seconds or until auth delay timeout is done
71-
pub async fn wait(&self) -> Result<(), CkTapError> {
70+
/// Wait one second of auth delay and return the remaining delay, if any.
71+
pub async fn wait(&self) -> Result<Option<u8>, CkTapError> {
7272
let mut card = self.0.lock().await;
73-
// if auth delay call wait
74-
while card.auth_delay().is_some() {
75-
card.wait(None).await?;
76-
}
77-
Ok(())
73+
card.wait(None).await.map_err(CkTapError::from)
7874
}
7975

8076
/// Verify the card has authentic Coinkite root certificate

0 commit comments

Comments
 (0)