rust-bitcoin-unsafe-fast/bitcoin
Martin Habovstiak 5dd0c9253d Remove a bunch of `try_into().expect()`
Previously we've used `try_into().expect()` because const generics were
unavailable. Then they became available but we didn't realize we could
already convert a bunch of code to not use panicking conversions. But we
can (and could for a while).

This adds an extension trait for arrays to provide basic non-panicking
operations returning arrays, so they can be composed with other
functions accepting arrays without any conversions. It also refactors a
bunch of code to use the non-panicking constructs but it's certainly not
all of it. That could be done later. This just aims at removing the
ugliest offenders and demonstrate the usefulness of this approach.

Aside from this, to avoid a bunch of duplicated work, this refactors
BIP32 key parsing to use a common method where xpub and xpriv are
encoded the same. Not doing this already led to a mistake where xpriv
implemented some additional checks that were missing in xpub. Thus this
change also indirectly fixes that bug.
2025-03-20 20:19:50 +01:00
..
contrib Remove rust-ordered dependency 2025-02-18 13:36:07 +11:00
embedded Move opcodes to primitives 2024-07-09 15:26:33 +10:00
examples amount: add from_sat_i32 and from_sat_u32 methods for small constants 2025-03-18 19:27:53 +00:00
src Remove a bunch of `try_into().expect()` 2025-03-20 20:19:50 +01:00
tests tests: replace Amount::from_sat_unchecked with from_sat.unwrap 2025-03-18 19:27:53 +00:00
CHANGELOG.md Grab missing changelog 2025-02-25 19:35:43 +11:00
Cargo.toml Remove references to cfg(mutate) from lint allow - no longer allowed 2025-03-10 12:45:57 +08:00