bdk icon indicating copy to clipboard operation
bdk copied to clipboard

Tests for blockchain-extension crates.

Open evanlinjin opened this issue 2 years ago • 1 comments

Blockchain crates such as bdk_esplora and bdk_electrum should have comprehensive tests on their extension trait methods (outputs of these methods should be as expected given different scenarios).

Although we want to test the extension methods under the same set of scenarios, the syncing/scanning logic of each example is unique, so we want to check the outputs individually. Additionally, we may change the API of these extension methods so we do not want to deal with the hassle of maintaining additional generic/wrapper code.

We will provide the extension methods real blockchain data via the bitcoind and electrsd crates.

We will maintain a list of scenarios in this ticket description (I will update it via suggestions in the comments below).

Scenarios

  • Ensure stop_gap functions correctly. Does the methods correctly process a transaction history with self-sends right at the boundaries of the input stop_gap?
  • If we provide the methods with "already-reorged" data, is the output as expected? I.e. Does the returned SparseChain/ChainGraph contain checkpoints at agreement_point and invalid_from indexes.

Original ticket: https://github.com/LLFourn/bdk_core_staging/issues/156

evanlinjin avatar Mar 17 '23 08:03 evanlinjin

@evanlinjin, I will be taking this up

vladimirfomene avatar Mar 23 '23 06:03 vladimirfomene

Current code test coverage is good, see current CodeCov stats below.

crate Line Coverage Functions
bitcoind_rpc 81.6 % , 129 / 158 50.0 % , 15 / 30
electrum 77.8 % , 273 / 351 45.5 % , 20 / 44
esplora/src 91.3 % , 1023 / 1120 54.5 % , 61 / 112

Closing this issue but feel free to open new issues on specific areas that need better testing.

notmandatory avatar Nov 21 '24 01:11 notmandatory