rust-bitcoin-unsafe-fast/bitcoin/examples
Tobin C. Harding 6244cb75fa
Introduce monadic AmountOpResult
We would like to return an error when doing math ops on amount types.
We cannot however use the stdlib `Result` or `Option` because we want to
implement ops on the result type.

Add an `AmountOpResult` type. Return this type from all math operations
on `Amount` and `SignedAmount`.

Implement `core::iter::Sum` for the new type to allow summing iterators
of amounts - somewhat ugly to use, see tests for example usage.
2025-02-10 10:06:59 +11: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 Use _unchecked to construct amounts 2025-01-06 13:14:21 +11:00
ecdsa-psbt.rs Introduce Transaction extension traits 2024-10-30 12:28:52 +11: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
sighash.rs Use from_sat_unchecked for hardcoded ints 2025-01-24 09:05:00 +11:00
sign-tx-segwit-v0.rs Use _unchecked to construct amounts 2025-01-06 13:14:21 +11:00
sign-tx-taproot.rs Use _unchecked to construct amounts 2025-01-06 13:14:21 +11:00
taproot-psbt-simple.rs Use _unchecked to construct amounts 2025-01-06 13:14:21 +11:00
taproot-psbt.rs Introduce monadic AmountOpResult 2025-02-10 10:06:59 +11:00