Skip to content

Commit

Permalink
build: add a reference topic identifier test (#311)
Browse files Browse the repository at this point in the history
  • Loading branch information
dmccartney authored Nov 13, 2023
1 parent 981e352 commit f09b49c
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions xmtp_ecies/src/topic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,16 @@ mod tests {

assert!(topic != topic_2);
}

#[test]
fn generate_reference_identifier() {
// We randomly generated this key as an explicit example for reference tests across SDKs.
let k = &[
69, 239, 223, 17, 3, 219, 126, 21, 172, 74, 55, 18, 123, 240, 246, 149, 158, 74, 183,
229, 236, 98, 133, 184, 95, 44, 130, 35, 138, 113, 36, 211,
];
let identifier = generate_private_preferences_topic_identifier(k).unwrap();

assert_eq!(identifier, "IiwU3YF9vPmMVR9dswQYscoRZyzroOkVBndrmnxJmSk");
}
}

0 comments on commit f09b49c

Please sign in to comment.