Skip to content

Redo tx test#1338

Closed
yanganto wants to merge 1 commit intobitcoindevkit:masterfrom
yanganto:redo-tx-test
Closed

Redo tx test#1338
yanganto wants to merge 1 commit intobitcoindevkit:masterfrom
yanganto:redo-tx-test

Conversation

@yanganto
Copy link
Copy Markdown
Contributor

Description

Fix bitcoindevkit/bdk_wallet#107

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

Comment thread crates/chain/src/chain_data.rs
@yanganto yanganto marked this pull request as ready for review February 17, 2024 03:24
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
@evanlinjin
Copy link
Copy Markdown
Member

Tests already fixed in #1569

@evanlinjin evanlinjin closed this Aug 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

The insert_txouts test in test_tx_graph.rs needs redoing.

3 participants