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

@ -27,12 +27,11 @@ contract('ERC721Burnable', function (accounts) {
describe('burn', function () {
const tokenId = firstTokenId;
let logs = null;
let receipt = null;
describe('when successful', function () {
beforeEach(async function () {
const result = await this.token.burn(tokenId, { from: owner });
logs = result.logs;
receipt = await this.token.burn(tokenId, { from: owner });
});
it('burns the given token ID and adjusts the balance of the owner', async function () {
@ -44,7 +43,7 @@ contract('ERC721Burnable', function (accounts) {
});
it('emits a burn event', async function () {
expectEvent.inLogs(logs, 'Transfer', {
expectEvent(receipt, 'Transfer', {
from: owner,
to: ZERO_ADDRESS,
tokenId: tokenId,
@ -55,8 +54,7 @@ contract('ERC721Burnable', function (accounts) {
describe('when there is a previous approval burned', function () {
beforeEach(async function () {
await this.token.approve(approved, tokenId, { from: owner });
const result = await this.token.burn(tokenId, { from: owner });
logs = result.logs;
receipt = await this.token.burn(tokenId, { from: owner });
});
context('getApproved', function () {