Part of #455.
Summary
Replace 'completed' with 'unproven' on the InlineQueue broadcast success path, and remove the silent-fallback promote_without_broadcast branch that marked actions 'completed' when no broadcaster was configured.
Scope
gem/bsv-wallet/lib/bsv/wallet_interface/inline_queue.rb
Changes
broadcast_and_promote (lines ~75-110): pass explicit status: 'unproven' to promote at line ~100.
promote_without_broadcast (lines ~120-131):
- Remove the
delayed ? 'unproven' : 'completed' branch (line ~127).
- Raise
BSV::Wallet::WalletError if accept_delayed_broadcast is not set (defensive guard — Task 1 validates at create_action/sign_action entry, but this guard catches any future code path that still reaches here without opting into delayed broadcast).
- Otherwise always set
'unproven'.
promote (line ~143): keep the default status: 'completed' signature for backwards compatibility with other call sites, but in practice all internal call sites now pass explicit status.
- Update docstrings at lines ~112-119 to reflect the new semantics.
Acceptance criteria
Edge cases
- Finalize path with nil outpoints:
promote(nil, nil, txid, status: 'unproven') — the existing Array(input_outpoints).each handles nil correctly (line ~144-145). Must pass explicit status or the default 'completed' leaks through.
txid nil (unlikely but possible): skip update_action_status (already guarded at line ~146 via if txid).
- Rollback path is unchanged — keeps
'failed'.
Test scenarios
success with broadcaster, auto-fund payload → action status is 'unproven'
success with broadcaster, finalize payload (nil outpoints) → action status is 'unproven'
no broadcaster, accept_delayed_broadcast: true → action status is 'unproven'
no broadcaster, accept_delayed_broadcast: false → raises WalletError
no broadcaster, accept_delayed_broadcast absent → raises WalletError
broadcast failure → action status is 'failed' (regression)
Files modified
gem/bsv-wallet/lib/bsv/wallet_interface/inline_queue.rb
gem/bsv-wallet/spec/bsv/wallet_interface/inline_queue_spec.rb (Task 5 owns the broader spec migration; direct test additions for this file's new behaviour land here)
Sequencing
Lands after Task 1 (depends on broadcast_enabled? being in place on the BroadcastQueue interface).
Part of #455.
Summary
Replace
'completed'with'unproven'on theInlineQueuebroadcast success path, and remove the silent-fallbackpromote_without_broadcastbranch that marked actions'completed'when no broadcaster was configured.Scope
gem/bsv-wallet/lib/bsv/wallet_interface/inline_queue.rbChanges
broadcast_and_promote(lines ~75-110): pass explicitstatus: 'unproven'topromoteat line ~100.promote_without_broadcast(lines ~120-131):delayed ? 'unproven' : 'completed'branch (line ~127).BSV::Wallet::WalletErrorifaccept_delayed_broadcastis not set (defensive guard — Task 1 validates atcreate_action/sign_actionentry, but this guard catches any future code path that still reaches here without opting into delayed broadcast).'unproven'.promote(line ~143): keep the defaultstatus: 'completed'signature for backwards compatibility with other call sites, but in practice all internal call sites now pass explicit status.Acceptance criteria
InlineQueue#broadcast_and_promote, the action row in storage hasstatus: 'unproven'.InlineQueue#promote_without_broadcastwithaccept_delayed_broadcast: true→ action status'unproven'.InlineQueue#promote_without_broadcastwithaccept_delayed_broadcast: false(or absent) → raisesWalletError.'failed'(regression — line ~89 unchanged).'unproven'(not'completed').promotesignature unchanged (still defaults to'completed') — no breakage for third-party callers if any exist.Edge cases
promote(nil, nil, txid, status: 'unproven')— the existingArray(input_outpoints).eachhandles nil correctly (line ~144-145). Must pass explicit status or the default'completed'leaks through.txidnil (unlikely but possible): skipupdate_action_status(already guarded at line ~146 viaif txid).'failed'.Test scenarios
success with broadcaster, auto-fund payload → action status is 'unproven'success with broadcaster, finalize payload (nil outpoints) → action status is 'unproven'no broadcaster, accept_delayed_broadcast: true → action status is 'unproven'no broadcaster, accept_delayed_broadcast: false → raises WalletErrorno broadcaster, accept_delayed_broadcast absent → raises WalletErrorbroadcast failure → action status is 'failed'(regression)Files modified
gem/bsv-wallet/lib/bsv/wallet_interface/inline_queue.rbgem/bsv-wallet/spec/bsv/wallet_interface/inline_queue_spec.rb(Task 5 owns the broader spec migration; direct test additions for this file's new behaviour land here)Sequencing
Lands after Task 1 (depends on
broadcast_enabled?being in place on theBroadcastQueueinterface).