Skip to content

Commit ff77aee

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

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

lib/src/sats_card.rs

Lines changed: 5 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

0 commit comments

Comments
 (0)