Fix typos (#4164)
This commit is contained in:
parent
315eebf09c
commit
04b0bb9358
|
@ -236,7 +236,7 @@ where
|
||||||
{
|
{
|
||||||
let mut utxo_error = None;
|
let mut utxo_error = None;
|
||||||
|
|
||||||
// Retry the finalized UTXO query if it was interruped by a finalizing block,
|
// Retry the finalized UTXO query if it was interrupted by a finalizing block,
|
||||||
// and the non-finalized chain doesn't overlap the changed heights.
|
// and the non-finalized chain doesn't overlap the changed heights.
|
||||||
for _ in 0..=FINALIZED_ADDRESS_INDEX_RETRIES {
|
for _ in 0..=FINALIZED_ADDRESS_INDEX_RETRIES {
|
||||||
let (finalized_utxos, finalized_tip_range) = finalized_transparent_utxos(db, &addresses);
|
let (finalized_utxos, finalized_tip_range) = finalized_transparent_utxos(db, &addresses);
|
||||||
|
|
|
@ -20,7 +20,7 @@ proptest! {
|
||||||
assert_eq!(argument_strings, expected_strings);
|
assert_eq!(argument_strings, expected_strings);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Test that arguments in an [`Arguments`] instance can be overriden.
|
/// Test that arguments in an [`Arguments`] instance can be overridden.
|
||||||
///
|
///
|
||||||
/// Generate a list of arguments to add and a list of overrides for those arguments. Also
|
/// Generate a list of arguments to add and a list of overrides for those arguments. Also
|
||||||
/// generate a list of extra arguments.
|
/// generate a list of extra arguments.
|
||||||
|
@ -29,11 +29,11 @@ proptest! {
|
||||||
/// list of strings from the [`Arguments::into_arguments`] method is compared to a list of
|
/// list of strings from the [`Arguments::into_arguments`] method is compared to a list of
|
||||||
/// `expected_strings`.
|
/// `expected_strings`.
|
||||||
///
|
///
|
||||||
/// To build the list of `expected_strings`, a new `overriden_list` is compiled from the three
|
/// To build the list of `expected_strings`, a new `overridden_list` is compiled from the three
|
||||||
/// original lists. The list is compiled by manually handling overrides in a compatible way that
|
/// original lists. The list is compiled by manually handling overrides in a compatible way that
|
||||||
/// keeps the argument order when overriding and adding new arguments to the end of the list.
|
/// keeps the argument order when overriding and adding new arguments to the end of the list.
|
||||||
#[test]
|
#[test]
|
||||||
fn arguments_can_be_overriden(
|
fn arguments_can_be_overridden(
|
||||||
(argument_list, override_list) in Argument::list_and_overrides_strategy(),
|
(argument_list, override_list) in Argument::list_and_overrides_strategy(),
|
||||||
extra_arguments in Argument::list_strategy(),
|
extra_arguments in Argument::list_strategy(),
|
||||||
) {
|
) {
|
||||||
|
@ -46,8 +46,8 @@ proptest! {
|
||||||
let arguments = collect_arguments(arguments_to_add.clone());
|
let arguments = collect_arguments(arguments_to_add.clone());
|
||||||
let argument_strings: Vec<_> = arguments.into_arguments().collect();
|
let argument_strings: Vec<_> = arguments.into_arguments().collect();
|
||||||
|
|
||||||
let overriden_list = handle_overrides(arguments_to_add);
|
let overridden_list = handle_overrides(arguments_to_add);
|
||||||
let expected_strings = expand_arguments(overriden_list);
|
let expected_strings = expand_arguments(overridden_list);
|
||||||
|
|
||||||
assert_eq!(argument_strings, expected_strings);
|
assert_eq!(argument_strings, expected_strings);
|
||||||
}
|
}
|
||||||
|
@ -61,7 +61,7 @@ proptest! {
|
||||||
/// are added to a second [`Arguments`] instance. The second instance is then merged into the
|
/// are added to a second [`Arguments`] instance. The second instance is then merged into the
|
||||||
/// first instance. The generated list of strings from the [`Arguments::into_arguments`] method
|
/// first instance. The generated list of strings from the [`Arguments::into_arguments`] method
|
||||||
/// of that first instance is compared to a list of `expected_strings`, which is built exactly
|
/// of that first instance is compared to a list of `expected_strings`, which is built exactly
|
||||||
/// like in the [`arguments_can_be_overriden`] test.
|
/// like in the [`arguments_can_be_overridden`] test.
|
||||||
#[test]
|
#[test]
|
||||||
fn arguments_can_be_merged(
|
fn arguments_can_be_merged(
|
||||||
(argument_list, override_list) in Argument::list_and_overrides_strategy(),
|
(argument_list, override_list) in Argument::list_and_overrides_strategy(),
|
||||||
|
@ -83,8 +83,8 @@ proptest! {
|
||||||
|
|
||||||
let argument_strings: Vec<_> = first_arguments.into_arguments().collect();
|
let argument_strings: Vec<_> = first_arguments.into_arguments().collect();
|
||||||
|
|
||||||
let overriden_list = handle_overrides(all_arguments);
|
let overridden_list = handle_overrides(all_arguments);
|
||||||
let expected_strings = expand_arguments(overriden_list);
|
let expected_strings = expand_arguments(overridden_list);
|
||||||
|
|
||||||
assert_eq!(argument_strings, expected_strings);
|
assert_eq!(argument_strings, expected_strings);
|
||||||
}
|
}
|
||||||
|
@ -127,7 +127,7 @@ fn expand_arguments(argument_list: Vec<Argument>) -> Vec<String> {
|
||||||
/// This follows the behavior of [`Arguments`] when handling overrides, so that the returned list
|
/// This follows the behavior of [`Arguments`] when handling overrides, so that the returned list
|
||||||
/// is equivalent to an [`Arguments`] instance built from the same input list.
|
/// is equivalent to an [`Arguments`] instance built from the same input list.
|
||||||
fn handle_overrides(argument_list: Vec<Argument>) -> Vec<Argument> {
|
fn handle_overrides(argument_list: Vec<Argument>) -> Vec<Argument> {
|
||||||
let mut overriden_list = Vec::new();
|
let mut overridden_list = Vec::new();
|
||||||
|
|
||||||
for override_argument in argument_list {
|
for override_argument in argument_list {
|
||||||
let search_term = match &override_argument {
|
let search_term = match &override_argument {
|
||||||
|
@ -136,7 +136,7 @@ fn handle_overrides(argument_list: Vec<Argument>) -> Vec<Argument> {
|
||||||
};
|
};
|
||||||
|
|
||||||
let argument_to_override =
|
let argument_to_override =
|
||||||
overriden_list
|
overridden_list
|
||||||
.iter_mut()
|
.iter_mut()
|
||||||
.find(|existing_argument| match existing_argument {
|
.find(|existing_argument| match existing_argument {
|
||||||
Argument::LoneArgument(argument) => argument == search_term,
|
Argument::LoneArgument(argument) => argument == search_term,
|
||||||
|
@ -146,11 +146,11 @@ fn handle_overrides(argument_list: Vec<Argument>) -> Vec<Argument> {
|
||||||
if let Some(argument_to_override) = argument_to_override {
|
if let Some(argument_to_override) = argument_to_override {
|
||||||
*argument_to_override = override_argument;
|
*argument_to_override = override_argument;
|
||||||
} else {
|
} else {
|
||||||
overriden_list.push(override_argument);
|
overridden_list.push(override_argument);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
overriden_list
|
overridden_list
|
||||||
}
|
}
|
||||||
|
|
||||||
/// A helper type to generate argument items.
|
/// A helper type to generate argument items.
|
||||||
|
|
Loading…
Reference in New Issue