Skip to content

Don't emit Approval event when approval is cleared on transfer (#1038) #1039

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 25, 2018

Conversation

abandeali1
Copy link
Contributor

Fixes #1038

πŸš€ Description

See title.

  • πŸ“˜ I've reviewed the OpenZeppelin Contributor Guidelines
  • βœ… I've added tests where applicable to test my new functionality.
  • πŸ“– I've made sure that my contracts are well-documented.
  • 🎨 I've run the JS/Solidity linters and fixed any issues (npm run lint:all:fix).

@abandeali1 abandeali1 changed the title Don't emit Approval event when approval is cleared on transfer Don't emit Approval event when approval is cleared on transfer (#1038) Jun 21, 2018
Copy link
Contributor

@shrugs shrugs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@shrugs shrugs merged commit dc1e352 into OpenZeppelin:master Jun 25, 2018
@johnhforrest
Copy link

Not opening a new PR for this one, but noticed that this block can be cleaned up when I was porting this over to our repo:

if (approved) {
  it('emit only a transfer event', async function () {
    logs.length.should.be.equal(1);
    logs[0].event.should.be.eq('Transfer');
    logs[0].args._from.should.be.equal(owner);
    logs[0].args._to.should.be.equal(this.to);
    logs[0].args._tokenId.should.be.bignumber.equal(tokenId);
    });
  } else {
    it('emits only a transfer event', async function () {
      logs.length.should.be.equal(1);
      logs[0].event.should.be.eq('Transfer');
      logs[0].args._from.should.be.equal(owner);
      logs[0].args._to.should.be.equal(this.to);
      logs[0].args._tokenId.should.be.bignumber.equal(tokenId);
    });
  }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ERC721 unnecessarily emits an Approval event on transfers
3 participants