]> Untitled Git - bdk/commit
bitcoind_rpc!: bring back `CheckPoint`s to `Emitter`
author志宇 <hello@evanlinjin.me>
Fri, 6 Oct 2023 16:56:01 +0000 (00:56 +0800)
committer志宇 <hello@evanlinjin.me>
Mon, 9 Oct 2023 14:14:04 +0000 (22:14 +0800)
commit5f34df8489fedae2aa3fd001036cc9ef6abe9a7a
tree247c43873c29c423e0a798a437e008ecf8cdde96
parent57590e0a1f2dad09a63fadb11f01e9f704cdcffb
bitcoind_rpc!: bring back `CheckPoint`s to `Emitter`

* `bdk_chain` dependency is added. In the future, we will introduce a
  separate `bdk_core` crate to contain shared types.
* replace `Emitter::new` with `from_height` and `from_checkpoint`
  * `from_height` emits from the given start height
  * `from_checkpoint` uses the provided cp to find agreement point
* introduce logic that ensures emitted blocks can connect with
  receiver's `LocalChain`
* in our rpc example, we can now `expect()` chain updates to always
  since we are using checkpoints and receiving blocks in order
crates/bitcoind_rpc/Cargo.toml
crates/bitcoind_rpc/src/lib.rs
crates/bitcoind_rpc/tests/test_emitter.rs
example-crates/example_bitcoind_rpc_polling/src/main.rs