Skip to content

Commit

Permalink
fix: refactor ConversationTests.swift
Browse files Browse the repository at this point in the history
  • Loading branch information
kele-leanes committed Feb 1, 2024
1 parent 8e662c7 commit ec8192b
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Tests/XMTPTests/ConversationTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,8 @@ class ConversationTests: XCTestCase {
}

let codec = TextCodec()
let originalContent = try codec.encode(content: "hello", client: aliceClient)
let originalContentText = "hello"
let originalContent = try codec.encode(content: originalContentText, client: aliceClient)
let tamperedContent = try codec.encode(content: "this is a fake", client: aliceClient)

let originalPayload = try originalContent.serializedData()
Expand All @@ -292,12 +293,14 @@ class ConversationTests: XCTestCase {
let infoEncoded = info.data(using: .utf8)

let senderHmac = try Crypto.generateHmacSignature(secret: aliceConversation.keyMaterial, info: infoEncoded!, message: headerBytes)

let shouldPush = try codec.shouldPush(content: originalContentText)

let tamperedMessage = MessageV2(
headerBytes: headerBytes,
ciphertext: ciphertext,
senderHmac: senderHmac,
shouldPush: false
shouldPush: shouldPush
)

try await aliceClient.publish(envelopes: [
Expand Down

0 comments on commit ec8192b

Please sign in to comment.