Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Redo tx test #1338

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft

Redo tx test #1338

wants to merge 1 commit into from

Conversation

yanganto
Copy link
Contributor

Description

Fix #1331

All Submissions:

  • I've signed all my commits
  • I followed the contribution guidelines
  • I ran cargo fmt and cargo clippy before committing

New Features:

  • I've added tests for the new feature
  • I've added docs for the new feature

Bugfixes:

  • This pull request breaks the existing API
  • I've added tests to reproduce the issue which are now passing
  • I'm linking the issue being fixed by this PR

@yanganto yanganto marked this pull request as ready for review February 17, 2024 03:24
Copy link
Member

@evanlinjin evanlinjin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the work on this! It's good to see ChainPosition removed as an anchor.

However, please go over the ticket before marking it for review. It seems you have missed a couple of things.

Additionally, can you add docstr comments for each test? I think it's handy to have.

Comment on lines +36 to +39
txid: Txid::from_str(
"0619eff85fd33f55f61af87ee1b612d3e2a26d1aed5f130e9bc74e6d0928d643"
)
.unwrap(),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: can we use h!("txA") here? Or even better, have a variable for the outpoint and txout.

let update_ops = [(
OutPoint::new(h!("tx2"), 0),
#[test]
fn insert_full_tx_after_partial_tx_inserted() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test is implemented differently than what is stated in the ticket. We want to reintroduce the partial tx as a full tx. In other words, the partial tx should have the same txid as the full tx.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also we are missing the test where we insert a partial tx after a full tx.

last_seen: [(h!("tx2"), 1000000)].into()
}
#[test]
fn insert_txouts() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I really meant for this to be part of insert_full_tx_after_partial_tx and insert_partial_tx_after_full_tx (not implemented yet). I.e. as scenarios that we loop through.

@yanganto yanganto marked this pull request as draft March 1, 2024 14:54
@notmandatory notmandatory added module-blockchain bug Something isn't working tests and removed bug Something isn't working labels Mar 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: In Progress
Development

Successfully merging this pull request may close these issues.

The insert_txouts test in test_tx_graph.rs needs redoing.
3 participants