Skip to content

Commit 6dc88a2

Browse files
committed
test: refactor tests for events
1 parent 2fef884 commit 6dc88a2

File tree

6 files changed

+358
-31
lines changed

6 files changed

+358
-31
lines changed

plasma_framework/package-lock.json

Lines changed: 257 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

plasma_framework/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,11 @@
1414
"solidoc": "^1.0.5"
1515
},
1616
"devDependencies": {
17-
"elliptic": ">=6.5.3",
1817
"@codechecks/client": "^0.1.10",
18+
"@openzeppelin/test-helpers": "^0.5.6",
1919
"chai": "^4.2.0",
2020
"coveralls": "^3.0.6",
21+
"elliptic": ">=6.5.3",
2122
"eslint": "^5.3.0",
2223
"eslint-config-airbnb-base": "^13.1.0",
2324
"eslint-plugin-import": "^2.17.3",

plasma_framework/test/endToEndTests/FeeClaim.e2e.test.js

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
const EthVault = artifacts.require('EthVault');
22
const PaymentExitGame = artifacts.require('PaymentExitGame');
33
const PlasmaFramework = artifacts.require('PlasmaFramework');
4+
const PaymentStartStandardExit = artifacts.require('PaymentStartStandardExit');
5+
const PaymentStartInFlightExit = artifacts.require('PaymentStartInFlightExit');
46

57
const { constants, expectEvent } = require('openzeppelin-test-helpers');
68

@@ -227,12 +229,16 @@ contract('PlasmaFramework - Fee Claim', ([_, _maintainer, authority, richFather,
227229
};
228230

229231
const bondSize = await this.paymentExitGame.startStandardExitBondSize();
230-
const tx = await this.paymentExitGame.startStandardExit(args, {
232+
const { receipt } = await this.paymentExitGame.startStandardExit(args, {
231233
from: operatorFeeAddress,
232234
value: bondSize.add(this.processExitBountySize),
233235
gasPrice: this.dummyGasPrice,
234236
});
235-
await expectEvent.inLogs(tx.logs, 'ExitStarted', { owner: operatorFeeAddress });
237+
await expectEvent.inTransaction(
238+
receipt.transactionHash,
239+
PaymentStartStandardExit,
240+
'ExitStarted',
241+
);
236242
});
237243

238244
it('should be able to in-flight exit the fee via Payment transaction', async () => {
@@ -247,11 +253,15 @@ contract('PlasmaFramework - Fee Claim', ([_, _maintainer, authority, richFather,
247253
};
248254

249255
const bondSize = await this.paymentExitGame.startIFEBondSize();
250-
const tx = await this.paymentExitGame.startInFlightExit(args, {
256+
const { receipt } = await this.paymentExitGame.startInFlightExit(args, {
251257
from: alice,
252258
value: bondSize,
253259
});
254-
await expectEvent.inLogs(tx.logs, 'InFlightExitStarted');
260+
await expectEvent.inTransaction(
261+
receipt.transactionHash,
262+
PaymentStartInFlightExit,
263+
'InFlightExitStarted',
264+
);
255265
});
256266
});
257267
});

0 commit comments

Comments
 (0)