rust-bitcoin-unsafe-fast/bitcoin/src
Tobin C. Harding 6b2b89c2f7
Remove From<hash> for not-general-hash types
The `hash_newtype` macro is explicitly designed to produce a hash that
is not a general purpose hash type to try and prevent users hashing
arbitrary stuff with it. E.g., `Txid` isn't meant to be just hash
arbitrary data. However we provide a `From` impl that will convert any
instance of the inner hash type into the new type. This kind of defeats
the purpose. We provide `from_byte_array` and `to_byte_array` to allow
folk to 'cast' from one hash type to another if they really want to and
its ugly on purpose.

Also, it is becoming apparent that we may be able to remove the `hashes`
crate from the public API of `primitives` allowing us to stabalise
`primitives` without stabalising `hashes`.

For both these reasons remove the `From` impl from the `hash_newtype`
macro. Note that deprecating doesn't seem to work so we just delete it.
2025-03-21 09:12:25 +11:00
..
address Enable getting the network kind from an address 2025-03-17 12:27:11 +11:00
blockdata Use compute_merkle_root 2025-03-21 09:09:49 +11:00
consensus fix typos 2025-03-10 09:04:59 +08:00
crypto amount: add from_sat_i32 and from_sat_u32 methods for small constants 2025-03-18 19:27:53 +00:00
merkle_tree 2025-01-12 automated rustfmt nightly 2025-01-12 01:23:13 +00:00
network Update CompactTarget::from_next_work_required to take timespan as i64 2024-11-27 11:27:22 -06:00
p2p Remove From<hash> for not-general-hash types 2025-03-21 09:12:25 +11:00
psbt tests: replace Amount::from_sat_unchecked with from_sat.unwrap 2025-03-18 19:27:53 +00:00
taproot Don't use references to `TaprootMerkleBranchBuf` 2025-03-18 16:33:05 +01:00
bip32.rs Add validation for private key format and master key constraints 2025-03-10 10:22:41 -03:00
bip152.rs 2025-03-16 automated rustfmt nightly 2025-03-16 01:25:25 +00:00
bip158.rs 2025-01-12 automated rustfmt nightly 2025-01-12 01:23:13 +00:00
consensus_validation.rs Stop using FQP on Amount type 2025-01-24 08:54:24 +11:00
hash_types.rs bitcoin: Remove hash type re-exports 2025-03-04 08:15:04 +11:00
internal_macros.rs Set avoid-breaking-exported-api to false 2024-12-11 10:11:50 +11:00
lib.rs 2025-03-16 automated rustfmt nightly 2025-03-16 01:25:25 +00:00
policy.rs Policy: Relax MIN_STANDARD_TX_NONWITNESS_SIZE to 65 2025-02-27 00:20:08 +07:00
pow.rs chore: spellchecker 2025-03-16 07:23:18 +00:00
serde_utils.rs Elide more lifetimes 2024-10-28 15:22:13 +11:00
sign_message.rs update secp256k1 to 0.30.0 2025-03-02 23:31:48 +08:00