Skip to content

Commit 8e75860

Browse files
committed
refactor(coin_selection)!: use Amount and SignedAmount for API and internally
Using named types make the API and internal code easier to read and reason about since it makes it clear that the values are bitcoin amounts. Also to create these types the units (ie .from_sat()) must be specified. Using Amount and SignedAmount also makes internal code safer against overflow errors. In particular because these types will panic if an amount overflow occurs. Using u64/i64 on the otherhand can silently rollover. See: https://doc.rust-lang.org/book/ch03-02-data-types.html#integer-overflow
1 parent 2a1787b commit 8e75860

File tree

3 files changed

+207
-167
lines changed

3 files changed

+207
-167
lines changed

0 commit comments

Comments
 (0)