Commit Graph

5 Commits

Author SHA1 Message Date
Tobin C. Harding 22fd107e16 Run rustfmt
We just moved the `address` module out of `util` which is currently
ignored by `rustfmt`.

Run `rustfmt`, no other changes other than those made by the tool.
2022-08-12 07:35:15 +10:00
Tobin C. Harding e1ae9d86bb Move the address module out of util
The identifier 'util' does not convey any information. We have a whole
bunch of modules inside the `util` module.

As part of work to reduce the amount of arbitrary things in the `util`
module move the `address` module to the crate root level.
2022-08-12 07:35:15 +10:00
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