* Add BigNumber support to expectEvent/inLogs (#1026) * switched direct logs array check to expectEvent method in AllowanceCrowdsale.test.js * Refactor expectEvent.inLogs function to use simple value number check * Introduced should.be.bignumber method to compare BigNumber values * Use expectEvent to test logs (#1232) * Removed trailing space
This commit is contained in:
committed by
Nicolás Venturo
parent
75c0a59bb4
commit
536262f2ec
@ -31,10 +31,11 @@ function shouldBehaveLikeEscrow (primary, [payee1, payee2]) {
|
||||
});
|
||||
|
||||
it('emits a deposited event', async function () {
|
||||
const receipt = await this.escrow.deposit(payee1, { from: primary, value: amount });
|
||||
|
||||
const event = expectEvent.inLogs(receipt.logs, 'Deposited', { payee: payee1 });
|
||||
event.args.weiAmount.should.be.bignumber.equal(amount);
|
||||
const { logs } = await this.escrow.deposit(payee1, { from: primary, value: amount });
|
||||
expectEvent.inLogs(logs, 'Deposited', {
|
||||
payee: payee1,
|
||||
weiAmount: amount
|
||||
});
|
||||
});
|
||||
|
||||
it('can add multiple deposits on a single account', async function () {
|
||||
@ -83,10 +84,11 @@ function shouldBehaveLikeEscrow (primary, [payee1, payee2]) {
|
||||
|
||||
it('emits a withdrawn event', async function () {
|
||||
await this.escrow.deposit(payee1, { from: primary, value: amount });
|
||||
const receipt = await this.escrow.withdraw(payee1, { from: primary });
|
||||
|
||||
const event = expectEvent.inLogs(receipt.logs, 'Withdrawn', { payee: payee1 });
|
||||
event.args.weiAmount.should.be.bignumber.equal(amount);
|
||||
const { logs } = await this.escrow.withdraw(payee1, { from: primary });
|
||||
expectEvent.inLogs(logs, 'Withdrawn', {
|
||||
payee: payee1,
|
||||
weiAmount: amount
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user