Commit 86cdaf4
committed
Merge #1808: Introduce canonicalization parameters
53afb35 test(graph): Add additional witness scenarios (Wei Chen)
46af2a5 feat(chain)!: Add ability to modify canonicalization algorithm (志宇)
58fcf32 refactor(chain): Make private fields in `CanonicalIter` concise. (志宇)
5eb5e86 feat(chain): Signed txs should displace unsigned txs in `TxGraph`. (志宇)
Pull request description:
Partially Fixes bitcoindevkit/bdk_wallet#40
### Description
Add the ability to modify the canonicalization algorithm. Right now, the only modifier is `assume_canonical` which takes in a `Vec` (ordered list) of txids and superimposes it on the canonicalization algorithm. Txs later in the list (higher index) have a higher priority (in case of conflicts).
### Notes to the reviewers
None at the moment.
### Changelog notice
* Added `CanonicalizationParams` to allow the caller to modify the canonicalization algorithm. This in a new parameter on `CanonicalIter::new`.
* Changed `TxGraph::insert_tx` to allow for updating a transaction's witness field. This is useful for initially introducing an unsigned tx and adding witnesses later on.
### 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
#### New Features:
* [x] I've added tests for the new feature
* [x] I've added docs for the new feature
#### Bugfixes:
* [x] This pull request breaks the existing API
* [x] I've added tests to reproduce the issue which are now passing
* [x] I'm linking the issue being fixed by this PR
ACKs for top commit:
LagginTimes:
ACK 53afb35
ValuedMammal:
ACK 53afb35
Tree-SHA512: 9fd070a3829d194f4d216c873922d9d47e047fa4b618628b875456f5cf4661d6b6c08a3a0dd4739b3a0f765e47c7c99acca53f195379e37f0f9cfed027bde17bFile tree
14 files changed
+618
-119
lines changed- crates
- bitcoind_rpc
- examples
- tests
- chain
- benches
- src
- tests
- common
- electrum/tests
- examples
- example_bitcoind_rpc_polling/src
- example_cli/src
- example_electrum/src
- example_esplora/src
14 files changed
+618
-119
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
92 | 92 | | |
93 | 93 | | |
94 | 94 | | |
| 95 | + | |
95 | 96 | | |
96 | 97 | | |
97 | 98 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
| 8 | + | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| |||
306 | 306 | | |
307 | 307 | | |
308 | 308 | | |
309 | | - | |
310 | | - | |
311 | | - | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
312 | 316 | | |
313 | 317 | | |
314 | 318 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
1 | 2 | | |
2 | 3 | | |
3 | 4 | | |
| |||
90 | 91 | | |
91 | 92 | | |
92 | 93 | | |
93 | | - | |
94 | | - | |
95 | | - | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
96 | 99 | | |
97 | 100 | | |
98 | 101 | | |
99 | 102 | | |
100 | 103 | | |
101 | 104 | | |
102 | 105 | | |
| 106 | + | |
103 | 107 | | |
104 | 108 | | |
105 | 109 | | |
| |||
109 | 113 | | |
110 | 114 | | |
111 | 115 | | |
| 116 | + | |
112 | 117 | | |
113 | 118 | | |
114 | 119 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
14 | 24 | | |
15 | 25 | | |
16 | 26 | | |
17 | 27 | | |
18 | 28 | | |
19 | 29 | | |
20 | | - | |
| 30 | + | |
| 31 | + | |
21 | 32 | | |
22 | | - | |
23 | | - | |
| 33 | + | |
| 34 | + | |
24 | 35 | | |
25 | 36 | | |
26 | 37 | | |
| |||
30 | 41 | | |
31 | 42 | | |
32 | 43 | | |
33 | | - | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
34 | 50 | | |
35 | | - | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
36 | 59 | | |
37 | 60 | | |
38 | 61 | | |
39 | 62 | | |
40 | | - | |
| 63 | + | |
41 | 64 | | |
42 | 65 | | |
43 | 66 | | |
| |||
46 | 69 | | |
47 | 70 | | |
48 | 71 | | |
49 | | - | |
50 | | - | |
51 | | - | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
52 | 76 | | |
53 | 77 | | |
54 | 78 | | |
| |||
77 | 101 | | |
78 | 102 | | |
79 | 103 | | |
80 | | - | |
| 104 | + | |
81 | 105 | | |
82 | 106 | | |
83 | 107 | | |
| |||
190 | 214 | | |
191 | 215 | | |
192 | 216 | | |
193 | | - | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
194 | 224 | | |
195 | 225 | | |
196 | 226 | | |
| |||
199 | 229 | | |
200 | 230 | | |
201 | 231 | | |
202 | | - | |
| 232 | + | |
203 | 233 | | |
204 | 234 | | |
205 | 235 | | |
206 | 236 | | |
207 | 237 | | |
208 | 238 | | |
209 | 239 | | |
210 | | - | |
| 240 | + | |
211 | 241 | | |
212 | 242 | | |
213 | 243 | | |
| |||
232 | 262 | | |
233 | 263 | | |
234 | 264 | | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
235 | 271 | | |
236 | 272 | | |
237 | 273 | | |
| |||
250 | 286 | | |
251 | 287 | | |
252 | 288 | | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
253 | 295 | | |
254 | 296 | | |
255 | 297 | | |
| |||
272 | 314 | | |
273 | 315 | | |
274 | 316 | | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
275 | 320 | | |
276 | 321 | | |
277 | 322 | | |
| |||
287 | 332 | | |
288 | 333 | | |
289 | 334 | | |
| 335 | + | |
290 | 336 | | |
291 | 337 | | |
292 | 338 | | |
| |||
0 commit comments