rust-bitcoin-unsafe-fast/bitcoin/examples
Tobin C. Harding c27b95fb0d
Make script to/from hex use consensus encoding
I'm not sure why we do not use consensus encoding currently for encoding
and decoding scripts to/from hex strings. Many tests include hard coded
hex which do not include the length prefix.

- Add a pair of encoding functions to encode/decode to/from hex without
the length prefix.
- Make `to_hex` and `from_hex` expect the length prefix i.e., use
consensus encoding.

This makes the API easier to use because the various encoding APIs can
be use together now eg `consensus::encode_hex` and `ScriptBuf::from_hex`.
2025-04-28 13:39:44 +10:00
..
bip32.rs Make capitalization of SegWit uniform in rustdocs 2024-12-17 14:28:28 +00:00
create-p2wpkh-address.rs Add p2wpkh address creation example 2024-11-27 15:09:14 -06:00
ecdsa-psbt-simple.rs amount: add from_sat_i32 and from_sat_u32 methods for small constants 2025-03-18 19:27:53 +00:00
ecdsa-psbt.rs Make script to/from hex use consensus encoding 2025-04-28 13:39:44 +10:00
handshake.rs Remove unused extern statement 2024-11-27 23:06:55 -06:00
io.rs bitcoin: Add an example of doing I/O to encode/decode 2025-01-08 10:18:00 +11:00
script.rs Make script to/from hex use consensus encoding 2025-04-28 13:39:44 +10:00
sighash.rs amount: add from_sat_i32 and from_sat_u32 methods for small constants 2025-03-18 19:27:53 +00:00
sign-tx-segwit-v0.rs amount: add from_sat_i32 and from_sat_u32 methods for small constants 2025-03-18 19:27:53 +00:00
sign-tx-taproot.rs amount: add from_sat_i32 and from_sat_u32 methods for small constants 2025-03-18 19:27:53 +00:00
taproot-psbt-simple.rs amount: add from_sat_i32 and from_sat_u32 methods for small constants 2025-03-18 19:27:53 +00:00
taproot-psbt.rs Make script to/from hex use consensus encoding 2025-04-28 13:39:44 +10:00