Skip to content

Commit 0d9d6e4

Browse files
committed
1 parent a460e03 commit 0d9d6e4

File tree

1 file changed

+21
-5
lines changed

1 file changed

+21
-5
lines changed

packages/core/test/EscrowFactory.ts

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { expect } from 'chai';
33
import { EventLog, Signer, ZeroAddress } from 'ethers';
44
import { ethers, upgrades } from 'hardhat';
55
import { EscrowFactory, HMToken, Staking } from '../typechain-types';
6-
import { fa, faker } from '@faker-js/faker';
6+
import { faker } from '@faker-js/faker';
77

88
let owner: Signer,
99
launcher1: Signer,
@@ -349,10 +349,6 @@ describe('EscrowFactory', function () {
349349
manifestHash
350350
);
351351

352-
await expect(tx)
353-
.to.emit(escrowFactory, 'LaunchedV2')
354-
.withArgs(tokenAddress, anyValue, FIXTURE_REQUESTER_ID);
355-
356352
const receipt = await tx.wait();
357353
const event = (
358354
receipt?.logs?.find(({ topics }) =>
@@ -362,6 +358,26 @@ describe('EscrowFactory', function () {
362358

363359
expect(event).to.not.be.undefined;
364360
const escrowAddress = event[1];
361+
362+
const escrow = await ethers.getContractAt(
363+
'contracts/Escrow.sol:Escrow',
364+
escrowAddress
365+
);
366+
367+
await expect(tx)
368+
.to.emit(escrowFactory, 'LaunchedV2')
369+
.withArgs(tokenAddress, escrowAddress, FIXTURE_REQUESTER_ID)
370+
.to.emit(escrow, 'PendingV2')
371+
.withArgs(
372+
manifestUrl,
373+
manifestHash,
374+
reputationOracleAddress,
375+
recordingOracleAddress,
376+
exchangeOracleAddress
377+
)
378+
.to.emit(escrow, 'Fund')
379+
.withArgs(fundAmount);
380+
365381
expect(await escrowFactory.hasEscrow(escrowAddress)).to.be.true;
366382
expect(await escrowFactory.lastEscrow()).to.equal(escrowAddress);
367383
});

0 commit comments

Comments
 (0)