You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
6968fbf ci: add typo checking (Jose Storopoli)
Pull request description:
Since this is a public-facing documentation/resource repository,
we should be extra-careful and
judicious with typos.
[`typos`](https://github.com/crate-ci/typos) is a powerful source code spell checker.
I've added a CI job that runs on every PR and push to `master` (but can also be run manually with `workflow_dispatch`) that checks for typos.
I've also added a config file `.typos.toml` that deals with false positives and ignore some vendor related files and some filetypes that we don't want to check/correct for typos,
e.g. lock files.
Finally, I've also corrected a few typos that were in the codebase that typos flagged.
If you want to run yourself you can do a cargo install (or binstall) the typos-cli:
```bash
cargo install typos-cli
```
It is also available in several pkg managers,
check the installation options at the [`typos` repo](https://github.com/crate-ci/typos?tab=readme-ov-file#install)
ACKs for top commit:
apoelstra:
utACK 6968fbf
tcharding:
ACK 6968fbf
Tree-SHA512: 442f0e16d528bf13ebe72024f6d6a061d4d10169ae822f8729890cb8cdc1d6cfdfd66f3732af3b1b931f2f9d5ca9596e869ec92b8f359c792c31edf4916dfa12
Copy file name to clipboardExpand all lines: cookbook/src/tx_segwit-v0.md
+2-3
Original file line number
Diff line number
Diff line change
@@ -307,7 +307,7 @@ This is the message that we will sign.
307
307
The [Message::from](https://docs.rs/secp256k1/0.29.0/secp256k1/struct.Message.html#impl-From%3C%26%27_%20bitcoin%3A%3Ahashes%3A%3Asha256d%3A%3AHash%3E) method takes anything that implements the promises to be a thirty two byte hash i.e., 32 bytes that came from a cryptographically secure hashing algorithm.
308
308
309
309
We compute the signature `sig` by using the [`sign_ecdsa`](https://docs.rs/secp256k1/0.29.0/secp256k1/struct.Secp256k1.html#method.sign_ecdsa) method.
310
-
It takes a refence to a [`Message`](https://docs.rs/secp256k1/0.29.0/secp256k1/struct.Message.html) and a reference to a [`SecretKey`](https://docs.rs/secp256k1/0.29.0/secp256k1/struct.SecretKey.html) as arguments,
310
+
It takes a reference to a [`Message`](https://docs.rs/secp256k1/0.29.0/secp256k1/struct.Message.html) and a reference to a [`SecretKey`](https://docs.rs/secp256k1/0.29.0/secp256k1/struct.SecretKey.html) as arguments,
311
311
and returns a [`Signature`](https://docs.rs/secp256k1/0.29.0/secp256k1/ecdsa/struct.Signature.html) type.
312
312
313
313
In the next step, we update the witness stack for the input we just signed by first converting the `sighash_cache` into a [`Transaction`](https://docs.rs/bitcoin/0.32.0/bitcoin/blockdata/transaction/struct.Transaction.html)
@@ -337,7 +337,7 @@ This transaction is now ready to be broadcast to the Bitcoin network.
337
337
[^change]: Please note that the `CHANGE_AMOUNT` is not the same as the `DUMMY_UTXO_AMOUNT` minus the `SPEND_AMOUNT`.
338
338
This is due to the fact that we need to pay a fee for the transaction.
339
339
340
-
[^expect]: We will be unwraping any [`Option<T>`](https://doc.rust-lang.org/std/option)/[`Result<T, E>`](https://doc.rust-lang.org/std/result)
340
+
[^expect]: We will be unwrapping any [`Option<T>`](https://doc.rust-lang.org/std/option)/[`Result<T, E>`](https://doc.rust-lang.org/std/result)
341
341
with the `expect` method.
342
342
343
343
[^secp]: Under the hood we are using the [`secp256k1`](https://github.com/rust-bitcoin/rust-secp256k1/) crate to generate the key pair.
@@ -346,4 +346,3 @@ This transaction is now ready to be broadcast to the Bitcoin network.
In a real application these would be actual secrets[^secp].
64
64
We use the `SecretKey::new` method to generate a random private key `sk`.
65
-
We then use the [`Keypair::from_secret_key`](https://docs.rs/bitcoin/0.32.0/bitcoin/key/struct.Keypair.html#method.from_secret_key) method to instatiate a [`Keypair`](https://docs.rs/bitcoin/0.32.0/bitcoin/key/struct.Keypair.html) type,
65
+
We then use the [`Keypair::from_secret_key`](https://docs.rs/bitcoin/0.32.0/bitcoin/key/struct.Keypair.html#method.from_secret_key) method to instantiate a [`Keypair`](https://docs.rs/bitcoin/0.32.0/bitcoin/key/struct.Keypair.html) type,
66
66
which is a data structure that holds a keypair consisting of a secret and a public key.
67
67
Note that `senders_keys` is generic over the [`Signing`](https://docs.rs/secp256k1/0.29.0/secp256k1/trait.Signing.html) trait.
68
68
This is used to indicate that is an instance of `Secp256k1` and can be used for signing.
@@ -320,7 +320,7 @@ It takes the following arguments:
320
320
321
321
-`input_index` is the index of the input we are signing; it is a [`usize`](https://doc.rust-lang.org/std/primitive.usize.html) type.
322
322
We are using `0` since we only have one input.
323
-
-`&prevouts` is a refence to the [`Prevouts`](https://docs.rs/bitcoin/0.32.0/bitcoin/sighash/enum.Prevouts.html) enum that we defined earlier.
323
+
-`&prevouts` is a reference to the [`Prevouts`](https://docs.rs/bitcoin/0.32.0/bitcoin/sighash/enum.Prevouts.html) enum that we defined earlier.
324
324
This is used to reference the outputs of previous transactions and also used to calculate our transaction value.
325
325
-`annex` is an optional argument that is used to pass the annex data.
326
326
We are not using it, so we are passing `None`.
@@ -338,7 +338,7 @@ This is a the message that we will sign.
338
338
The [Message::from](https://docs.rs/secp256k1/0.29.0/secp256k1/struct.Message.html#impl-From%3C%26%27_%20bitcoin%3A%3Ahashes%3A%3Asha256d%3A%3AHash%3E) method takes anything that implements the promises to be a thirty two byte hash i.e., 32 bytes that came from a cryptographically secure hashing algorithm.
339
339
340
340
We compute the signature `sig` by using the [`sign_schnorr`](https://docs.rs/secp256k1/0.29.0/secp256k1/struct.Secp256k1.html#method.sign_schnorr) method.
341
-
It takes a refence to a [`Message`](https://docs.rs/secp256k1/0.29.0/secp256k1/struct.Message.html) and a reference to a [`Keypair`](https://docs.rs/secp256k1/0.29.0/secp256k1/struct.Keypair.html) as arguments,
341
+
It takes a reference to a [`Message`](https://docs.rs/secp256k1/0.29.0/secp256k1/struct.Message.html) and a reference to a [`Keypair`](https://docs.rs/secp256k1/0.29.0/secp256k1/struct.Keypair.html) as arguments,
342
342
and returns a [`Signature`](https://docs.rs/secp256k1/0.29.0/secp256k1/ecdsa/struct.Signature.html) type.
343
343
344
344
In the next step, we update the witness stack for the input we just signed by first converting the `sighash_cache` into a [`Transaction`](https://docs.rs/bitcoin/0.32.0/bitcoin/blockdata/transaction/struct.Transaction.html)
@@ -356,7 +356,7 @@ This transaction is now ready to be broadcast to the Bitcoin network.
356
356
[^change]: Please note that the `CHANGE_AMOUNT` is not the same as the `DUMMY_UTXO_AMOUNT` minus the `SPEND_AMOUNT`.
357
357
This is due to the fact that we need to pay a fee for the transaction.
358
358
359
-
[^expect]: We will be unwraping any [`Option<T>`](https://doc.rust-lang.org/std/option)/[`Result<T, E>`](https://doc.rust-lang.org/std/result)
359
+
[^expect]: We will be unwrapping any [`Option<T>`](https://doc.rust-lang.org/std/option)/[`Result<T, E>`](https://doc.rust-lang.org/std/result)
360
360
with the `expect` method.
361
361
362
362
[^secp]: Under the hood we are using the [`secp256k1`](https://github.com/rust-bitcoin/rust-secp256k1/) crate to generate the key pair.
0 commit comments