Skip to content

Commit 7d73d43

Browse files
committed
test: ts: access conversation epoch through transaction
previously this used the session to access the keystore. Since we didn't initialize it this doesn't work anymore. We can use the transaction which knows the keystore. This is a design flaw overall. We have to discuss the best practice here. It would make sense to move getters to the CC instance which is how it is in the FFI layer.
1 parent 6b72b9b commit 7d73d43

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

crypto-ffi/bindings/js/test/wdio/database.test.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -180,11 +180,13 @@ describe("database", () => {
180180
);
181181

182182
const instance = await window.ccModule.CoreCrypto.init(database);
183-
const epoch = await instance.conversationEpoch(
184-
new window.ccModule.ConversationId(
185-
encoder.encode("convId").buffer
186-
)
187-
);
183+
const epoch = await instance.transaction(async (ctx) => {
184+
return await ctx.conversationEpoch(
185+
new window.ccModule.ConversationId(
186+
encoder.encode("convId").buffer
187+
)
188+
);
189+
});
188190
return epoch;
189191
}, JSON.stringify(stores));
190192

0 commit comments

Comments
 (0)