rust-bitcoin-unsafe-fast/internals
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 CI: Remove shebang from non-executable scripts 2024-05-31 10:10:00 +10:00
src Remove a bunch of `try_into().expect()` 2025-03-20 20:19:50 +01:00
CHANGELOG.md Bump version of internals to 0.4.0 2024-09-18 12:22:59 +10:00
Cargo.toml Make `hex` in `internals` optional 2025-03-04 12:33:04 +01:00
README.md chore: format and standardize all markdowns files 2024-04-27 06:29:23 -03:00
build.rs 2024-08-25 automated rustfmt nightly 2024-08-25 01:14:09 +00:00

README.md

Rust Bitcoin Internals

This crate is only meant to be used internally by crates in the rust-bitcoin ecosystem.

This crate will never be stabilized, depend on it at your own risk.