Skip to content

Commit

Permalink
Review changes
Browse files Browse the repository at this point in the history
  • Loading branch information
brianp committed Oct 20, 2023
1 parent d039f07 commit f8a514a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
4 changes: 2 additions & 2 deletions base_layer/chat_ffi/chat.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion base_layer/chat_ffi/src/conversationalists.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 5 additions & 2 deletions integration_tests/tests/steps/chat_steps.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit f8a514a

Please sign in to comment.