LLFourn / bdk_core_staging

Staging area for bdk_core initial development
15 stars 12 forks source link

Methods that change derivation indicies should return changesets #150

Closed evanlinjin closed 1 year ago

evanlinjin commented 1 year ago

Fixes #141

Main changes:

Bug fixes:

Other changes:

codecov-commenter commented 1 year ago

Codecov Report

Merging #150 (277af58) into master (8c57141) will increase coverage by 9.54%. The diff coverage is 95.95%.

@@            Coverage Diff             @@
##           master     #150      +/-   ##
==========================================
+ Coverage   64.85%   74.39%   +9.54%     
==========================================
  Files           9       10       +1     
  Lines         367      539     +172     
==========================================
+ Hits          238      401     +163     
- Misses        129      138       +9     
Impacted Files Coverage Δ
bdk_chain/src/file_store.rs 0.00% <ø> (ø)
bdk_chain/src/keychain/keychain_txout_index.rs 88.52% <94.28%> (+88.52%) :arrow_up:
bdk_chain/src/keychain.rs 65.27% <100.00%> (+10.73%) :arrow_up:
bdk_chain/src/spk_txout_index.rs 95.00% <0.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

evanlinjin commented 1 year ago

Tests to add for KeychainTxOutIndex:

notmandatory commented 1 year ago

I created tests patch here: https://github.com/notmandatory/bdk_core_staging/commit/ea976255ab149b7bf95f091b533acfc5f8f69f6e edit: changed commit message https://github.com/notmandatory/bdk_core_staging/commit/ab607dbec69a741952f43a0312cb41e21f6cdb8b

If it looks OK feel free to pull or copy/paste in.

If you have suggestions for where else you want new tests I'm happy to do more, this is a great way for me to learn the new core code. Your docs and design make it very easy to understand what's going on! 🙏 The new multi-keychain feature in KeychainTxOutIndex looks super powerful.

notmandatory commented 1 year ago

When I do a cargo fmt I get:

Warning: can't set `imports_granularity = Crate`, unstable features are only available in nightly channel. 

Do we need to turn this off to work with stable and our MSRV?

notmandatory commented 1 year ago

Added similar tests for wildcard descriptors, if this and prior commit are too verbose let me know and I can tighten it up: https://github.com/notmandatory/bdk_core_staging/commits/changesets-for-address-methods

rajarshimaitra commented 1 year ago

When I do a cargo fmt I get:

This is happening because imports_granularity isn't stable, tracking issue here: https://github.com/rust-lang/rustfmt/issues/4991 So what I do in my local is shift to nightly and then apply fmt.

evanlinjin commented 1 year ago

When I do a cargo fmt I get:

Warning: can't set `imports_granularity = Crate`, unstable features are only available in nightly channel. 

Do we need to turn this off to work with stable and our MSRV?

It wasn't me who decided to use unstable features of cargo fmt and I don't have an opinion on this. @LLFourn What do you think?

evanlinjin commented 1 year ago

It will be good to have someone continue this PR for me! Thank you @notmandatory for the tests, and @rajarshimaitra @LLFourn for the thorough review(s).

Based on the discussions, I think we should do the following changes:

Tests will also need to be fixed. Brownie points for more tests.

rajarshimaitra commented 1 year ago

@evanlinjin made the modification in an alternate PR https://github.com/LLFourn/bdk_core_staging/pull/154

evanlinjin commented 1 year ago

Replaced by #154