志宇
a7eaebbb77
[bdk_chain_redesign] Add serde support for IndexedAdditions
2023-03-31 22:55:57 +08:00
志宇
c09cd2afce
[bdk_chain_redesign] Added methods to LocalChain
...
Also made the `IndexedTxGraph::index` field public (`index()` and
`index_mut()` methods are no longer needed).
2023-03-31 22:42:47 +08:00
志宇
7810059ed0
[bdk_chain_redesign] TxGraph
tweaks
...
* Rename `TxNode::last_seen` to `last_seen_unconfirmed` and improve docs
* Improve `try_get_chain_position` logic and tweak comments
2023-03-31 14:15:34 +08:00
志宇
a63ffe9739
[bdk_chain_redesign] Simplify TxIndex
2023-03-31 13:45:15 +08:00
志宇
a1172def7d
[bdk_chain_redesign] Revert some API changes
...
Methods of old structures that return transaction(s) no longer return
`TxNode`, but `Transaction` as done previously.
`TxInGraph` is renamed to `TxNode`, while the internal `TxNode` is
renamed to `TxNodeInternal`.
2023-03-31 11:55:11 +08:00
志宇
8c906170c9
[bdk_chain_redesign] Make default anchor for TxGraph
as ()
...
This allows us to use the old API with minimal changes. `TxGraph`
methods have also been rearranged to allow for it.
2023-03-30 18:14:44 +08:00
志宇
468701a129
[bdk_chain_redesign] Initial work on LocalChain
.
2023-03-30 13:07:13 +08:00
志宇
34d0277e44
[bdk_chain_redesign] Rm anchor type param for structs that don't use it
2023-03-28 14:58:59 +08:00
志宇
3440a05711
[bdk_chain_redesign] Add docs
2023-03-28 10:58:23 +08:00
志宇
236c50fa7b
[bdk_chain_redesign] IndexedTxGraph
keeps track of the last synced height
...
This is important as a `ChainOracle` implementation is updated
separately to an `IndexedTxGraph`.
2023-03-27 22:42:39 +08:00
志宇
e902c10295
[bdk_chain_redesign] Fix apply_additions
logic for IndexedTxGraph
.
2023-03-27 21:51:11 +08:00
志宇
313965d8c8
[bdk_chain_redesign] mut_index
should be index_mut
2023-03-27 20:56:42 +08:00
志宇
db7883d813
[bdk_chain_redesign] Add balance methods to IndexedTxGraph
2023-03-27 19:55:57 +08:00
志宇
d0a2aa83be
[bdk_chain_redesign] Add apply_additions
to IndexedTxGraph
...
* Get mutable index from `IndexedChainGraph`.
* Also add `apply_additions` method to `TxIndex` trait.
2023-03-27 16:02:21 +08:00
志宇
6cbb18d409
[bdk_chain_redesign] MOVE: IndexedTxGraph
into submodule
2023-03-27 14:21:10 +08:00
志宇
784cd34e3d
[bdk_chain_redesign] List chain data methods can be try/non-try
...
Methods that list chain data have try and non-try versions. Both of
these versions now return an `Iterator`.
* Try versions return `Iterator<Item = Result>`.
* Non-try versions require the `ChainOracle` implementation to be
`ChainOracle<Error = Infallible>`.
2023-03-27 13:59:51 +08:00
志宇
43b648fee0
[bdk_chain_redesign] Add ..in_chain
methods
...
Add methods to `TxGraph` and `IndexedTxGraph` that gets in-best-chain
data (such as transactions, txouts, unspent txouts).
2023-03-27 12:42:59 +08:00
志宇
61a8606fbc
[bdk_chain_redesign] Introduce ChainOracle
and TxIndex
traits
...
The chain oracle keeps track of the best chain, while the transaction
index indexes transaction data in relation to script pubkeys.
This commit also includes initial work on `IndexedTxGraph`.
2023-03-26 11:03:35 +08:00
志宇
5ae5fe30eb
[bdk_chain_redesign] Introduce BlockAnchor
trait
...
* Introduce `GraphedTx` struct to access transaction data of graphed
transactions.
* Ability to insert/access anchors and "seen at" values for graphed
transactions.
* `Additions` now records changes to anchors and last_seen_at.
2023-03-24 12:11:41 +08:00
Steve Myers
82f9caddab
Bump bdk version to 1.0.0-alpha.0
...
chain to 0.4.0
electrum to 0.2.0
esplora to 0.2.0
file_store to 0.1.0
2023-03-19 23:03:48 -05: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
rajarshimaitra
24df03afd6
Add documentation fixes
2023-03-15 13:00:45 +08:00
Daniela Brozzoni
47faa881fb
Fix cargo clippy
2023-03-08 15:20:20 +01: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
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
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
303a1703c9
Rust fmt
2023-03-02 12:27:52 +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