diff --git a/base_layer/chat_ffi/chat.h b/base_layer/chat_ffi/chat.h index c2babe4db4..60a14a9dfc 100644 --- a/base_layer/chat_ffi/chat.h +++ b/base_layer/chat_ffi/chat.h @@ -386,7 +386,7 @@ void destroy_contacts_liveness_data(struct ContactsLivenessData *ptr); * `*mut ptr ConversationalistsVector` - a pointer to a ConversationalistsVector * * ## Safety - * The `ConversationalistsVactor` should be destroyed after use + * The `ConversationalistsVector` should be destroyed after use */ struct ConversationalistsVector *get_conversationalists(struct ChatClient *client, int *error_out); @@ -407,7 +407,7 @@ int conversationalists_vector_len(struct ConversationalistsVector *conversationa int *error_out); /** - * Reads the ConversationalistsVector and returns a Message at a given position + * Reads the ConversationalistsVector and returns a pointer to a TariAddress at a given position * * ## Arguments * `conversationalists` - A pointer to a ConversationalistsVector diff --git a/base_layer/chat_ffi/src/conversationalists.rs b/base_layer/chat_ffi/src/conversationalists.rs index cb2a07be39..ec096fc498 100644 --- a/base_layer/chat_ffi/src/conversationalists.rs +++ b/base_layer/chat_ffi/src/conversationalists.rs @@ -92,7 +92,7 @@ pub unsafe extern "C" fn conversationalists_vector_len( c_int::try_from(conversationalists.0.len()).unwrap_or(-1) } -/// Reads the ConversationalistsVector and returns a Message at a given position +/// Reads the ConversationalistsVector and returns a pointer to a TariAddress at a given position /// /// ## Arguments /// `conversationalists` - A pointer to a ConversationalistsVector diff --git a/integration_tests/tests/steps/chat_steps.rs b/integration_tests/tests/steps/chat_steps.rs index bdfd069d0c..d01c19ddea 100644 --- a/integration_tests/tests/steps/chat_steps.rs +++ b/integration_tests/tests/steps/chat_steps.rs @@ -20,7 +20,7 @@ // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE // USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -use std::{cmp::Ordering, time::Duration}; +use std::{cmp::Ordering, convert::TryFrom, time::Duration}; use cucumber::{then, when}; use tari_common::configuration::Network; @@ -364,7 +364,10 @@ async fn count_conversationalists(world: &mut TariWorld, user: String, num: u64) for _a in 0..(TWO_MINUTES_WITH_HALF_SECOND_SLEEP) { let conversationalists = (*client).get_conversationalists().await; - match conversationalists.len().cmp(&(num as usize)) { + match conversationalists + .len() + .cmp(&(usize::try_from(num).expect("u64 to cast to usize"))) + { Ordering::Less => { tokio::time::sleep(Duration::from_millis(HALF_SECOND)).await; addresses = conversationalists.len();