Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 3 additions & 7 deletions cktap-ffi/src/sats_card.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,10 @@ impl SatsCard {
Ok(pubkey_desc)
}

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

/// Verify the card has authentic Coinkite root certificate
Expand Down
8 changes: 2 additions & 6 deletions cktap-ffi/src/sats_chip.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,9 @@ impl SatsChip {
read(&mut *card, None).await
}

pub async fn wait(&self) -> Result<(), CkTapError> {
pub async fn wait(&self) -> Result<Option<u8>, CkTapError> {
let mut card = self.0.lock().await;
// if auth delay call wait
while card.auth_delay().is_some() {
card.wait(None).await?;
}
Ok(())
card.wait(None).await.map_err(CkTapError::from)
}

pub async fn check_cert(&self) -> Result<(), CertsError> {
Expand Down
8 changes: 2 additions & 6 deletions cktap-ffi/src/tap_signer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,9 @@ impl TapSigner {
read(&mut *card, Some(cvc)).await
}

pub async fn wait(&self) -> Result<(), CkTapError> {
pub async fn wait(&self) -> Result<Option<u8>, CkTapError> {
let mut card = self.0.lock().await;
// if auth delay call wait
while card.auth_delay().is_some() {
card.wait(None).await?;
}
Ok(())
card.wait(None).await.map_err(CkTapError::from)
}

pub async fn check_cert(&self) -> Result<(), CertsError> {
Expand Down
Loading
Loading