Skip to content

The insert_txouts test in test_tx_graph.rs needs redoing. #107

Open
@evanlinjin

Description

@evanlinjin

Describe the bug

https://github.com/bitcoindevkit/bdk/blob/7aca88474ac241bc0938ff989026463bdaf8f3ab/crates/chain/tests/test_tx_graph.rs#L16-L17

This test misunderstands Anchors. There is no such thing as an "unconfirmed anchor", and ChainPosition does not implement Anchor. We should rewrite this test to be comprehensive.

Proposed test scenarios

  • Insert tx with txid A, then insert partial txout(s) of the same txid. Expect: No changes to TxGraph (full tx should still exist in graph). Returned changeset is empty.
  • Insert partial txout with txid B. Then insert full tx with txid B. Expect: the full tx should replace the partial tx. Check graph and returned changeset to confirm this.
  • Do the above two tests with different counts of partial txids.

Metadata

Metadata

Assignees

Labels

testsNew or improved tests

Type

No type

Projects

Status

Todo

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions