rust-bitcoin-unsafe-fast/bitcoin/src
Andrew Poelstra f00b6362a0
Merge rust-bitcoin/rust-bitcoin#1636: Weight prediction
ae2aaaa436 Add `script_pubkey_lens` method (Martin Habovstiak)
cf068d16b0 Implement transaction weight prediction (Martin Habovstiak)

Pull request description:

  When creating a transaction one must know the the fee beforehand to set
  appropriate amounts for outputs and to know the fee, weight is required.
  So far we only had a method on an already-constructed transaction. This
  method clearly wasn't helpful when constructing the transaction except
  for hacks like temporarily adding an all-zeroes signature.

  This change adds a function that can compute the transaction weight
  without knowing individual bytes of the scripts, witnesses and other
  elements. It only needs to know their sizes.

  To make the API less error-prone a special, trivial, type is also added
  for computing the lengths of witnesses.

  Based on #1627

ACKs for top commit:
  apoelstra:
    ACK ae2aaaa436
  tcharding:
    ACK ae2aaaa436

Tree-SHA512: 55376601c2c2826bb0909cc25ff5b65816f0b1a2d57fb2cd8831f3db5382de0f4a364d518b312f0528bb5f44c30f3f74f8d254145eed2bfd65e2332b7c4d7c8b
2023-02-13 22:40:42 +00:00
..
blockdata Merge rust-bitcoin/rust-bitcoin#1636: Weight prediction 2023-02-13 22:40:42 +00:00
consensus Improve Psbt error handling 2023-01-17 16:43:39 -05:00
crypto Add KeyPair import to rustdoc example 2023-02-02 12:22:47 +11:00
merkle_tree Put the `MerkleBlock` struct at the top of the file 2023-02-10 11:53:05 +11:00
network Remove FromHex for all types except Vec and array 2023-02-01 08:26:46 +11:00
psbt Merge rust-bitcoin/rust-bitcoin#1621: Rename `from_slice` methods to `decode` 2023-02-07 16:49:55 +00:00
util Move base58 module to crate root 2022-12-01 09:56:33 +11:00
address.rs Merge rust-bitcoin/rust-bitcoin#1581: Use ignore to stop rustdoc code from being built 2023-02-12 21:21:34 +00:00
amount.rs Make max/min_value functions const 2023-01-31 08:35:32 +11:00
base58.rs Replace `Vec::from_hex` with `hex!` 2022-12-31 21:10:19 +01:00
bip32.rs Add new hex parse error variant 2023-01-28 07:53:47 +11:00
bip152.rs Do not export unusual hash types at crate root 2023-02-04 13:34:20 +11:00
bip158.rs Merge rust-bitcoin/rust-bitcoin#1579: Fix license on bip158 module 2023-02-12 21:33:47 +00:00
error.rs Move util::Error to error module 2022-11-16 10:42:30 +11:00
hash_types.rs Remove hex_from_slice and display Sighash forwards 2023-02-01 08:26:46 +11:00
internal_macros.rs Remove hex_from_slice and display Sighash forwards 2023-02-01 08:26:46 +11:00
lib.rs Do not export unusual hash types at crate root 2023-02-04 13:34:20 +11:00
parse.rs Add `Weight` and `FeeRate` newtypes 2023-02-08 23:17:30 +01:00
policy.rs Add a workspace to the top level directory. 2022-09-13 08:44:57 +10:00
pow.rs Make max/min_value functions const 2023-01-31 08:35:32 +11:00
serde_utils.rs Use marker type to enforce validation of `Address`'s network 2023-01-11 19:27:10 +08:00
sighash.rs Merge rust-bitcoin/rust-bitcoin#1624: Improve `sighash` module documentation 2023-02-07 01:21:51 +00:00
sign_message.rs Remove `ToHex` 2023-01-07 19:50:03 +01:00
string.rs impl FromHexStr for structs with single u32 member 2022-12-11 00:01:58 -05:00
taproot.rs Merge rust-bitcoin/rust-bitcoin#1621: Rename `from_slice` methods to `decode` 2023-02-07 16:49:55 +00:00
test_macros.rs Add a workspace to the top level directory. 2022-09-13 08:44:57 +10:00