Skip to content

feat: return undefined instead of magic string for unsigned txid - #140

Merged
lcovar merged 1 commit into
masterfrom
BTC-3017.unsigned-to-undefined
Feb 9, 2026
Merged

feat: return undefined instead of magic string for unsigned txid#140
lcovar merged 1 commit into
masterfrom
BTC-3017.unsigned-to-undefined

Conversation

@lcovar

@lcovar lcovar commented Feb 6, 2026

Copy link
Copy Markdown
Contributor

Change Transaction.id and VersionedTransaction.id to return undefined (Option in Rust) when the transaction is unsigned, instead of the magic string "UNSIGNED".

This is a cleaner API that:

  • Forces callers to handle the unsigned case via type system
  • Is semantically clearer (undefined = doesn't exist yet)
  • Allows proper null checks instead of string comparison

Ticket: BTC-3017

@lcovar
lcovar requested a review from a team February 6, 2026 00:55
Change Transaction.id and VersionedTransaction.id to return `undefined`
(Option<String> in Rust) when the transaction is unsigned, instead of
the magic string "UNSIGNED".

This is a cleaner API that:
- Forces callers to handle the unsigned case via type system
- Is semantically clearer (undefined = doesn't exist yet)
- Allows proper null checks instead of string comparison

Ticket: BTC-3017
@lcovar
lcovar force-pushed the BTC-3017.unsigned-to-undefined branch from 507a1c7 to c7a0e81 Compare February 9, 2026 18:25
@lcovar
lcovar enabled auto-merge February 9, 2026 18:25
@lcovar
lcovar merged commit e0cd599 into master Feb 9, 2026
6 checks passed
@lcovar
lcovar deleted the BTC-3017.unsigned-to-undefined branch February 9, 2026 18:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants