Closed tnull closed 2 years ago
This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
Changes Missing Coverage | Covered Lines | Changed/Added Lines | % | ||
---|---|---|---|---|---|
src/lib.rs | 290 | 291 | 99.66% | ||
<!-- | Total: | 292 | 293 | 99.66% | --> |
Files with Coverage Reduction | New Missed Lines | % | ||
---|---|---|---|---|
src/lib.rs | 1 | 95.21% | ||
src/async.rs | 11 | 83.64% | ||
src/blocking.rs | 29 | 59.5% | ||
<!-- | Total: | 41 | --> |
Totals | |
---|---|
Change from base Build 3104888700: | 67.5% |
Covered Lines: | 632 |
Relevant Lines: | 807 |
I now covered all feasible API methods. Testing the feature parity of get_fee_estimates
is not really feasible since the results vary quite a bit.
Squashed fixups.
Tests look good but I'd like to see if we can run the tests against a local regtest bitcoind and esplora rather than hitting the blockstream server URL. I'm going to give it a try using the electrsd
crate, feel free to give it a try also, and/or when I get it working I'll show you how to do it.
@tnull, @vladimirfomene has the local regtest setup working in https://github.com/vladimirfomene/rust-esplora-client/commit/829b2fce699ab6acebbe6ed54d22ca00737a4b18, I'd like to get his changes in as a setup function that all the tests can share. Then can we put each of your tests in it's own test function ? I know each test will be very small but it's a good idea for unit tests to only test a single thing, it will make it easier to read and to see if a method call fails which one it is.
@tnull, @vladimirfomene has the local regtest setup working in vladimirfomene@829b2fc, I'd like to get his changes in as a setup function that all the tests can share. Then can we put each of your tests in it's own test function ? I know each test will be very small but it's a good idea for unit tests to only test a single thing, it will make it easier to read and to see if a method call fails which one it is.
Sounds good, will add the setup function and break the test code down into individual methods!
@tnull, you can find the updated code here: https://github.com/vladimirfomene/rust-esplora-client/tree/add-testing
@tnull, will it help if I refactor my code into a setup function and write a couple of test functions?
@tnull, will it help if I refactor my code into a setup function and write a couple of test functions?
Don't worry. I already started making the changes, will probably push an update in the next 1-2 days.
Now split the tests and updated to run against local ElectrsD
/BitcoinD
instances.
I now covered all feasible API methods. Testing the feature parity of
get_fee_estimates
is not really feasible since the results vary quite a bit.
Also added basic functionality testing of get_fee_estimates
now.
(needs rebase because #14 changed the CI)
(needs rebase because #14 changed the CI)
Rebased on master, squashed commits, and added a minor clippy warning fix.
Wow, clippy can be a pain 😁 . But passes CI now, squashed the fixups.
If ok for everyone I'd like to get this published with Vlad on Mon or Tues so we can get a PR into bdk
for the next release to remove the esplora client code there and use this crate.
This PR adds basic feature (parity) tests for the API methods:
get_tx
get_tx_no_opt
get_tx_at_block_index
get_tx_status
get_header
get_merkle_proof
get_output_status
get_height
get_tip_hash
get_fee_estimates
scripthash_txs