From 4d0ae4c710aa521fb266c8da22daf7fe16d8b32e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BF=97=E5=AE=87?= Date: Fri, 29 Mar 2024 16:34:46 +0800 Subject: [PATCH] docs: fix typos --- src/coin_selector.rs | 3 ++- src/drain.rs | 2 +- src/lib.rs | 2 +- src/metrics/lowest_fee.rs | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/coin_selector.rs b/src/coin_selector.rs index f343657..55fb710 100644 --- a/src/coin_selector.rs +++ b/src/coin_selector.rs @@ -164,7 +164,8 @@ impl<'a> CoinSelector<'a> { /// Current weight of transaction implied by the selection. /// - /// If you don't have any drain outputs (only target outputs) just set drain_weights tio [`DrainWeights::NONE`]. + /// If you don't have any drain outputs (only target outputs) just set drain_weights to + /// [`DrainWeights::NONE`]. pub fn weight(&self, target_ouputs: TargetOutputs, drain_weight: DrainWeights) -> u32 { TX_FIXED_FIELD_WEIGHT + self.input_weight() diff --git a/src/drain.rs b/src/drain.rs index 8d116bc..1881905 100644 --- a/src/drain.rs +++ b/src/drain.rs @@ -96,7 +96,7 @@ impl Drain { /// adding this outupt(s). #[derive(Clone, Copy, Debug, PartialEq)] pub struct ChangePolicy { - /// The minimum amount of excesss there needs to be add a change output. + /// The minimum amount of excess there needs to be add a change output. pub min_value: u64, /// The weights of the drain that would be added according to the policy. pub drain_weights: DrainWeights, diff --git a/src/lib.rs b/src/lib.rs index e4c926b..9bdabbd 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -45,7 +45,7 @@ pub const TX_FIXED_FIELD_WEIGHT: u32 = (4 /* nVersion */ + 4/* nLockTime */) * 4 /// The weight of a taproot keyspend witness pub const TR_KEYSPEND_SATISFACTION_WEIGHT: u32 = 1 /*witness_len*/ + 1 /*item len*/ + 64 /*signature*/; -/// The weight of a segwit `v1` (taproot) script pubkey in an outupt. This does not include the weight of +/// The weight of a segwit `v1` (taproot) script pubkey in an output. This does not include the weight of /// the `TxOut` itself or the script pubkey length field. pub const TR_SPK_WEIGHT: u32 = (1 + 1 + 32) * 4; // version + push + key diff --git a/src/metrics/lowest_fee.rs b/src/metrics/lowest_fee.rs index 4b348f2..9e3e569 100644 --- a/src/metrics/lowest_fee.rs +++ b/src/metrics/lowest_fee.rs @@ -69,7 +69,7 @@ impl BnbMetric for LowestFee { if ev < -0.0 { let value_per_negative_effective_value = low_sats_per_wu_candidate.value as f32 / ev.abs(); - // this is how much abosolute value we have to add to cancel out the excess + // this is how much absolute value we have to add to cancel out the excess let extra_value_needed_to_get_rid_of_change = amount_above_change_threshold as f32 * value_per_negative_effective_value;