rust-bitcoin-unsafe-fast/bitcoin/src/blockdata
Andrew Poelstra 38c8f50e83
Merge rust-bitcoin/rust-bitcoin#1344: Fix `no_std` when `bitcoinconsensus` is enabled
b6f9e47dba Fix `no_std` when `bitcoinconsensus` is enabled (Martin Habovstiak)

Pull request description:

  `default-features = false` was missing previously but blindly adding it would lead to subtle risk of breaking when a crate not needing `std` depends on `bitcoinconsensus` and simultaneously another crate not needing `bitcoinconsensus` depends on `std` and another crate depends on them both.

  This change fixes it by introducing `bitcoinconsensus-std` feature flag and provides a fallback if the flag is off. Unfortunately the fallback has to use a bit of reasonable `unsafe` due to limitations of upcasting.

  The only safe alternatives are not do it and provide worse experience for crates that are affected by the problem above or break the API, which couldn't be backported and would be more annoying to use.

  Closes #1343

  This is considered PoC PR as I realized the possibility of the hack (and necessity of `unsafe`) at the last moment. Things like tests and modifying CONTRIBUTING to change the stance on `unsafe` will be added if `unsafe` is ACKed.

ACKs for top commit:
  tcharding:
    tACK b6f9e47dba
  apoelstra:
    ACK b6f9e47dba

Tree-SHA512: 3a2845f4701c94ff6214749fa490aecf3fd96089df31b15f9d3e0afe3c74329ff2b9054d51244358a79f928aa9d4cf4001fc3ec40a9b0e189323544c4480c709
2022-11-05 13:42:50 +00:00
..
locktime Improve docs on is_implied_by 2022-09-20 08:41:12 +10:00
block.rs Rename merkle_root functions 2022-10-29 07:45:48 +11:00
constants.rs Remove usage of opcodes::all 2022-10-24 13:08:47 +11:00
mod.rs Add a workspace to the top level directory. 2022-09-13 08:44:57 +10:00
opcodes.rs Add OP_0 alias for OP_PUSHBYTES_0 2022-10-27 10:40:45 -04:00
script.rs Merge rust-bitcoin/rust-bitcoin#1344: Fix `no_std` when `bitcoinconsensus` is enabled 2022-11-05 13:42:50 +00:00
transaction.rs Merge rust-bitcoin/rust-bitcoin#1367: Do clippy improvements 2022-11-04 03:17:49 -07:00
witness.rs Remove unnecessary casts 2022-11-04 11:44:23 +11:00