Skip to content

[#455] Task 5: migrate specs to new status taxonomy + add HLR coverage #460

@sgbett

Description

@sgbett

Part of #455.

Summary

Migrate existing specs to the new status taxonomy and add new coverage for the HLR-driven behaviour. bundle exec rake spec:wallet and bundle exec rake spec:wallet-postgres must pass after Tasks 1-4 land.

Resolved decision: auto_funding_spec.rb strategy

Option 1 — add a broadcaster to the default wallet at line ~69 (stubbed). Least invasive. Specs test auto-fund behaviour, not broadcast behaviour. Preserves existing test intent with minimal diff. Use this approach.

Rejected alternatives:

  • Adding no_send: true to every call would change the test intent (the auto-fund flow being exercised assumes broadcast happens).
  • Splitting the file into broadcaster/no-broadcaster describe blocks is heavier than needed; the guard behaviour is exercised in wallet_client_spec.rb already.

Classification of existing 'completed' assertions

File Line Context Action
wallet_client_spec.rb 518 No-broadcaster + accept_delayed_broadcast: false Replace with raises-WalletError spec
wallet_client_spec.rb 544 No-broadcaster + default options Replace with raises-WalletError spec
wallet_client_auto_fund_spec.rb 513 Broadcaster + auto-fund success 'completed''unproven'
wallet_client_auto_fund_spec.rb 741 No-broadcaster + auto-fund (default options) Replace with raises-WalletError spec
wallet_client_auto_fund_spec.rb 787 Broadcaster + accept_delayed_broadcast: false 'completed''unproven'
wallet_client_auto_fund_spec.rb 817 Broadcaster + default options 'completed''unproven'
broadcast_rollback_spec.rb 137 Broadcaster + broadcast success 'completed''unproven'
inline_queue_spec.rb 122 Broadcaster + auto-fund success 'completed''unproven'
inline_queue_spec.rb 237 No-broadcaster (silent-fallback path, describe 3) Entire describe becomes "raises WalletError" tests
inline_queue_spec.rb 306 Broadcaster + finalize path success 'completed''unproven'
inline_queue_spec.rb 378-379 #status delegation round-trip Leave — arbitrary test data
auto_funding_spec.rb 137 No-broadcaster + auto-fund Add stubbed broadcaster to wallet at line ~69 (Option 1)
wire/serializer_spec.rb 331, 346 Wire-format round-trip Leave — arbitrary test data
shared_examples_for_storage_adapter.rb 72 Storage-adapter round-trip Leave — arbitrary test data
solid_queue_adapter_spec.rb 251 Job row status Keep 'completed' — job-queue lifecycle, different domain
solid_queue_adapter_spec.rb 263 Action status (worker success) 'completed''unproven'
solid_queue_adapter_spec.rb 333 Action status (finalize success) 'completed''unproven'
solid_queue_adapter_spec.rb 337 Job row status Keep 'completed'
solid_queue_adapter_spec.rb 405 Job row status (stale retry) Keep 'completed'
postgres_store_spec.rb 389-396 Storage update_action_status round-trip Leave — arbitrary test data

New specs to add

  • create_action raises WalletError when no broadcaster AND no_send is false/absent (Task 1)
  • create_action raises WalletError before any storage writes (Task 1)
  • create_action with no_send: true and no broadcaster succeeds with status 'nosend' (Task 1)
  • create_action with broadcast_queue carrying embedded broadcaster does not raise (Task 1)
  • sign_action raises WalletError when no_send flipped false at sign time with no broadcaster (Task 1)
  • create_action with broadcaster → action status 'unproven' on success (Task 2)
  • InlineQueue defensive guard raises when no broadcaster and no accept_delayed_broadcast (Task 2)
  • internalize_action with proven BEEF → 'completed' (Task 4)
  • internalize_action with unproven BEEF → 'unproven' (Task 4)
  • SolidQueueAdapter worker success → action status 'unproven', job status 'completed' (Task 3)

Acceptance criteria

  • bundle exec rake spec:wallet passes (0 failures).
  • bundle exec rake spec:wallet-postgres passes (0 failures; all pending specs pending without DATABASE_URL is acceptable — no new failures introduced).
  • No 'completed' assertions remain anywhere the asserted state is post-broadcast (pre-proof).
  • Each converted 'completed' spec has a one-line comment explaining the semantic shift if the new expectation differs from the old one (e.g. # Post-HLR #455: 'unproven' until merkle proof lands).
  • auto_funding_spec.rb wallet at line ~69 has a stubbed broadcaster (Option 1). Existing test assertions updated to 'unproven' where they currently assert 'completed'.
  • New specs for each behaviour listed above are present and green.

Files modified

  • gem/bsv-wallet/spec/bsv/wallet_interface/wallet_client_spec.rb
  • gem/bsv-wallet/spec/bsv/wallet_interface/wallet_client_auto_fund_spec.rb
  • gem/bsv-wallet/spec/bsv/wallet_interface/broadcast_rollback_spec.rb
  • gem/bsv-wallet/spec/bsv/wallet_interface/inline_queue_spec.rb
  • gem/bsv-wallet/spec/bsv/wallet/auto_funding_spec.rb
  • gem/bsv-wallet-postgres/spec/bsv/wallet_postgres/solid_queue_adapter_spec.rb

Sequencing

Lands after Tasks 1-4 (consumes their production code changes).

Metadata

Metadata

Assignees

No one assigned

    Labels

    gem:walletbsv-wallet companion gemlayer:walletBSV::Wallet moduletaskImplementation tasktestingTest infrastructure and conformance

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions