Skip to content
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

Add test cases around new EXTCODEHASH behavior #235

Closed
fulldecent opened this issue Dec 11, 2019 · 4 comments
Closed

Add test cases around new EXTCODEHASH behavior #235

fulldecent opened this issue Dec 11, 2019 · 4 comments
Assignees
Labels
enhancement New feature or request

Comments

@fulldecent
Copy link
Collaborator

fulldecent commented Dec 11, 2019

The behavior of this implementation was changed slightly with the switch to EXTCODEHASH. Let's document this using test cases.

Mocks:

  • Contract R
    • Has a token receive function which emits an event Received
  • Contract A is R
    • Has constructor
      1. Deploys NFToken
      2. Mints token id=1
      3. Transfers token id=1 to self
  • Contract B
    • Has constructor
      1. Deploys NFToken
      2. Deploys R
      3. Transfers token id=1 to R

Tests:

  1. Test 1
    1. Transaction 1 -- Deploy NFToken
    2. Transaction 2 -- Mint token id=1
    3. Transaction 3 -- Deploy Contract R
    4. Transaction 4 -- Transfer token id=1 to R
    5. Expect NO event on Constantinople
  2. Test 2
    1. Transaction 1 -- Deploy NFToken
    2. Transaction 2 -- Mint token id=1
    3. Transaction 3 -- Deploy Contract R
    4. Expect NO event on Constantinople
  3. Test 3
    1. Transaction 1 -- Deploy Contract B
    2. Expect event on Constantinople (but no event with same test using old version of implementation)
@xpepermint
Copy link
Member

@fulldecent do you have time to add these? The rest of the team is overbooked at the moment.

@fulldecent
Copy link
Collaborator Author

You bet, I'm on it.

@MoMannn MoMannn added the enhancement New feature or request label Feb 3, 2020
@frangio
Copy link

frangio commented Feb 3, 2020

I think there should be another test for a transfer to a contract that has selfdestructed, since the result of extcodehash will be different.

@fulldecent
Copy link
Collaborator Author

Progress on a test is here #241

Requesting help with this line:

https://github.com/0xcert/ethereum-erc721/pull/241/files#diff-1eaa4a12fea6a0a32769fb056436a04aR408

I need to check logs from a deploy transaction.

@MoMannn MoMannn closed this as completed Aug 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants
@xpepermint @fulldecent @frangio @MoMannn and others