Skip to content

Commit 1d3561d

Browse files
committed
fix: return slotsealed when dump omits pubkey
1 parent 4731290 commit 1d3561d

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

lib/src/sats_card.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -261,8 +261,11 @@ impl SatsCard {
261261
}
262262
}
263263

264-
// at this point pubkey must be available
265-
let pubkey_bytes = dump_response.pubkey.unwrap();
264+
// at this point the card is expected to include the pubkey; if not, treat it as sealed.
265+
let pubkey_bytes = match dump_response.pubkey {
266+
Some(bytes) => bytes,
267+
None => return Err(DumpError::SlotSealed(slot)),
268+
};
266269
let pubkey = PublicKey::from_slice(&pubkey_bytes)?;
267270

268271
// TODO use chaincode and master public key to verify pubkey or return error
@@ -456,6 +459,7 @@ impl core::fmt::Debug for SatsCard {
456459
#[cfg(feature = "emulator")]
457460
#[cfg(test)]
458461
mod test {
462+
#![allow(deprecated)] // bdk_wallet::SignOptions is deprecated upstream; tests still rely on it.
459463
use crate::CkTapCard;
460464
use crate::emulator::find_emulator;
461465
use crate::emulator::test::{CardTypeOption, EcardSubprocess};

0 commit comments

Comments
 (0)