Fix deprecated expectEvent.inLogs #3332 (#3333)

This commit is contained in:
Niccolò Petti
2022-04-23 15:20:55 +02:00
committed by GitHub
parent 5a75065659
commit d4e6236b2b
16 changed files with 133 additions and 136 deletions

View File

@ -16,7 +16,7 @@ function shouldBehaveLikeERC20Burnable (owner, initialBalance, [burner]) {
function shouldBurn (amount) {
beforeEach(async function () {
({ logs: this.logs } = await this.token.burn(amount, { from: owner }));
(this.receipt = await this.token.burn(amount, { from: owner }));
});
it('burns the requested amount', async function () {
@ -24,7 +24,7 @@ function shouldBehaveLikeERC20Burnable (owner, initialBalance, [burner]) {
});
it('emits a transfer event', async function () {
expectEvent.inLogs(this.logs, 'Transfer', {
expectEvent(this.receipt, 'Transfer', {
from: owner,
to: ZERO_ADDRESS,
value: amount,
@ -59,8 +59,7 @@ function shouldBehaveLikeERC20Burnable (owner, initialBalance, [burner]) {
beforeEach(async function () {
await this.token.approve(burner, originalAllowance, { from: owner });
const { logs } = await this.token.burnFrom(owner, amount, { from: burner });
this.logs = logs;
this.receipt = await this.token.burnFrom(owner, amount, { from: burner });
});
it('burns the requested amount', async function () {
@ -72,7 +71,7 @@ function shouldBehaveLikeERC20Burnable (owner, initialBalance, [burner]) {
});
it('emits a transfer event', async function () {
expectEvent.inLogs(this.logs, 'Transfer', {
expectEvent(this.receipt, 'Transfer', {
from: owner,
to: ZERO_ADDRESS,
value: amount,