chore: typos fixed

This commit is contained in:
Einherjar 2023-10-20 17:37:28 -03:00
parent bc8d6a396b
commit 27a63abd1e
No known key found for this signature in database
GPG Key ID: 7D8FCB8DE55EF33F
15 changed files with 26 additions and 25 deletions

View File

@ -27,6 +27,7 @@ jobs:
uses: Swatinem/rust-cache@v2.2.1 uses: Swatinem/rust-cache@v2.2.1
- name: Install grcov - name: Install grcov
run: if [[ ! -e ~/.cargo/bin/grcov ]]; then cargo install grcov; fi run: if [[ ! -e ~/.cargo/bin/grcov ]]; then cargo install grcov; fi
# TODO: re-enable the hwi tests
- name: Build simulator image - name: Build simulator image
run: docker build -t hwi/ledger_emulator ./ci -f ci/Dockerfile.ledger run: docker build -t hwi/ledger_emulator ./ci -f ci/Dockerfile.ledger
- name: Run simulator image - name: Run simulator image

View File

@ -517,7 +517,7 @@ final transaction is created by calling `finish` on the builder.
- Default to SIGHASH_ALL if not specified - Default to SIGHASH_ALL if not specified
- Replace ChangeSpendPolicy::filter_utxos with a predicate - Replace ChangeSpendPolicy::filter_utxos with a predicate
- Make 'unspendable' into a HashSet - Make 'unspendable' into a HashSet
- Stop implicitly enforcing manaul selection by .add_utxo - Stop implicitly enforcing manual selection by .add_utxo
- Rename DumbCS to LargestFirstCoinSelection - Rename DumbCS to LargestFirstCoinSelection
- Rename must_use_utxos to required_utxos - Rename must_use_utxos to required_utxos
- Rename may_use_utxos to optional_uxtos - Rename may_use_utxos to optional_uxtos

View File

@ -521,7 +521,7 @@ pub enum PolicyError {
impl fmt::Display for PolicyError { impl fmt::Display for PolicyError {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match self { match self {
Self::NotEnoughItemsSelected(err) => write!(f, "Not enought items selected: {}", err), Self::NotEnoughItemsSelected(err) => write!(f, "Not enough items selected: {}", err),
Self::IndexOutOfRange(index) => write!(f, "Index out of range: {}", index), Self::IndexOutOfRange(index) => write!(f, "Index out of range: {}", index),
Self::AddOnLeaf => write!(f, "Add on leaf"), Self::AddOnLeaf => write!(f, "Add on leaf"),
Self::AddOnPartialComplete => write!(f, "Add on partial complete"), Self::AddOnPartialComplete => write!(f, "Add on partial complete"),

View File

@ -1459,7 +1459,7 @@ impl<D> Wallet<D> {
}; };
// TODO: We should pay attention when adding a new output: this might increase // TODO: We should pay attention when adding a new output: this might increase
// the lenght of the "number of vouts" parameter by 2 bytes, potentially making // the length of the "number of vouts" parameter by 2 bytes, potentially making
// our feerate too low // our feerate too low
tx.output.push(drain_output); tx.output.push(drain_output);
} }

View File

@ -754,7 +754,7 @@ pub struct SignOptions {
/// Whether the signer should trust the `witness_utxo`, if the `non_witness_utxo` hasn't been /// Whether the signer should trust the `witness_utxo`, if the `non_witness_utxo` hasn't been
/// provided /// provided
/// ///
/// Defaults to `false` to mitigate the "SegWit bug" which chould trick the wallet into /// Defaults to `false` to mitigate the "SegWit bug" which should trick the wallet into
/// paying a fee larger than expected. /// paying a fee larger than expected.
/// ///
/// Some wallets, especially if relatively old, might not provide the `non_witness_utxo` for /// Some wallets, especially if relatively old, might not provide the `non_witness_utxo` for

View File

@ -182,7 +182,7 @@ impl<'a, D, Cs: Clone, Ctx> Clone for TxBuilder<'a, D, Cs, Ctx> {
impl<'a, D, Cs: CoinSelectionAlgorithm, Ctx: TxBuilderContext> TxBuilder<'a, D, Cs, Ctx> { impl<'a, D, Cs: CoinSelectionAlgorithm, Ctx: TxBuilderContext> TxBuilder<'a, D, Cs, Ctx> {
/// Set a custom fee rate /// Set a custom fee rate
/// The fee_rate method sets the mining fee paid by the transaction as a rate on its size. /// The fee_rate method sets the mining fee paid by the transaction as a rate on its size.
/// This means that the total fee paid is equal to this rate * size of the transaction in virtual Bytes (vB) or Weigth Unit (wu). /// This means that the total fee paid is equal to this rate * size of the transaction in virtual Bytes (vB) or Weight Unit (wu).
/// This rate is internally expressed in satoshis-per-virtual-bytes (sats/vB) using FeeRate::from_sat_per_vb, but can also be set by: /// This rate is internally expressed in satoshis-per-virtual-bytes (sats/vB) using FeeRate::from_sat_per_vb, but can also be set by:
/// * sats/kvB (1000 sats/kvB == 1 sats/vB) using FeeRate::from_sat_per_kvb /// * sats/kvB (1000 sats/kvB == 1 sats/vB) using FeeRate::from_sat_per_kvb
/// * btc/kvB (0.00001000 btc/kvB == 1 sats/vB) using FeeRate::from_btc_per_kvb /// * btc/kvB (0.00001000 btc/kvB == 1 sats/vB) using FeeRate::from_btc_per_kvb

View File

@ -1293,7 +1293,7 @@ fn test_add_foreign_utxo_where_outpoint_doesnt_match_psbt_input() {
satisfaction_weight satisfaction_weight
) )
.is_ok(), .is_ok(),
"shoulld be ok when outpoint does match psbt_input" "should be ok when outpoint does match psbt_input"
); );
} }
@ -2013,7 +2013,7 @@ fn test_bump_fee_add_input_change_dust() {
let mut tx = psbt.extract_tx(); let mut tx = psbt.extract_tx();
for txin in &mut tx.input { for txin in &mut tx.input {
txin.witness.push([0x00; P2WPKH_FAKE_WITNESS_SIZE]); // to get realisitc weight txin.witness.push([0x00; P2WPKH_FAKE_WITNESS_SIZE]); // to get realistic weight
} }
let original_tx_weight = tx.weight(); let original_tx_weight = tx.weight();
assert_eq!(tx.input.len(), 1); assert_eq!(tx.input.len(), 1);

View File

@ -735,7 +735,7 @@ fn mempool_during_reorg() -> anyhow::Result<()> {
"first mempool emission should include all txs", "first mempool emission should include all txs",
); );
// perform reorgs at different heights, these reorgs will not comfirm transactions in the // perform reorgs at different heights, these reorgs will not confirm transactions in the
// mempool // mempool
for reorg_count in 1..TIP_DIFF { for reorg_count in 1..TIP_DIFF {
println!("REORG COUNT: {}", reorg_count); println!("REORG COUNT: {}", reorg_count);
@ -808,10 +808,10 @@ fn mempool_during_reorg() -> anyhow::Result<()> {
/// If blockchain re-org includes the start height, emit new start height block /// If blockchain re-org includes the start height, emit new start height block
/// ///
/// 1. mine 101 blocks /// 1. mine 101 blocks
/// 2. emmit blocks 99a, 100a /// 2. emit blocks 99a, 100a
/// 3. invalidate blocks 99a, 100a, 101a /// 3. invalidate blocks 99a, 100a, 101a
/// 4. mine new blocks 99b, 100b, 101b /// 4. mine new blocks 99b, 100b, 101b
/// 5. emmit block 99b /// 5. emit block 99b
/// ///
/// The block hash of 99b should be different than 99a, but their previous block hashes should /// The block hash of 99b should be different than 99a, but their previous block hashes should
/// be the same. /// be the same.

View File

@ -160,7 +160,7 @@ where
/// Batch insert unconfirmed transactions, filtering out those that are irrelevant. /// Batch insert unconfirmed transactions, filtering out those that are irrelevant.
/// ///
/// Relevancy is determined by the internal [`Indexer::is_tx_relevant`] implementation of `I`. /// Relevancy is determined by the internal [`Indexer::is_tx_relevant`] implementation of `I`.
/// Irrelevant tansactions in `txs` will be ignored. /// Irrelevant transactions in `txs` will be ignored.
/// ///
/// Items of `txs` are tuples containing the transaction and a *last seen* timestamp. The /// Items of `txs` are tuples containing the transaction and a *last seen* timestamp. The
/// *last seen* communicates when the transaction is last seen in the mempool which is used for /// *last seen* communicates when the transaction is last seen in the mempool which is used for
@ -223,7 +223,7 @@ where
/// [`AnchorFromBlockPosition::from_block_position`]. /// [`AnchorFromBlockPosition::from_block_position`].
/// ///
/// Relevancy is determined by the internal [`Indexer::is_tx_relevant`] implementation of `I`. /// Relevancy is determined by the internal [`Indexer::is_tx_relevant`] implementation of `I`.
/// Irrelevant tansactions in `txs` will be ignored. /// Irrelevant transactions in `txs` will be ignored.
pub fn apply_block_relevant( pub fn apply_block_relevant(
&mut self, &mut self,
block: Block, block: Block,

View File

@ -480,7 +480,7 @@ impl<A: Clone + Ord> TxGraph<A> {
/// Inserts the given `seen_at` for `txid` into [`TxGraph`]. /// Inserts the given `seen_at` for `txid` into [`TxGraph`].
/// ///
/// Note that [`TxGraph`] only keeps track of the lastest `seen_at`. /// Note that [`TxGraph`] only keeps track of the latest `seen_at`.
pub fn insert_seen_at(&mut self, txid: Txid, seen_at: u64) -> ChangeSet<A> { pub fn insert_seen_at(&mut self, txid: Txid, seen_at: u64) -> ChangeSet<A> {
let mut update = Self::default(); let mut update = Self::default();
let (_, _, update_last_seen) = update.txs.entry(txid).or_default(); let (_, _, update_last_seen) = update.txs.entry(txid).or_default();

View File

@ -15,7 +15,7 @@ use std::vec;
#[test] #[test]
fn insert_txouts() { fn insert_txouts() {
// 2 (Outpoint, TxOut) tupples that denotes original data in the graph, as partial transactions. // 2 (Outpoint, TxOut) tuples that denotes original data in the graph, as partial transactions.
let original_ops = [ let original_ops = [
( (
OutPoint::new(h!("tx1"), 1), OutPoint::new(h!("tx1"), 1),
@ -33,7 +33,7 @@ fn insert_txouts() {
), ),
]; ];
// Another (OutPoint, TxOut) tupple to be used as update as partial transaction. // Another (OutPoint, TxOut) tuple to be used as update as partial transaction.
let update_ops = [( let update_ops = [(
OutPoint::new(h!("tx2"), 0), OutPoint::new(h!("tx2"), 0),
TxOut { TxOut {

View File

@ -32,7 +32,7 @@ const CHANNEL_BOUND: usize = 10;
const STDOUT_PRINT_DELAY: Duration = Duration::from_secs(6); const STDOUT_PRINT_DELAY: Duration = Duration::from_secs(6);
/// Delay between mempool emissions. /// Delay between mempool emissions.
const MEMPOOL_EMIT_DELAY: Duration = Duration::from_secs(30); const MEMPOOL_EMIT_DELAY: Duration = Duration::from_secs(30);
/// Delay for committing to persistance. /// Delay for committing to persistence.
const DB_COMMIT_DELAY: Duration = Duration::from_secs(60); const DB_COMMIT_DELAY: Duration = Duration::from_secs(60);
type ChangeSet = ( type ChangeSet = (
@ -184,7 +184,7 @@ fn main() -> anyhow::Result<()> {
CheckPoint::from_header(&block.header, height).into_update(false); CheckPoint::from_header(&block.header, height).into_update(false);
let chain_changeset = chain let chain_changeset = chain
.apply_update(chain_update) .apply_update(chain_update)
.expect("must always apply as we recieve blocks in order from emitter"); .expect("must always apply as we receive blocks in order from emitter");
let graph_changeset = graph.apply_block_relevant(block, height); let graph_changeset = graph.apply_block_relevant(block, height);
db.stage((chain_changeset, graph_changeset)); db.stage((chain_changeset, graph_changeset));
@ -193,7 +193,7 @@ fn main() -> anyhow::Result<()> {
last_db_commit = Instant::now(); last_db_commit = Instant::now();
db.commit()?; db.commit()?;
println!( println!(
"[{:>10}s] commited to db (took {}s)", "[{:>10}s] committed to db (took {}s)",
start.elapsed().as_secs_f32(), start.elapsed().as_secs_f32(),
last_db_commit.elapsed().as_secs_f32() last_db_commit.elapsed().as_secs_f32()
); );
@ -298,7 +298,7 @@ fn main() -> anyhow::Result<()> {
CheckPoint::from_header(&block.header, height).into_update(false); CheckPoint::from_header(&block.header, height).into_update(false);
let chain_changeset = chain let chain_changeset = chain
.apply_update(chain_update) .apply_update(chain_update)
.expect("must always apply as we recieve blocks in order from emitter"); .expect("must always apply as we receive blocks in order from emitter");
let graph_changeset = graph.apply_block_relevant(block, height); let graph_changeset = graph.apply_block_relevant(block, height);
(chain_changeset, graph_changeset) (chain_changeset, graph_changeset)
} }
@ -320,7 +320,7 @@ fn main() -> anyhow::Result<()> {
last_db_commit = Instant::now(); last_db_commit = Instant::now();
db.commit()?; db.commit()?;
println!( println!(
"[{:>10}s] commited to db (took {}s)", "[{:>10}s] committed to db (took {}s)",
start.elapsed().as_secs_f32(), start.elapsed().as_secs_f32(),
last_db_commit.elapsed().as_secs_f32() last_db_commit.elapsed().as_secs_f32()
); );

View File

@ -78,7 +78,7 @@ pub enum Commands<CS: clap::Subcommand, S: clap::Args> {
#[clap(short, default_value = "bnb")] #[clap(short, default_value = "bnb")]
coin_select: CoinSelectionAlgo, coin_select: CoinSelectionAlgo,
#[clap(flatten)] #[clap(flatten)]
chain_specfic: S, chain_specific: S,
}, },
} }
@ -585,7 +585,7 @@ where
value, value,
address, address,
coin_select, coin_select,
chain_specfic, chain_specific,
} => { } => {
let chain = &*chain.lock().unwrap(); let chain = &*chain.lock().unwrap();
let address = address.require_network(network)?; let address = address.require_network(network)?;
@ -618,7 +618,7 @@ where
} }
}; };
match (broadcast)(chain_specfic, &transaction) { match (broadcast)(chain_specific, &transaction) {
Ok(_) => { Ok(_) => {
println!("Broadcasted Tx : {}", transaction.txid()); println!("Broadcasted Tx : {}", transaction.txid());

View File

@ -106,7 +106,7 @@ fn main() -> anyhow::Result<()> {
let (init_chain_changeset, init_indexed_tx_graph_changeset) = init_changeset; let (init_chain_changeset, init_indexed_tx_graph_changeset) = init_changeset;
// Contruct `IndexedTxGraph` and `LocalChain` with our initial changeset. They are wrapped in // Construct `IndexedTxGraph` and `LocalChain` with our initial changeset. They are wrapped in
// `Mutex` to display how they can be used in a multithreaded context. Technically the mutexes // `Mutex` to display how they can be used in a multithreaded context. Technically the mutexes
// aren't strictly needed here. // aren't strictly needed here.
let graph = Mutex::new({ let graph = Mutex::new({

View File

@ -315,7 +315,7 @@ where
self.set_sequence.clone() self.set_sequence.clone()
} }
/// The minmum required transaction version required on the transaction using the plan. /// The minimum required transaction version required on the transaction using the plan.
pub fn min_version(&self) -> Option<u32> { pub fn min_version(&self) -> Option<u32> {
if let Some(_) = self.set_sequence { if let Some(_) = self.set_sequence {
Some(2) Some(2)