Avoid returning SessionState from the ratchet initializer functions

These still need to be exposed for the Java tests but they only
need to see the SessionRecord not the SessionState.

The internal functions still need to return a SessionState due to how
these functions are used within the crate.
This commit is contained in:
Jack Lloyd
2020-12-10 08:30:42 -05:00
parent d9177ca951
commit f87c41b0d1
7 changed files with 33 additions and 29 deletions

View File

@@ -656,18 +656,14 @@ fn optional_one_time_prekey() -> Result<(), SignalProtocolError> {
#[test]
fn basic_session_v3() -> Result<(), SignalProtocolError> {
let (alice_session, bob_session) = initialize_sessions_v3()?;
let alice_session_record = SessionRecord::new(alice_session);
let bob_session_record = SessionRecord::new(bob_session);
run_session_interaction(alice_session_record, bob_session_record)?;
run_session_interaction(alice_session, bob_session)?;
Ok(())
}
#[test]
fn message_key_limits() -> Result<(), SignalProtocolError> {
block_on(async {
let (alice_session, bob_session) = initialize_sessions_v3()?;
let alice_session_record = SessionRecord::new(alice_session);
let bob_session_record = SessionRecord::new(bob_session);
let (alice_session_record, bob_session_record) = initialize_sessions_v3()?;
let alice_address = ProtocolAddress::new("+14159999999".to_owned(), 1);
let bob_address = ProtocolAddress::new("+14158888888".to_owned(), 1);