Skip to content

Commit

Permalink
fix bug in test
Browse files Browse the repository at this point in the history
  • Loading branch information
Rinse12 committed Sep 3, 2023
1 parent 102d58e commit 1e674f2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions test/node-and-browser/signatures/pubsub.messages.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -307,10 +307,10 @@ describe("challengeanswer", async () => {
const comment = await generateMockPost(imageCaptchaSubplebbitAddress, tempPlebbit);
comment.removeAllListeners("challenge");

const originalPublish = comment._clientsManager.pubsubPublish.bind(comment._clientsManager);
const originalPublish = comment._clientsManager.pubsubPublishOnProvider.bind(comment._clientsManager);

comment.once("challenge", async (challengeMsg) => {
comment._clientsManager.pubsubPublish = () => undefined;
comment._clientsManager.pubsubPublishOnProvider = () => undefined; // Disable publishing

await comment.publishChallengeAnswers([]);
// comment._challengeAnswer should be defined now
Expand All @@ -320,7 +320,7 @@ describe("challengeanswer", async () => {
signers[5].publicKey // Use a public key that cannot be decrypted for the sub
);
comment._challengeAnswer.signature = await signChallengeAnswer(comment._challengeAnswer, comment.pubsubMessageSigner);
await originalPublish(comment.subplebbit.pubsubTopic, comment._challengeAnswer);
await originalPublish(comment.subplebbit.pubsubTopic, comment._challengeAnswer, comment._pubsubProviders[0]);
});

await publishWithExpectedResult(comment, false, messages.ERR_SUB_FAILED_TO_DECRYPT_PUBSUB_MSG);
Expand Down

0 comments on commit 1e674f2

Please sign in to comment.