Commit 4138087
committed
Merge rust-bitcoin/rust-miniscript#426: Rework translate API to allow associated types to be translated
8e5b09ba3b47b99d9e44e389a3b81adcb5580aed Introduce Translator trait (sanket1729)
851120eba76101ab56177cdcbf4834b1c99bf230 Add impl_from_tree! (sanket1729)
c43129c4c1b61276f10de8a2dca0f7024e313ae5 Misc rustfmt change (sanket1729)
Pull request description:
The Translate API currently does not support translating the hashes and timelocks. Ideally, we want to write an HTLC as `or( and( alice_key, older(timeout), and(bob_key, sha256(hash)))`.
But it is impossible to use placeholders for `hash`, and `timelock`. It is only possible for keys.
This is a significant API change, but I think it is for good. The diff is large, but reviewing `lib.rs` is the main diff, other diffs are just chasing compiler errors
ACKs for top commit:
tcharding:
ACK 8e5b09ba3b47b99d9e44e389a3b81adcb5580aed
apoelstra:
ACK 8e5b09ba3b47b99d9e44e389a3b81adcb5580aed
Tree-SHA512: 291ccbbb76a4768c83878728288db117ed2fc45608f911ac02d8e3ec0a2ef384c10e0e086a9debf76d324978f8a6f6812f737b276a86194b3d93a032c3bd6c7dFile tree
27 files changed
+1027
-822
lines changed- examples
- src
- descriptor
- interpreter
- miniscript
- policy
- psbt
- tests/setup
27 files changed
+1027
-822
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
| 21 | + | |
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
45 | | - | |
| 45 | + | |
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
23 | 22 | | |
24 | 23 | | |
25 | 24 | | |
| |||
32 | 31 | | |
33 | 32 | | |
34 | 33 | | |
35 | | - | |
| 34 | + | |
36 | 35 | | |
37 | 36 | | |
38 | 37 | | |
| |||
145 | 144 | | |
146 | 145 | | |
147 | 146 | | |
148 | | - | |
149 | | - | |
150 | | - | |
151 | | - | |
152 | | - | |
153 | | - | |
154 | | - | |
| 147 | + | |
| 148 | + | |
155 | 149 | | |
156 | 150 | | |
157 | 151 | | |
158 | 152 | | |
159 | 153 | | |
160 | | - | |
161 | | - | |
162 | | - | |
163 | | - | |
164 | | - | |
165 | | - | |
166 | | - | |
167 | | - | |
168 | | - | |
169 | | - | |
| 154 | + | |
170 | 155 | | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
171 | 159 | | |
172 | 160 | | |
173 | 161 | | |
174 | 162 | | |
175 | 163 | | |
176 | | - | |
| 164 | + | |
177 | 165 | | |
178 | 166 | | |
179 | 167 | | |
| |||
192 | 180 | | |
193 | 181 | | |
194 | 182 | | |
195 | | - | |
| 183 | + | |
196 | 184 | | |
197 | | - | |
198 | | - | |
199 | | - | |
| 185 | + | |
200 | 186 | | |
201 | | - | |
202 | | - | |
| 187 | + | |
203 | 188 | | |
204 | 189 | | |
205 | 190 | | |
| |||
313 | 298 | | |
314 | 299 | | |
315 | 300 | | |
316 | | - | |
317 | | - | |
318 | | - | |
319 | | - | |
320 | | - | |
321 | | - | |
322 | | - | |
| 301 | + | |
| 302 | + | |
323 | 303 | | |
324 | 304 | | |
325 | 305 | | |
| |||
333 | 313 | | |
334 | 314 | | |
335 | 315 | | |
336 | | - | |
337 | | - | |
338 | | - | |
339 | | - | |
340 | | - | |
341 | | - | |
342 | | - | |
343 | | - | |
344 | | - | |
345 | | - | |
| 316 | + | |
346 | 317 | | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
347 | 321 | | |
348 | 322 | | |
349 | 323 | | |
350 | 324 | | |
351 | 325 | | |
352 | | - | |
| 326 | + | |
353 | 327 | | |
354 | 328 | | |
355 | 329 | | |
| |||
368 | 342 | | |
369 | 343 | | |
370 | 344 | | |
371 | | - | |
| 345 | + | |
372 | 346 | | |
373 | | - | |
374 | | - | |
| 347 | + | |
375 | 348 | | |
376 | | - | |
| 349 | + | |
377 | 350 | | |
378 | 351 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| |||
737 | 737 | | |
738 | 738 | | |
739 | 739 | | |
| 740 | + | |
740 | 741 | | |
741 | 742 | | |
742 | 743 | | |
| |||
802 | 803 | | |
803 | 804 | | |
804 | 805 | | |
| 806 | + | |
805 | 807 | | |
806 | 808 | | |
807 | 809 | | |
| |||
825 | 827 | | |
826 | 828 | | |
827 | 829 | | |
| 830 | + | |
| 831 | + | |
| 832 | + | |
| 833 | + | |
828 | 834 | | |
829 | 835 | | |
830 | 836 | | |
| |||
0 commit comments