Commit Graph

1940 Commits

Author SHA1 Message Date
志宇
919e74aa8d Merge pull request #890 from evanlinjin/simplify-reveal-to-target-logic
Simplify `reveal_to_target` logic
2023-03-18 10:28:57 +08:00
志宇
72b1e2a485 Simplify reveal_to_target logic
- Remove unnecessary check
- Better comments
- Better variable names
- Add test for scanning txouts with lookahead
2023-03-18 09:18:09 +08:00
志宇
2ae69ca10b Merge pull request #889 from evanlinjin/add-async-syncing-esplora
Add docs for `EsploraAsyncExt` and make doctests runnable
2023-03-17 17:20:08 +08:00
志宇
877b658787 Add docs for EsploraAsyncExt and make doctests runnable 2023-03-16 13:08:42 +08:00
志宇
82f5d9c81e Merge pull request #888 from rajarshimaitra/greamarly-fixes
Nit fixes on documentation
2023-03-15 16:07:05 +11:00
rajarshimaitra
24df03afd6 Add documentation fixes 2023-03-15 13:00:45 +08:00
Steve Myers
cd4945af3a Merge bitcoindevkit/bdk#793: bdk v1.0.0-alpha.0
bc3e05c6c6 Doc fixes (Daniela Brozzoni)
352f95f558 [ci] misc fixes (Daniela Brozzoni)
2fcf9c4adb Make async esplora futures Send (LLFourn)
5dd4ce74cf More documentation improvements (志宇)
ae9b19d84c `bdk` README improvements (志宇)
def0c9ed39 Add `wallet_esplora_async` example and various fixes (志宇)
26ab2e2d6c Implement EsploraExt for Async client (Vladimir Fomene)
ab9242d10d Replace current caching solution with Rust Cache (Vladimir Fomene)
0aaf420f6d examples: exit if balance < SEND_AMOUNT (Daniela Brozzoni)
47faa881fb Fix cargo clippy (Daniela Brozzoni)
9d26121dbc Improve stdout output for wallet esplora/electrum examples (志宇)
eddd748870 Add `wallet_electrum` example (志宇)
0505cd7242 Remove transaction-based type parameters and traits (志宇)
de9457fce6 Changed `inflate_update` logic to not depend on `Cow` (志宇)
69cf6d7924 Use os-specific temp dir for `wallet_esplora` example (志宇)
b3836cb308 Use hardcoded send amount for `wallet_esplora` example (志宇)
b082932268 Add the wallet_esplora example (Daniela Brozzoni)
d267517dbd NewError implements StdError (fix typo) (Daniela Brozzoni)
0c7a0abb19 Disable code coverage (Daniela Brozzoni)
dfcbafd6b1 Use action-rs/toolchain in CI (Daniela Brozzoni)
0ba41c5751 Make bdk_esplora wasm compatible again (Daniela Brozzoni)
a38f63359d Make bdk_file_store use bincode v1 (LLFourn)
38ef170ed1 Make bdk and bdk_chain work under 1.57.0 (Steve Myers)
3a5d727899 Update workspace dependencies to be relative paths (Steve Myers)
96d932c830 Add clippy.toml (Daniela Brozzoni)
5708bf0c8c Fix docs (Daniela Brozzoni)
5acee82496 Update rust stable in CI (1.67.0) (Daniela Brozzoni)
8c9bcebc71 Fix the "repository" field in Cargo.toml (Daniela Brozzoni)
c61b3604e1 Fix cargo clippy warnings (Daniela Brozzoni)
1805bd35c0 Fix clippy (Daniela Brozzoni)
3f5a78ae3b Disable test-hardware-signer (Daniela Brozzoni)
303a1703c9 Rust fmt (Daniela Brozzoni)
b5559767db Rename the stub wallet examples (LLFourn)
2e82cd8c04 Use tempfile for file_store tests (LLFourn)
c069b0fb41 Move everything else over 🎉 (LLFourn)
949608ab1f Move bdk_electrum into the bdk repo 🎉 (Daniela Brozzoni)
03deafb553 Move bdk_file_store into the bdk repo 🎉 (Daniela Brozzoni)
37dfa77d9d Move bdk_chain into the bdk repo 🎉 (Daniela Brozzoni)
f2188f9dcd Make lib.rs's docs be the README.md (LLFourn)
1c970a9295 Fix code coverage CI (Daniela Brozzoni)
94a084aafd Fix doc links (LLFourn)
9edbdf54c9 [ci] Fix feature flags (LLFourn)
20e45b7af0 Add back test-hardware-signer feature (LLFourn)
6d05598407 Remove test-readme-examples (LLFourn)
b60820a7b5 Remove authors.workspace because older cargo don't like (LLFourn)
22bec6d363 Delete unused errors (LLFourn)
8a6de3aa2d Convert to workspace (LLFourn)
fdfc9b9ede Delete unused things (LLFourn)
e1eb0253cf Make doctests work (LLFourn)
3baf9721ec Use bdk_chain Balance (LLFourn)
b310a7afdd Add Wallet::cancel_tx (LLFourn)
5985706c1a Add wallet persistence (LLFourn)
57538e53e4 Move tests to /tests (LLFourn)
a40da9ba6c Make bdk no_std (LLFourn)
aab2b12f7a bdk_core integration initial commit 🔥 (LLFourn)
544c397a38 Modified build, clippy and test steps (志宇)

Pull request description:

  We prepare the BDK repo for a major restructuring 🔥. This PR maintains the existing wallet API as much as possible and adds very little.

  ## Things Done

  - database modules removed
  - blockchain gutted but new esplora syncing code added (this will be gone soon hopefully).
  - minimal API changes.
  - Many macros removed.
  - no longer applicable examples removed.
  - Much conditional compilation removed. Can compile with `--all-features` now.
  - All wallet tests passing
  - TestClient moved into its own repo
  - Example using `esplora`

  ## APIs changed

  - wallet no longer has a `sync` method. This is replaced with `apply_wallet_scan`.
  - address "caching" is gone. You can just change the derivation index with `ensure_derived_up_to` which sets your derivation to at least the argument. Unlike `ensure_addresses_cached` used to do this will alter what getting a new address gives you.
  - `AddressIndex::Reset` is gone. This thing didn't make much sense and is hard to do with the more sane internals we've established. Changing the derivation index changes what script pubkeys the wallet will search so this is dangerous. We plan to add method like `trim_unused` which lowers the derivation index to the highest unused index. Applications must handle giving out old addresses manually now (which I think is good).

  ## Unfinished work

  - [x] esplora example doesn't work for mempool transactions yet (seems like our esplora in testclient doesn't index mempool??).
  - [x] we need to figure out a way to retrieve and store transaction timestamps (we're currently just setting them to `u64::MAX`). In `bdk_core` we never got around to doing this but it needs to be done.
  - [x] A few insights we got from doing this PR should be applied to bdk_core first.
  - [x] doctests not working.

  ### Notes to the reviewers

  Try not to review the actual changes. This PR will be forced pushed a bit so it will be likely wasted.
  I think I did a faithful job of translating the tests. A bit of review here would be helpful.

  I *do* think it would be good to merge this PR soon into the v1 branch so we have something to work off once unfinished work is done.
  Checking out the branch and poke around and give feedback would be the most helpful thing.

  Run the (sort of) working example:

  ```
  cargo run --example esplora --features="bdk_test_client/bitcoind_22_0 bdk_test_client/esplora esplora"
  ```
  ### Checklists

  #### All Submissions:

  * [x] I've signed all my commits
  * [x] I followed the [contribution guidelines](https://github.com/bitcoindevkit/bdk/blob/master/CONTRIBUTING.md)
  * [x] I ran `cargo fmt` and `cargo clippy` before committing

  #### Bugfixes:

  * [x] This pull request breaks the existing API
  * [ ] I'm linking the issue being fixed by this PR (there's too many!)

ACKs for top commit:
  danielabrozzoni:
    ACK bc3e05c6c6

Tree-SHA512: b5fbfd2263bb2a7cbf7b486530e639683775209bea944b266efd9c0447fb632295f7f5ddbd2e8d79796338415eaca26f1876617c2b66523485167b22e75e449e
2023-03-14 12:48:51 -05:00
Daniela Brozzoni
bc3e05c6c6 Doc fixes 2023-03-13 22:23:40 +01:00
Daniela Brozzoni
352f95f558 [ci] misc fixes
LLFourn is squashing these to get them all signed:

Remove useless clippy allow

ci: use clippy action

[ci] remove check for features=default
2023-03-13 14:32:13 +11:00
LLFourn
2fcf9c4adb Make async esplora futures Send 2023-03-10 12:19:54 +11:00
志宇
5dd4ce74cf More documentation improvements 2023-03-10 13:40:27 +13:00
志宇
ae9b19d84c bdk README improvements 2023-03-10 10:29:12 +13:00
志宇
def0c9ed39 Add wallet_esplora_async example and various fixes
Fixes include:
* Allow `bdk_esplora` to use async with tls
* Reorganize `bdk_esplora` crate to have separate files for
  async vs blocking
* Use optional dependencies for `bdk_esplora` async
2023-03-09 11:07:45 +13:00
Vladimir Fomene
26ab2e2d6c Implement EsploraExt for Async client
Creates a separate async EsploraAsyncExt trait for the
async client using async-trait crate. It has thesame
methods as the EsploraExt trait for the blocking client.
This trait is implemented on the AsyncClient of the
rust-esplora-client crate.
2023-03-09 09:25:54 +13:00
Vladimir Fomene
ab9242d10d Replace current caching solution with Rust Cache 2023-03-08 15:42:45 +01:00
Daniela Brozzoni
0aaf420f6d examples: exit if balance < SEND_AMOUNT 2023-03-08 15:41:49 +01:00
Daniela Brozzoni
47faa881fb Fix cargo clippy 2023-03-08 15:20:20 +01:00
志宇
9d26121dbc Improve stdout output for wallet esplora/electrum examples 2023-03-08 15:28:56 +13:00
志宇
eddd748870 Add wallet_electrum example 2023-03-08 12:01:01 +13:00
志宇
0505cd7242 Remove transaction-based type parameters and traits 2023-03-08 11:39:25 +13:00
志宇
de9457fce6 Changed inflate_update logic to not depend on Cow
As mentioned by @LLFourn:

1. We have a "sparse chain" from which there is a subset of txids M that are missing from graph.
2. There is also another subset C that are in the graph but their positions have changed.
3. We used the Cow to avoid copying/duplicating in memory transactions in subset C and M

Instead in inflate_update we could remove transactions in subset M and just clone data in subset C (which is usually tiny).
2023-03-08 01:53:09 +13:00
志宇
69cf6d7924 Use os-specific temp dir for wallet_esplora example 2023-03-07 10:59:13 +13:00
志宇
b3836cb308 Use hardcoded send amount for wallet_esplora example 2023-03-07 10:47:13 +13:00
Daniela Brozzoni
b082932268 Add the wallet_esplora example 2023-03-03 17:55:23 +01:00
Daniela Brozzoni
d267517dbd NewError implements StdError (fix typo) 2023-03-03 17:55:23 +01:00
Daniela Brozzoni
0c7a0abb19 Disable code coverage
To be enabled again soon ™️
2023-03-03 17:55:22 +01:00
Daniela Brozzoni
dfcbafd6b1 Use action-rs/toolchain in CI 2023-03-03 17:44:11 +01:00
Daniela Brozzoni
0ba41c5751 Make bdk_esplora wasm compatible again
There's a huge todo!() for the AsyncClient
2023-03-03 17:44:10 +01:00
LLFourn
a38f63359d Make bdk_file_store use bincode v1 2023-03-03 17:44:10 +01:00
Steve Myers
38ef170ed1 Make bdk and bdk_chain work under 1.57.0
- rewrite some parts of the code to deal with older borrow checker
- downgraded hashbrown
2023-03-03 17:44:09 +01:00
Steve Myers
3a5d727899 Update workspace dependencies to be relative paths 2023-03-03 17:44:08 +01:00
Daniela Brozzoni
96d932c830 Add clippy.toml
Explicitly sets the project MSRV so that clippy won't give warnings
for feature added after our MSRV
2023-03-03 17:44:07 +01:00
Daniela Brozzoni
5708bf0c8c Fix docs 2023-03-03 17:44:06 +01:00
Daniela Brozzoni
5acee82496 Update rust stable in CI (1.67.0) 2023-03-03 17:44:05 +01:00
Daniela Brozzoni
8c9bcebc71 Fix the "repository" field in Cargo.toml 2023-03-03 17:44:04 +01:00
Daniela Brozzoni
c61b3604e1 Fix cargo clippy warnings
Disabled warnings for nursery/tmp_plan as it's going to be replaced
anyways
2023-03-03 17:44:03 +01:00
Daniela Brozzoni
1805bd35c0 Fix clippy 2023-03-03 17:44:02 +01:00
Daniela Brozzoni
3f5a78ae3b Disable test-hardware-signer
I suspect the latest version of HWI just broke everything
2023-03-03 17:44:01 +01:00
Daniela Brozzoni
303a1703c9 Rust fmt 2023-03-02 12:27:52 +01:00
LLFourn
b5559767db Rename the stub wallet examples 2023-03-02 10:56:38 +01:00
LLFourn
2e82cd8c04 Use tempfile for file_store tests 2023-03-02 10:56:37 +01:00
LLFourn
c069b0fb41 Move everything else over 🎉
This completes the move of things from https://github.com/LLFourn/bdk_core_staging
2023-03-02 10:56:36 +01:00
Daniela Brozzoni
949608ab1f Move bdk_electrum into the bdk repo 🎉
Original repository: 250b4f1dcc/bdk_electrum

Co-authored-by: 志宇 <hello@evanlinjin.me>
Co-authored-by: LLFourn <lloyd.fourn@gmail.com>
2023-03-02 10:56:35 +01:00
Daniela Brozzoni
03deafb553 Move bdk_file_store into the bdk repo 🎉
Original repository: 250b4f1dcc/bdk_file_store

Co-authored-by: 志宇 <hello@evanlinjin.me>
Co-authored-by: LLFourn <lloyd.fourn@gmail.com>
Co-authored-by: Vladimir Fomene <vladimirfomene@gmail.com>
2023-03-02 10:56:34 +01:00
Daniela Brozzoni
37dfa77d9d Move bdk_chain into the bdk repo 🎉
Original repository: 250b4f1dcc/bdk_chain

Co-authored-by: Steve Myers <steve@notmandatory.org>
Co-authored-by: 志宇 <hello@evanlinjin.me>
Co-authored-by: LLFourn <lloyd.fourn@gmail.com>
Co-authored-by: rajarshimaitra <rajarshi149@gmail.com>
Co-authored-by: LagginTimes <wzc110@gmail.com>
Co-authored-by: Steve Myers <steve@notmandatory.org>
Co-authored-by: Vladimir Fomene <vladimirfomene@gmail.com>
2023-03-02 10:56:33 +01:00
LLFourn
f2188f9dcd Make lib.rs's docs be the README.md
Also flesh out README a bit
2023-03-02 10:56:32 +01:00
Daniela Brozzoni
1c970a9295 Fix code coverage CI
If you want to have tests on the hardware-signer you need to install
the python libraries and start the emulator
2023-03-02 10:56:31 +01:00
LLFourn
94a084aafd Fix doc links 2023-03-02 10:56:30 +01:00
LLFourn
9edbdf54c9 [ci] Fix feature flags 2023-03-02 10:56:29 +01:00
LLFourn
20e45b7af0 Add back test-hardware-signer feature 2023-03-02 10:56:28 +01:00