rust-bitcoin-unsafe-fast/bitcoin/examples
Tobin C. Harding c950ef4bbd
Add transaction::Version data type
BIP-68 activated a fair while ago (circa 2019) and since then only
transaction versions 1 and 2 have been considered standard.

Currently in our `Transaction` struct we use an `i32`, this means users
can construct a non-standard transaction if they do not first look up
what the value should be. We can help folk out here by abstracting over
the version number.

Since the version number only governs standardness elect to make the
inner `i32` public (ie., not an invariant). The aim of the type is to
make life easy not restrict what versions are used.

Add transaction::Version data type that simply provides two consts `ONE`
and `TWO`.

Add a `Default` impl on `Version` that returns `Version::TWO`.

In tests that used version 0, instead use `Version::default` because the
test obviously does not care.
2023-09-21 15:02:02 +10:00
..
bip32.rs Rename xpub and xpriv types 2023-08-22 13:47:35 +10:00
ecdsa-psbt.rs Add transaction::Version data type 2023-09-21 15:02:02 +10:00
handshake.rs Move p2p::constants::Network to crate root 2023-08-01 16:46:59 +10:00
sighash.rs Remove usage of ThirtyTwoByteHash 2023-08-23 12:21:26 +10:00
taproot-psbt.rs Add transaction::Version data type 2023-09-21 15:02:02 +10:00