Skip to content

More tests for IndexedTxGraph and TxGraph #958

@evanlinjin

Description

@evanlinjin

Describe the enhancement

Now that #926 is merged, let's look at having more fine-grained tests.

Please comment below if you wish to work on a test (to avoid duplicate work!).

Proposed tests

For TxGraph

  • Test behavior of inserting Anchors without the corresponding transaction existing in the graph. We should allow for this behavior.

    1. Insert various anchors for a non-existing txid. Ensure Additions are as expected.
    2. Merge the resultant Additions of the previous step, and attempt to recover a new TxGraph with them (this should succeed).
    3. Now, insert the actual transaction of txid. Ensure anchors still exist.
    4. Now, attempt recovery of the TxGraph again with the appended additions.
    • @remix75
  • Test TxGraph::get_chain_position and TxGraph::list_chain_txs behavior with unconfirmed conflicts. "Unconfirmed" can either mean that the txs do not have anchors, or that the anchors are not in the best chain. Both cases need to be tested. TxGraph should always pick the transaction with the latest last_seen value. What happens if the conflicts have the same last_seen value? - @rajarshimaitra

  • Test TxGraph::get_chain_position and TxGraph::list_chain_txs behavior with unconfirmed transactions (txs with no anchors) that conflict with transactions that are confirmed. The unconfirmed transactions should not be givne a chain position or be listed. - @LagginTimes

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

Status

Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions