test(chain): add several basic scenarios to test transaction conflicts
Description
This update introduces several test cases to validate the transaction conflict handling logic within the TxGraph. The tests encompass a range of scenarios including:
- Simple cases with isolated transactions (
only A exists). - Scenarios with conflicting transactions (
BandB'spendingA) under two basic conditions:- One of the conflicting transactions is confirmed.
- Conflicts are resolved based on the
last_seentimestamp.
Changelog Notice
- Added unit tests for transaction conflict resolution in
TxGraph.
Checklists
All Submissions:
- [x] I've signed all my commits.
- [x] I followed the contribution guidelines.
- [x] I ran
cargo fmtandcargo clippybefore committing.
Thank you for your contribution! The test case involving two conflicting transactions with different last_seen values is already addressed by the existing test scenario: "2 unconfirmed txs with same last_seens conflict." Other than that, the rest of the tests look good to me.
OK. I've removed this redundant case.
Could you please squash the second commit into the first one to keep the commit history clean? Everything will look good to me once that's done. Thanks!
Squash done.
@pluveto could you please rebase on master to fix CI? We just merged the fix for CI.
Now it's rebased.
ACK 8374f70b3428870a0ef5f77278329897464fee88
ACK 7c3f915886881c7d50e7f02eaef2774e63d1a3dc
Rebased