Commit Graph

3 Commits

Author SHA1 Message Date
Tobin C. Harding 0ed78e543b Add lock time types
Add a `LockTime` type to hold the nLockTime `u32` value. Use it in
`Transaction` for `lock_time` instead of a `u32`. Make it public so this
new type can be used by rust-miniscript and other downstream projects.

Add a `PackedLockTime` type that wraps a raw `u32` and derives `Ord`,
this type is for wrapping a consensus lock time value for nesting in
types that would like to derive `Ord`.
2022-07-27 08:39:19 +10:00
Tobin C. Harding c1d74a3eae Run the formatter
We recently merged a PR that enables the formatter on the `examples/`
directory, at the same time we merged `examples/ecdsa-psbt.rs` but CI
had already run so the formatter was not run.

Run `cargo +nightly fmt` to format the `examples/` directory.
2022-07-20 11:32:54 +10:00
Tobin Harding 6967c0ed6f Add psbt example
Add an example PSBT workflow. The workflow we simulate is that of a
setup using a watch-only online wallet (contains only public keys) and a
cold-storage wallet (contains the private keys).

We create and update a PSBT using the watch-only wallet then pass the
PSBT to the cold-storage wallet to sign.

Co-authored-by: Dan Gould <d@ngould.dev>
2022-07-19 10:59:48 +10:00