nicer output, comment
parent
e147cc9341
commit
e10e4b0eab
|
@ -39,9 +39,10 @@ module.exports = async function e2eEncryptionScenarios(alice, bob) {
|
||||||
bob.log.step(`starts SAS verification with ${alice.username}`);
|
bob.log.step(`starts SAS verification with ${alice.username}`);
|
||||||
const bobSasPromise = startSasVerifcation(bob, alice.username);
|
const bobSasPromise = startSasVerifcation(bob, alice.username);
|
||||||
const aliceSasPromise = acceptSasVerification(alice, bob.username);
|
const aliceSasPromise = acceptSasVerification(alice, bob.username);
|
||||||
|
// wait in parallel, so they don't deadlock on each other
|
||||||
const [bobSas, aliceSas] = await Promise.all([bobSasPromise, aliceSasPromise]);
|
const [bobSas, aliceSas] = await Promise.all([bobSasPromise, aliceSasPromise]);
|
||||||
assert.deepEqual(bobSas, aliceSas);
|
assert.deepEqual(bobSas, aliceSas);
|
||||||
bob.log.done(`done, (${bobSas.join(", ")}) matches!`);
|
bob.log.done(`done (match for ${bobSas.join(", ")})`);
|
||||||
const aliceMessage = "Guess what I just heard?!"
|
const aliceMessage = "Guess what I just heard?!"
|
||||||
await sendMessage(alice, aliceMessage);
|
await sendMessage(alice, aliceMessage);
|
||||||
await receiveMessage(bob, {sender: "alice", body: aliceMessage, encrypted: true});
|
await receiveMessage(bob, {sender: "alice", body: aliceMessage, encrypted: true});
|
||||||
|
|
Loading…
Reference in New Issue