Skip to content

Advanced Test Suite 3#36

Open
rafanog wants to merge 1 commit intodevfrom
advanced_tests2
Open

Advanced Test Suite 3#36
rafanog wants to merge 1 commit intodevfrom
advanced_tests2

Conversation

@rafanog
Copy link
Collaborator

@rafanog rafanog commented Feb 23, 2026

Added these test cases:

  • Detect Single Block Reorg
  • Reorg Marks Following Blocks as Orphan
  • Re-sync After Reorg
  • Multi-Depth Reorg
  • Checkpoint Cannot Be Reorged
  • Reorg Shortens Chain
  • Transaction Confirmations After Reorg

@rafanog rafanog requested a review from Ignacio-87 February 23, 2026 21:22
@rafanog rafanog self-assigned this Feb 23, 2026
}

#[test]
fn test_checkpoint_cannot_be_reorged() -> Result<(), anyhow::Error> {
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm not complete sure about this test, I think the checkpoint isn’t being tested here. You invalidate block 51, which means block 50 remains unchanged. 🤔 .


#[test]
fn test_reorg_shortens_chain() -> Result<(), anyhow::Error> {
/*
Copy link
Collaborator

Choose a reason for hiding this comment

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

Not sure what is the difference between this test and the rest above. One includes the other

}

// Get original block containing the transaction
let original_block = store.get_block_by_height(tx_block_height)?.expect("Block should exist");
Copy link
Collaborator

Choose a reason for hiding this comment

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

In this test also you can test the method get_tx from indexer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants