Commit 5c7cc30
committed
438cd46 refactor(wallet)!: change WeightedUtxo to use Weight type (Leonardo Lima)
Pull request description:
fixes #1466
depends on #1448
<!-- You can erase any parts of this template not applicable to your Pull Request. -->
### Description
This PR is a follow-up on top of #1448, and should be rebased and merged after it, it uses the rust-bitcoin `Weight` type instead of the current `usize` usage.
NOTE: ~~It also adds a new `MiniscriptError` variant, and remove the `.unwrap()` usage.~~ As suggested I'll address this on another issue #1485, trying to reproduce the error first.
<!-- Describe the purpose of this PR, what's being adding and/or fixed -->
### Notes to the reviewers
It should be ready to review after #1448 gets merged.
<!-- In this section you can include notes directed to the reviewers, like explaining why some parts
of the PR were done in a specific way -->
### Changelog notice
- Change `WeightedUtxo` `satisfaction_weight` has been changed to use `Weight` type.
- Change `TxBuilder` methods `add_foreign_utxo` and `add_foreign_utxo_with_sequence` to expect `Weight` as `satisfaction_weight` type.
<!-- Notice the release manager should include in the release tag message changelog -->
<!-- See https://keepachangelog.com/en/1.0.0/ for examples -->
### 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
ACKs for top commit:
storopoli:
Anyways, ACK 438cd46
notmandatory:
ACK 438cd46
Tree-SHA512: 1998fe659833da890ce07aa746572ae24d035e636732c1a11b7828ffed48e753adb4108f42d00b7cd05e6f45831a7a9840faa26f94058fc13760497837af002f
File tree
5 files changed
+43
-68
lines changed- crates/wallet
- src
- wallet
- tests
5 files changed
+43
-68
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
| 17 | + | |
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| |||
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
75 | | - | |
| 75 | + | |
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
60 | 59 | | |
61 | 60 | | |
62 | 61 | | |
| |||
344 | 343 | | |
345 | 344 | | |
346 | 345 | | |
347 | | - | |
348 | | - | |
349 | | - | |
350 | | - | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
351 | 350 | | |
352 | 351 | | |
353 | 352 | | |
| |||
390 | 389 | | |
391 | 390 | | |
392 | 391 | | |
393 | | - | |
394 | | - | |
395 | | - | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
396 | 396 | | |
397 | 397 | | |
398 | 398 | | |
| |||
774 | 774 | | |
775 | 775 | | |
776 | 776 | | |
777 | | - | |
| 777 | + | |
778 | 778 | | |
779 | 779 | | |
780 | 780 | | |
| |||
834 | 834 | | |
835 | 835 | | |
836 | 836 | | |
837 | | - | |
| 837 | + | |
838 | 838 | | |
839 | 839 | | |
840 | 840 | | |
| |||
865 | 865 | | |
866 | 866 | | |
867 | 867 | | |
868 | | - | |
| 868 | + | |
869 | 869 | | |
870 | 870 | | |
871 | 871 | | |
| |||
1512 | 1512 | | |
1513 | 1513 | | |
1514 | 1514 | | |
1515 | | - | |
| 1515 | + | |
1516 | 1516 | | |
1517 | 1517 | | |
1518 | 1518 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | | - | |
35 | 34 | | |
36 | 35 | | |
37 | 36 | | |
38 | 37 | | |
39 | 38 | | |
40 | 39 | | |
41 | 40 | | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
42 | 45 | | |
43 | 46 | | |
44 | 47 | | |
| |||
1662 | 1665 | | |
1663 | 1666 | | |
1664 | 1667 | | |
1665 | | - | |
1666 | | - | |
| 1668 | + | |
1667 | 1669 | | |
1668 | 1670 | | |
1669 | 1671 | | |
| |||
1677 | 1679 | | |
1678 | 1680 | | |
1679 | 1681 | | |
1680 | | - | |
1681 | | - | |
| 1682 | + | |
| 1683 | + | |
| 1684 | + | |
1682 | 1685 | | |
1683 | 1686 | | |
1684 | 1687 | | |
| |||
1987 | 1990 | | |
1988 | 1991 | | |
1989 | 1992 | | |
1990 | | - | |
| 1993 | + | |
1991 | 1994 | | |
1992 | 1995 | | |
1993 | 1996 | | |
1994 | 1997 | | |
1995 | 1998 | | |
1996 | 1999 | | |
1997 | 2000 | | |
1998 | | - | |
1999 | 2001 | | |
2000 | 2002 | | |
2001 | 2003 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
47 | | - | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
48 | 50 | | |
49 | 51 | | |
50 | 52 | | |
| |||
295 | 297 | | |
296 | 298 | | |
297 | 299 | | |
298 | | - | |
299 | | - | |
300 | | - | |
| 300 | + | |
301 | 301 | | |
302 | 302 | | |
303 | 303 | | |
| |||
366 | 366 | | |
367 | 367 | | |
368 | 368 | | |
369 | | - | |
| 369 | + | |
370 | 370 | | |
371 | 371 | | |
372 | 372 | | |
| |||
381 | 381 | | |
382 | 382 | | |
383 | 383 | | |
384 | | - | |
| 384 | + | |
385 | 385 | | |
386 | 386 | | |
387 | 387 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1387 | 1387 | | |
1388 | 1388 | | |
1389 | 1389 | | |
1390 | | - | |
1391 | | - | |
1392 | | - | |
1393 | | - | |
1394 | | - | |
| 1390 | + | |
1395 | 1391 | | |
1396 | 1392 | | |
1397 | 1393 | | |
| |||
1467 | 1463 | | |
1468 | 1464 | | |
1469 | 1465 | | |
1470 | | - | |
1471 | | - | |
1472 | | - | |
1473 | | - | |
1474 | | - | |
| 1466 | + | |
1475 | 1467 | | |
1476 | 1468 | | |
1477 | 1469 | | |
| |||
1488 | 1480 | | |
1489 | 1481 | | |
1490 | 1482 | | |
1491 | | - | |
1492 | | - | |
1493 | | - | |
1494 | | - | |
1495 | | - | |
| 1483 | + | |
| 1484 | + | |
1496 | 1485 | | |
1497 | 1486 | | |
1498 | 1487 | | |
| |||
1520 | 1509 | | |
1521 | 1510 | | |
1522 | 1511 | | |
1523 | | - | |
| 1512 | + | |
1524 | 1513 | | |
1525 | 1514 | | |
1526 | 1515 | | |
| |||
1533 | 1522 | | |
1534 | 1523 | | |
1535 | 1524 | | |
1536 | | - | |
| 1525 | + | |
1537 | 1526 | | |
1538 | 1527 | | |
1539 | 1528 | | |
| |||
1565 | 1554 | | |
1566 | 1555 | | |
1567 | 1556 | | |
1568 | | - | |
1569 | | - | |
1570 | | - | |
1571 | | - | |
1572 | | - | |
| 1557 | + | |
1573 | 1558 | | |
1574 | 1559 | | |
1575 | 1560 | | |
| |||
1585 | 1570 | | |
1586 | 1571 | | |
1587 | 1572 | | |
1588 | | - | |
1589 | | - | |
1590 | | - | |
1591 | | - | |
1592 | | - | |
| 1573 | + | |
1593 | 1574 | | |
1594 | 1575 | | |
1595 | 1576 | | |
| |||
1605 | 1586 | | |
1606 | 1587 | | |
1607 | 1588 | | |
1608 | | - | |
1609 | | - | |
1610 | | - | |
1611 | | - | |
1612 | | - | |
| 1589 | + | |
1613 | 1590 | | |
1614 | 1591 | | |
1615 | 1592 | | |
| |||
3420 | 3397 | | |
3421 | 3398 | | |
3422 | 3399 | | |
3423 | | - | |
3424 | | - | |
3425 | | - | |
3426 | | - | |
3427 | | - | |
| 3400 | + | |
3428 | 3401 | | |
3429 | 3402 | | |
3430 | 3403 | | |
| |||
0 commit comments