Skip to content

Commit

Permalink
test: add test for non-deterministic topic
Browse files Browse the repository at this point in the history
  • Loading branch information
rygine committed Aug 31, 2023
1 parent 4785676 commit d0863cf
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions test/keystore/InMemoryKeystore.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -554,13 +554,15 @@ describe('InMemoryKeystore', () => {
)
).v1!
)
bobKeystore = await InMemoryKeystore.create(bobKeys)

expect(await aliceKeystore.getAccountAddress()).toEqual(
'0xF56d1F3b1290204441Cb3843C2Cac1C2f5AEd690'
) // alice
expect(bobKeys.getPublicKeyBundle().walletSignatureAddress()).toEqual(
'0x3De402A325323Bb97f00cE3ad5bFAc96A11F9A34'
) // bob
const response = await aliceKeystore.createInvite({
const aliceInvite = await aliceKeystore.createInvite({
recipient: SignedPublicKeyBundle.fromLegacyBundle(
bobKeys.getPublicKeyBundle()
),
Expand All @@ -570,7 +572,21 @@ describe('InMemoryKeystore', () => {
metadata: {},
},
})
expect(response.conversation!.topic).toEqual(
expect(aliceInvite.conversation!.topic).toEqual(
'/xmtp/0/m-4b52be1e8567d72d0bc407debe2d3c7fca2ae93a47e58c3f9b5c5068aff80ec5/proto'
)

const bobInvite = await bobKeystore.createInvite({
recipient: SignedPublicKeyBundle.fromLegacyBundle(
aliceKeys.getPublicKeyBundle()
),
createdNs: dateToNs(new Date()),
context: {
conversationId: 'test',
metadata: {},
},
})
expect(bobInvite.conversation!.topic).toEqual(
'/xmtp/0/m-4b52be1e8567d72d0bc407debe2d3c7fca2ae93a47e58c3f9b5c5068aff80ec5/proto'
)
})
Expand Down

0 comments on commit d0863cf

Please sign in to comment.