Skip to content

Commit da4a99d

Browse files
Codespell source code fixes
1 parent 6d5c093 commit da4a99d

File tree

9 files changed

+17
-17
lines changed

9 files changed

+17
-17
lines changed

src/common/merkle.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,10 @@ int merkle_get_ith_direction(size_t size, size_t index, size_t i);
7575
/**
7676
* Represents the Merkleized version of a key-value map, holding the number of elements, the root of
7777
* the Merkle tree of the sorted list of keys, and the root of the Merkle tree of the values (sorted
78-
* by their correpsonding key).
78+
* by their corresponding key).
7979
*/
8080
typedef struct {
8181
uint64_t size;
8282
uint8_t keys_root[32];
8383
uint8_t values_root[32];
84-
} merkleized_map_commitment_t;
84+
} merkleized_map_commitment_t;

src/common/wallet.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -308,9 +308,9 @@ typedef enum {
308308
// The compiler doesn't like /** inside a block comment, so we disable this warning temporarily.
309309

310310
/** Structure representing a key expression.
311-
* In V1, it's the index of a key in the key informations array, which includes the final /** step.
312-
* In V2, it's the index of a key in the key informations array, plus the two numbers a, b in the
313-
* /<NUM_a;NUM_b>/* derivation steps; here, the xpubs in the key informations array don't have extra
311+
* In V1, it's the index of a key in the key information array, which includes the final /** step.
312+
* In V2, it's the index of a key in the key information array, plus the two numbers a, b in the
313+
* /<NUM_a;NUM_b>/* derivation steps; here, the xpubs in the key information array don't have extra
314314
* derivation steps.
315315
*/
316316
#pragma GCC diagnostic pop

src/crypto.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ bool crypto_derive_symmetric_key(const char *label, size_t label_len, uint8_t ke
329329
int base58_encode_address(const uint8_t in[20], uint32_t version, char *out, size_t out_len);
330330

331331
/**
332-
* Signs a SHA-256 hash using the ECDSA with deterministic nonce accordin to RFC6979; the signing
332+
* Signs a SHA-256 hash using the ECDSA with deterministic nonce according to RFC6979; the signing
333333
* private key is the one derived at the given BIP-32 path. The signature is returned in the
334334
* conventional DER encoding.
335335
*

src/handler/lib/policy.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,7 @@ execute_processor(policy_parser_state_t *state, policy_parser_processor_t proc,
417417

418418
// p2pkh ==> legacy address (start with 1 on mainnet, m or n on testnet)
419419
// p2sh (also nested segwit) ==> legacy script (start with 3 on mainnet, 2 on testnet)
420-
// p2wpkh or p2wsh ==> bech32 (sart with bc1 on mainnet, tb1 on testnet)
420+
// p2wpkh or p2wsh ==> bech32 (start with bc1 on mainnet, tb1 on testnet)
421421

422422
// convenience function, split from get_derived_pubkey only to improve stack usage
423423
// returns -1 on error, 0 if the returned key info has no wildcard (**), 1 if it has the wildcard
@@ -1163,7 +1163,7 @@ int get_wallet_script(dispatcher_context_t *dispatcher_context,
11631163
out[1] = 32; // PUSH 32 bytes
11641164

11651165
// uint8_t h[32];
1166-
uint8_t *h = out + 2; // hack: re-use the output array to save memory
1166+
uint8_t *h = out + 2; // hack: reuse the output array to save memory
11671167

11681168
int h_length = 0;
11691169
if (!isnull_policy_node_tree(&tr_policy->tree)) {

src/handler/lib/policy.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
* @param policy_map_bytes Pointer to an array of bytes that will be used for the parsed abstract
2222
* syntax tree
2323
* @param policy_map_bytes_len Length of policy_map_bytes in bytes.
24-
* @return The memory size of the parsed descriotor template on success, a negative number in case
24+
* @return The memory size of the parsed descriptor template on success, a negative number in case
2525
* of error.
2626
*/
2727
// TODO: we should distinguish actual errors from just "policy too big to fit in memory"
@@ -46,7 +46,7 @@ typedef struct {
4646
int wallet_version; // The wallet policy version, either WALLET_POLICY_VERSION_V1 or
4747
// WALLET_POLICY_VERSION_V2
4848
const uint8_t
49-
*keys_merkle_root; // The Merkle root of the tree of key informations in the policy
49+
*keys_merkle_root; // The Merkle root of the tree of key information in the policy
5050
uint32_t n_keys; // The number of key information elements in the policy
5151
size_t address_index; // The address index to use in the derivation
5252
bool change; // whether a change address or a receive address is derived
@@ -249,4 +249,4 @@ __attribute__((warn_unused_result)) int is_policy_sane(dispatcher_context_t *dis
249249
const policy_node_t *policy,
250250
int wallet_version,
251251
const uint8_t keys_merkle_root[static 32],
252-
uint32_t n_keys);
252+
uint32_t n_keys);

src/handler/lib/psbt_parse_rawtx.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ typedef struct {
1414

1515
/**
1616
* Given a commitment to a merkleized map and a key, this flow parses it as a serialized bitcoin
17-
* transaction, computes the transaction id and optionally keeps track of the vout amunt and
17+
* transaction, computes the transaction id and optionally keeps track of the vout amount and
1818
* scriptPubkey of one of the outputs.
1919
*/
2020
int call_psbt_parse_rawtx(dispatcher_context_t *dispatcher_context,

src/handler/lib/stream_merkle_leaf_element.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@
99
* by its index. If len_callback is not NONE, it is called before the other callback with the length
1010
* of the preimage (not including the 0x00 prefix).
1111
*
12-
* Returns a nagative number on failure, or the preimage length on success.
12+
* Returns a negative number on failure, or the preimage length on success.
1313
*/
1414
int call_stream_merkle_leaf_element(dispatcher_context_t *dispatcher_context,
1515
const uint8_t merkle_root[static 32],
1616
uint32_t tree_size,
1717
uint32_t leaf_index,
1818
void (*len_callback)(size_t, void *),
1919
void (*callback)(buffer_t *, void *),
20-
void *callback_state);
20+
void *callback_state);

src/handler/sign_psbt.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1092,7 +1092,7 @@ execute_swap_checks(dispatcher_context_t *dc, sign_psbt_state_t *st) {
10921092
data_size = second_byte;
10931093
} else if (second_byte == OP_PUSHDATA1) {
10941094
// pushing more than 75 bytes requires using OP_PUSHDATA1 <len>
1095-
// insted of a single-byte opcode
1095+
// instead of a single-byte opcode
10961096
push_opcode_size = 2;
10971097
data_size = opreturn_script[2];
10981098
} else {
@@ -2106,7 +2106,7 @@ void handler_sign_psbt(dispatcher_context_t *dc, uint8_t protocol_version) {
21062106

21072107
st.protocol_version = protocol_version;
21082108

2109-
// read APDU inputs, intialize global state and read global PSBT map
2109+
// read APDU inputs, initialize global state and read global PSBT map
21102110
if (!init_global_state(dc, &st)) return;
21112111

21122112
sign_psbt_cache_t *cache = &G_sign_psbt_cache;

src/ui/display_utils.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
#define MAX_AMOUNT_LENGTH (5 + 1 + 20 + 1)
1010

1111
/**
12-
* Converts a 64-bits unsigned integer into a decimal rapresentation, where the `amount` is a
12+
* Converts a 64-bits unsigned integer into a decimal representation, where the `amount` is a
1313
* multiple of 1/100_000_000th. Trailing decimal zeros are not appended (and no decimal point is
1414
* present if the `amount` is a multiple of 100_000_000). The resulting string is prefixed with a
1515
* ticker name (up to 5 characters long), followed by a space.

0 commit comments

Comments
 (0)